-- cgit 1.4.1 From cc14d57c490944077896b108454b2e11fc557800 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:26:21 +0200 Subject: chore: Add initial .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..ef4798b7b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +hardware-configuration.nix +result/ -- cgit 1.4.1 From d53ffba1984949fa03dd66ac088b50d9f0115e66 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:27:31 +0200 Subject: chore: Ignore local-configuration.nix --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ef4798b7b6..64bd5e540b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ hardware-configuration.nix +local-configuration.nix result/ -- cgit 1.4.1 From e2279e52c34ea0b8c839f5cfbf1d412bd1c1ba87 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:27:35 +0200 Subject: feat: Add initial NixOS configuration Adds NixOS configuration to configure my base system with all sorts of things, including - but not limited to - i3, emacs, FF57, connman and so on. Not all of these things are fully configured yet (especially in the desktop environment) but I'm hoping to get more of that done in the future. --- configuration.nix | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 configuration.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000000..467e10b1c2 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,119 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +let + unstable = import { config.allowUnfree = true; }; +in { + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./local-configuration.nix + ]; + + # Ensure encrypted devices are decrypted + boot.initrd.luks.devices.adho.device = "/dev/disk/by-uuid/722006b0-9654-4ea1-8703-e0cf9ac1905e"; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Use connman for network configuration + networking.connman.enable = true; + hardware.pulseaudio.enable = true; + programs.light.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Oslo"; + + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = with pkgs; [ + curl gnumake unzip openjdk gcc htop tree direnv tmux fish ripgrep + gnupg pass git + ]; + + # Enable the X11 windowing system. + services.xserver.enable = true; + services.xserver.layout = "us,no"; + services.xserver.xkbOptions = "caps:super, grp:shifts_toggle"; + + # Configure i3 & compositor + services.xserver.windowManager.i3.enable = true; + services.compton.enable = true; + + # Configure Redshift for Oslo + services.redshift.enable = true; + services.redshift.latitude = "59.911491"; + services.redshift.longitude = "10.757933"; + + # Configure shell environment + programs.fish.enable = true; + programs.ssh.startAgent = true; + services.emacs.enable = true; + services.emacs.defaultEditor = true; + + # Configure other random applications: + programs.java.enable = true; + nixpkgs.config.allowUnfree = true; + + # Configure fonts + fonts = { + fonts = with pkgs; [ + input-fonts + ]; + }; + + # Configure user account + users.defaultUserShell = pkgs.fish; + users.extraUsers.vincent = { + extraGroups = [ "wheel" ]; + isNormalUser = true; + uid = 1000; + shell = pkgs.fish; + packages = with pkgs; [ + jetbrains.idea-community pavucontrol spotify xclip tdesktop + rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin + ]; + }; + + # Configure random setting of wallpapers + systemd.user.services.clone-wallpapers = { + description = "Clone wallpaper repository"; + enable = true; + before = [ "feh-wp.service" "feh-wp.timer" ] + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.fish}/bin/fish -c '${pkgs.coreutils}/bin/stat %h/wallpapers; or ${pkgs.git}/bin/git clone https://git.tazj.in/tazjin/wallpapers.git %h/wallpapers'"; + }; + }; + + systemd.user.services.feh-wp = { + description = "Randomly set wallpaper via feh"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.feh}/bin/feh --recursive --randomize --bg-fill %h/wallpapers"; + }; + }; + + systemd.user.timers.feh-wp = { + description = "Set a random wallpaper every hour"; + wantedBy = [ "timers.target" ]; + + timerConfig = { + OnActiveSec = "3second"; + OnUnitActiveSec = "1hour"; + }; + }; + + security.sudo.enable = true; + security.sudo.extraConfig = "wheel ALL=(ALL:ALL) SETENV: ALL"; + + # This value determines the NixOS release with which your system is to be + # compatible, in order to avoid breaking some software such as database + # servers. You should change this only after NixOS release notes say you + # should. + system.stateVersion = "17.09"; # Did you read the comment? +} -- cgit 1.4.1 From a844da9351844fc9d7c0d3f710005d16264d7e4e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:28:43 +0200 Subject: feat(adho): Add local configuration of adho machine --- adho-configuration.nix | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 adho-configuration.nix diff --git a/adho-configuration.nix b/adho-configuration.nix new file mode 100644 index 0000000000..ae7ac5e006 --- /dev/null +++ b/adho-configuration.nix @@ -0,0 +1,7 @@ +# Local configuration for 'adho' (Thinkpad T470s) +{ config, ...}: + +{ + networking.hostName = "adho"; + services.xserver.libinput.enable = true; +} -- cgit 1.4.1 From c4c0345d3f23540ab27919ae11573bfb4556c9ea Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:29:29 +0200 Subject: refactor(adho): Make connman configuration adho specific --- adho-configuration.nix | 1 + configuration.nix | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index ae7ac5e006..e5a1d801b4 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -3,5 +3,6 @@ { networking.hostName = "adho"; + networking.connman.enable = true; services.xserver.libinput.enable = true; } diff --git a/configuration.nix b/configuration.nix index 467e10b1c2..84e3911bfe 100644 --- a/configuration.nix +++ b/configuration.nix @@ -20,8 +20,6 @@ in { boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - # Use connman for network configuration - networking.connman.enable = true; hardware.pulseaudio.enable = true; programs.light.enable = true; -- cgit 1.4.1 From 21660c6bb62d0774a74280a853aec09b846db96d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:37:22 +0200 Subject: feat(stallo): Add local configuration for stallo --- stallo-configuration.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 stallo-configuration.nix diff --git a/stallo-configuration.nix b/stallo-configuration.nix new file mode 100644 index 0000000000..592ff6a80a --- /dev/null +++ b/stallo-configuration.nix @@ -0,0 +1,14 @@ + +# Local configuration for 'stallo' (Home desktop PC) +{ config, ...}: + +{ + networking.hostName = "stallo"; + networking.wireless.enable = true; + networking.wireless.networks = { + "How do I computer fast?" = { + # Welcome to roast club! + psk = "washyourface"; + }; + }; +} -- cgit 1.4.1 From e0c8c5c798d51cb2cc37bd478d364dca99cce0b8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:38:13 +0200 Subject: fix: Add a missing semicolon --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 84e3911bfe..df677ed941 100644 --- a/configuration.nix +++ b/configuration.nix @@ -81,7 +81,7 @@ in { systemd.user.services.clone-wallpapers = { description = "Clone wallpaper repository"; enable = true; - before = [ "feh-wp.service" "feh-wp.timer" ] + before = [ "feh-wp.service" "feh-wp.timer" ]; serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.fish}/bin/fish -c '${pkgs.coreutils}/bin/stat %h/wallpapers; or ${pkgs.git}/bin/git clone https://git.tazj.in/tazjin/wallpapers.git %h/wallpapers'"; -- cgit 1.4.1 From 2b6d132eb6e16c81105c62acabf6b774098fe918 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:40:28 +0200 Subject: docs: Add README --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000..970f25e6e9 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +NixOS configuration +=================== + +Set up the unstable channel first: + +``` +nix-channel --add http://nixos.org/channels/nixos-unstable nixos-unstable +nix-channel --update +``` + +## TODO + +* [ ] place i3 (and related) configuration automatically +* [ ] place [emacs configuration](https://github.com/tazjin/emacs.d) automatically +* [ ] configure channel automatically (if possible) +* [ ] configure Rust setup -- cgit 1.4.1 From 98fc907d900d2dfaa3fd465278bb7bc50f560fa4 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:40:54 +0200 Subject: fix: Fix gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 64bd5e540b..773fa16670 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ hardware-configuration.nix local-configuration.nix -result/ +result -- cgit 1.4.1 From 28feb4bc92c6ff7541dade32a4db55c1905e9d3f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 16:42:31 +0200 Subject: fix(adho): Configure encrypted disks in local config --- adho-configuration.nix | 1 + configuration.nix | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index e5a1d801b4..0f8e17bb00 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -2,6 +2,7 @@ { config, ...}: { + boot.initrd.luks.devices.adho.device = "/dev/disk/by-uuid/722006b0-9654-4ea1-8703-e0cf9ac1905e"; networking.hostName = "adho"; networking.connman.enable = true; services.xserver.libinput.enable = true; diff --git a/configuration.nix b/configuration.nix index df677ed941..19404be34d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -13,9 +13,6 @@ in { ./local-configuration.nix ]; - # Ensure encrypted devices are decrypted - boot.initrd.luks.devices.adho.device = "/dev/disk/by-uuid/722006b0-9654-4ea1-8703-e0cf9ac1905e"; - # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; -- cgit 1.4.1 From f771c2a643387f75ee3bf9b71cc3039ef92c0a7f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 20:01:07 +0200 Subject: fix(adho): Move 'light' config to adho local --- adho-configuration.nix | 1 + configuration.nix | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index 0f8e17bb00..c5aada6a9a 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -6,4 +6,5 @@ networking.hostName = "adho"; networking.connman.enable = true; services.xserver.libinput.enable = true; + programs.light.enable = true; } diff --git a/configuration.nix b/configuration.nix index 19404be34d..c88739298c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -18,7 +18,6 @@ in { boot.loader.efi.canTouchEfiVariables = true; hardware.pulseaudio.enable = true; - programs.light.enable = true; # Set your time zone. time.timeZone = "Europe/Oslo"; -- cgit 1.4.1 From a11aca65a58427fa6d54619b4caa94d073a742b4 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 20:01:21 +0200 Subject: fix: 'Manually' randomize feh wallpapers The wallpaper folder is now in git and feh will pick any random file in the folder that it is pointed at, leading to it constantly failing while trying to set git objects as the wallpaper. This uses manual 'fd | shuf | xargs' pipeline for the same purpose. --- configuration.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index c88739298c..a7e3573232 100644 --- a/configuration.nix +++ b/configuration.nix @@ -69,7 +69,7 @@ in { shell = pkgs.fish; packages = with pkgs; [ jetbrains.idea-community pavucontrol spotify xclip tdesktop - rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin + rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin fd ]; }; @@ -88,7 +88,8 @@ in { description = "Randomly set wallpaper via feh"; serviceConfig = { Type = "oneshot"; - ExecStart = "${pkgs.feh}/bin/feh --recursive --randomize --bg-fill %h/wallpapers"; + WorkingDirectory = "%h/wallpapers"; + ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'"; }; }; -- cgit 1.4.1 From 6845e2efd4d94441d9c6af1614bc4058fca51aa7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 20:02:24 +0200 Subject: fix(stallo): Post-installatio wifi, gfx, luks fixes --- stallo-configuration.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stallo-configuration.nix b/stallo-configuration.nix index 592ff6a80a..57f55d774d 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -3,10 +3,15 @@ { config, ...}: { + boot.initrd.luks.devices.stallo-luks.device = "/dev/disk/by-uuid/b484cf1e-a27b-4785-8bd6-fa85a004b073"; + + # Use proprietary nvidia driver + services.xserver.videoDrivers = [ "nvidia" ]; + networking.hostName = "stallo"; networking.wireless.enable = true; networking.wireless.networks = { - "How do I computer fast?" = { + "How do I computer?" = { # Welcome to roast club! psk = "washyourface"; }; -- cgit 1.4.1 From 6dc6034bc84d8ffac631ecbb4a8bb2c41815d6a5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 21:38:13 +0200 Subject: feat: Install tig --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index a7e3573232..bd06795830 100644 --- a/configuration.nix +++ b/configuration.nix @@ -70,6 +70,7 @@ in { packages = with pkgs; [ jetbrains.idea-community pavucontrol spotify xclip tdesktop rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin fd + tig ]; }; -- cgit 1.4.1 From 96096f39f201409d62bd5bb825a9f3e0d2416895 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Oct 2017 22:13:33 +0200 Subject: feat: Install all standard man pages --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index bd06795830..8575067edc 100644 --- a/configuration.nix +++ b/configuration.nix @@ -26,7 +26,7 @@ in { # $ nix-env -qaP | grep wget environment.systemPackages = with pkgs; [ curl gnumake unzip openjdk gcc htop tree direnv tmux fish ripgrep - gnupg pass git + gnupg pass git manpages stdmanpages ]; # Enable the X11 windowing system. -- cgit 1.4.1 From 270ac6ee3d17a94e1543605ac36e26324f707d95 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 02:49:37 +0200 Subject: feat: Install k8s (mainly kubectl) --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 8575067edc..4ec4f47aec 100644 --- a/configuration.nix +++ b/configuration.nix @@ -70,7 +70,7 @@ in { packages = with pkgs; [ jetbrains.idea-community pavucontrol spotify xclip tdesktop rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin fd - tig + tig kubernetes ]; }; -- cgit 1.4.1 From 4b6ac623074cf34fd8682076a5bdb72fea331955 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 10:11:32 +0200 Subject: fix(adho): Use Intel video driver to fix xrandr --- adho-configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index c5aada6a9a..0f7121596a 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -6,5 +6,6 @@ networking.hostName = "adho"; networking.connman.enable = true; services.xserver.libinput.enable = true; + services.xserver.videoDrivers = [ "intel" ]; programs.light.enable = true; } -- cgit 1.4.1 From b24b4b54d45074e73effd8d832b6fd611d534b32 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 13:47:10 +0200 Subject: refactor(adho): Replace connman with nix-based wifi config Now that WPA2 is broken wifi passwords aren't secret anymore, anyways ;-) --- adho-configuration.nix | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index 0f7121596a..b9dba8e3ff 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -4,8 +4,26 @@ { boot.initrd.luks.devices.adho.device = "/dev/disk/by-uuid/722006b0-9654-4ea1-8703-e0cf9ac1905e"; networking.hostName = "adho"; - networking.connman.enable = true; services.xserver.libinput.enable = true; services.xserver.videoDrivers = [ "intel" ]; programs.light.enable = true; + + networking.wireless.enable = true; + networking.wireless.networks = { + # Welcome to roast club! + "How do I computer?" = { + psk = "washyourface"; + }; + + # Did someone say wifi credentials are secret? + # http://bit.ly/2gI43QP + "Amesto-mobile" = { + psk = "ostemAt1"; + }; + + # Public places in Oslo: + "Abelone" = { + psk = "speakeasy"; + }; + }; } -- cgit 1.4.1 From 088f16bd40cf72facbf2ff755542c4a784f7635d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 13:48:12 +0200 Subject: feat: Install xfce4-screenshooter --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 4ec4f47aec..06d63d05f1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -70,7 +70,7 @@ in { packages = with pkgs; [ jetbrains.idea-community pavucontrol spotify xclip tdesktop rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin fd - tig kubernetes + tig kubernetes xfce.xfce4-screenshooter ]; }; -- cgit 1.4.1 From 9e60dd04b3af0138aad91aac682fbeac6b452b0e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 18:12:33 +0200 Subject: feat: Install exa --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 06d63d05f1..d868a73eb2 100644 --- a/configuration.nix +++ b/configuration.nix @@ -70,7 +70,7 @@ in { packages = with pkgs; [ jetbrains.idea-community pavucontrol spotify xclip tdesktop rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin fd - tig kubernetes xfce.xfce4-screenshooter + tig kubernetes xfce.xfce4-screenshooter unstable.exa ]; }; -- cgit 1.4.1 From bbd39eaf16af68a1c37db16efa3362dffffd71c9 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 18:12:36 +0200 Subject: fix(compton): Set rendering backend to default 'xrender' The 'glx' backend which NixOS defaults to causes strange screen redrawing issues with multiple monitors. --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index d868a73eb2..df87c32aac 100644 --- a/configuration.nix +++ b/configuration.nix @@ -37,6 +37,7 @@ in { # Configure i3 & compositor services.xserver.windowManager.i3.enable = true; services.compton.enable = true; + services.compton.backend = "xrender"; # Configure Redshift for Oslo services.redshift.enable = true; -- cgit 1.4.1 From 10d1ad92801ce667e07fc4726914e50a13a3e420 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 20:40:41 +0200 Subject: feat: Numix GTK theme! * Add Numix GTK theme ... though it seems like the icon theme is broken. * use stable exa --- configuration.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index df87c32aac..02c6c32885 100644 --- a/configuration.nix +++ b/configuration.nix @@ -71,7 +71,8 @@ in { packages = with pkgs; [ jetbrains.idea-community pavucontrol spotify xclip tdesktop rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin fd - tig kubernetes xfce.xfce4-screenshooter unstable.exa + tig kubernetes xfce.xfce4-screenshooter exa lxappearance-gtk3 + numix-gtk-theme numix-icon-theme unstable.numix-cursor-theme ]; }; -- cgit 1.4.1 From 7d09557096e277445b60ca80c0b19366ec612432 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 21:46:13 +0200 Subject: feat: Add nixpkgs-mozilla overlay Imports the nixpkgs-mozilla overlay and installs stable Rust from the same channel as rustup. --- .gitmodules | 3 +++ configuration.nix | 11 +++++++---- nixpkgs-mozilla | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 nixpkgs-mozilla diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..b51f28b60a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "nixpkgs-mozilla"] + path = nixpkgs-mozilla + url = git@github.com:mozilla/nixpkgs-mozilla.git diff --git a/configuration.nix b/configuration.nix index 02c6c32885..64f52aa5f2 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,8 +4,8 @@ { config, pkgs, ... }: -let - unstable = import { config.allowUnfree = true; }; +let rust-overlay = import "/etc/nixos/nixpkgs-mozilla/rust-overlay.nix"; + unstable = import { config.allowUnfree = true; }; in { imports = [ # Include the results of the hardware scan. @@ -13,6 +13,10 @@ in { ./local-configuration.nix ]; + # Configure the Nix package manager + nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ rust-overlay ]; + # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -26,7 +30,7 @@ in { # $ nix-env -qaP | grep wget environment.systemPackages = with pkgs; [ curl gnumake unzip openjdk gcc htop tree direnv tmux fish ripgrep - gnupg pass git manpages stdmanpages + gnupg pass git manpages stdmanpages latest.rustChannels.stable.rust ]; # Enable the X11 windowing system. @@ -52,7 +56,6 @@ in { # Configure other random applications: programs.java.enable = true; - nixpkgs.config.allowUnfree = true; # Configure fonts fonts = { diff --git a/nixpkgs-mozilla b/nixpkgs-mozilla new file mode 160000 index 0000000000..6179dd8765 --- /dev/null +++ b/nixpkgs-mozilla @@ -0,0 +1 @@ +Subproject commit 6179dd876578ca2931f864627598ede16ba6cdef -- cgit 1.4.1 From 0f099705f7d1942c54e013ca4490c6719d82f23d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 21:51:58 +0200 Subject: refactor: Use relative path for nixpkgs-mozilla --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 64f52aa5f2..8ace418cdc 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,7 +4,7 @@ { config, pkgs, ... }: -let rust-overlay = import "/etc/nixos/nixpkgs-mozilla/rust-overlay.nix"; +let rust-overlay = import nixpkgs-mozilla/rust-overlay.nix; unstable = import { config.allowUnfree = true; }; in { imports = -- cgit 1.4.1 From aa5dcbc4777a8e6f42eaee9ac0301d687363e040 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 22:34:44 +0200 Subject: feat: Add Nix build for nixfd Builds my [nixfd][] tool for searching a cached version of the Nix package list. [nixfd]: https://github.com/tazjin/nixfd --- configuration.nix | 2 ++ pkgs/nixfd.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/nixfd.nix diff --git a/configuration.nix b/configuration.nix index 8ace418cdc..1af903fb25 100644 --- a/configuration.nix +++ b/configuration.nix @@ -6,6 +6,7 @@ let rust-overlay = import nixpkgs-mozilla/rust-overlay.nix; unstable = import { config.allowUnfree = true; }; + nixfd = import pkgs/nixfd.nix; in { imports = [ # Include the results of the hardware scan. @@ -31,6 +32,7 @@ in { environment.systemPackages = with pkgs; [ curl gnumake unzip openjdk gcc htop tree direnv tmux fish ripgrep gnupg pass git manpages stdmanpages latest.rustChannels.stable.rust + nixfd ]; # Enable the X11 windowing system. diff --git a/pkgs/nixfd.nix b/pkgs/nixfd.nix new file mode 100644 index 0000000000..71e6ff82e9 --- /dev/null +++ b/pkgs/nixfd.nix @@ -0,0 +1,28 @@ +with import {}; + +# Build and install my nixfd tool. +with rustPlatform; + +buildRustPackage rec { + name = "nixfd-${version}"; + version = "0.1.0"; + + # This hash is of course total bullshit due to the dummy libc dependency + # caused by: + # https://github.com/NixOS/nixpkgs/issues/22737 + depsSha256 = "0iihnyq50qbq0fkvcj5jxilcw7d3bwd1x3gwcq0mzrcah23say0j"; + + src = fetchFromGitHub { + owner = "tazjin"; + repo = "nixfd"; + rev = "dbadc9ef8486070f26677154fa032a47d732b7a9"; + sha256 = "162301lc4znlqbansmaw9sla1rwi2s5nfmhl3z752n6aj2gcvz89"; + }; + + meta = with stdenv.lib; { + description = "Tired of waiting for nix-env -qaP?"; + homepage = https://github.com/tazjin/nixfd; + license = licenses.mit; + platforms = platforms.all; + }; +} -- cgit 1.4.1 From 202467e9894f4b33186b686d66a4b98a1ac386a8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Oct 2017 22:53:49 +0200 Subject: refactor: Move packages & wallpapers config into own nix files My systems are single-user machines and the package configuration can go in the system-wide package list in full. This splits out the package list into a separate file and also moves the systemd units for wallpaper setting into a separate file. --- configuration.nix | 59 +++++----------------------------------------------- packages.nix | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ wallpapers.nix | 34 ++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 54 deletions(-) create mode 100644 packages.nix create mode 100644 wallpapers.nix diff --git a/configuration.nix b/configuration.nix index 1af903fb25..421b025497 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,20 +4,15 @@ { config, pkgs, ... }: -let rust-overlay = import nixpkgs-mozilla/rust-overlay.nix; - unstable = import { config.allowUnfree = true; }; - nixfd = import pkgs/nixfd.nix; -in { +{ imports = - [ # Include the results of the hardware scan. + [ ./hardware-configuration.nix ./local-configuration.nix + ./packages.nix + ./wallpapers.nix ]; - # Configure the Nix package manager - nixpkgs.config.allowUnfree = true; - nixpkgs.overlays = [ rust-overlay ]; - # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -27,14 +22,6 @@ in { # Set your time zone. time.timeZone = "Europe/Oslo"; - # List packages installed in system profile. To search by name, run: - # $ nix-env -qaP | grep wget - environment.systemPackages = with pkgs; [ - curl gnumake unzip openjdk gcc htop tree direnv tmux fish ripgrep - gnupg pass git manpages stdmanpages latest.rustChannels.stable.rust - nixfd - ]; - # Enable the X11 windowing system. services.xserver.enable = true; services.xserver.layout = "us,no"; @@ -65,7 +52,7 @@ in { input-fonts ]; }; - + # Configure user account users.defaultUserShell = pkgs.fish; users.extraUsers.vincent = { @@ -73,42 +60,6 @@ in { isNormalUser = true; uid = 1000; shell = pkgs.fish; - packages = with pkgs; [ - jetbrains.idea-community pavucontrol spotify xclip tdesktop - rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin fd - tig kubernetes xfce.xfce4-screenshooter exa lxappearance-gtk3 - numix-gtk-theme numix-icon-theme unstable.numix-cursor-theme - ]; - }; - - # Configure random setting of wallpapers - systemd.user.services.clone-wallpapers = { - description = "Clone wallpaper repository"; - enable = true; - before = [ "feh-wp.service" "feh-wp.timer" ]; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.fish}/bin/fish -c '${pkgs.coreutils}/bin/stat %h/wallpapers; or ${pkgs.git}/bin/git clone https://git.tazj.in/tazjin/wallpapers.git %h/wallpapers'"; - }; - }; - - systemd.user.services.feh-wp = { - description = "Randomly set wallpaper via feh"; - serviceConfig = { - Type = "oneshot"; - WorkingDirectory = "%h/wallpapers"; - ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'"; - }; - }; - - systemd.user.timers.feh-wp = { - description = "Set a random wallpaper every hour"; - wantedBy = [ "timers.target" ]; - - timerConfig = { - OnActiveSec = "3second"; - OnUnitActiveSec = "1hour"; - }; }; security.sudo.enable = true; diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000000..83fe2bc119 --- /dev/null +++ b/packages.nix @@ -0,0 +1,62 @@ +# This file contains configuration for packages to install. +# It does not contain configuration for software that is already covered +# by other NixOS options (e.g. emacs) + +{ config, pkgs, ... }: + +let unstable = import { config.allowUnfree = true; }; + rust-overlay = import nixpkgs-mozilla/rust-overlay.nix; +in { + # Configure the Nix package manager + nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ rust-overlay ]; + + # ... and declare packages to be installed. + environment.systemPackages = with pkgs; [ + # Default nixos.* packages: + alacritty + curl + direnv + exa + fd + fish + gcc + git + gnumake + gnupg + htop + i3lock + jetbrains.idea-community + kubernetes + lxappearance-gtk3 + manpages + numix-gtk-theme + numix-icon-theme + openjdk + pass + pavucontrol + ripgrep + rofi + rofi-pass + spotify + stdmanpages + tdesktop + tig + tmux + tree + unzip + xclip + xfce.xfce4-screenshooter + + # nixos-unstable.* packages: + unstable.firefox-beta-bin + unstable.numix-cursor-theme + + # Overlay packages: + latest.rustChannels.stable.rust + + # Custom packages: + (import pkgs/nixfd.nix) + ]; +} + diff --git a/wallpapers.nix b/wallpapers.nix new file mode 100644 index 0000000000..4faf7ef52c --- /dev/null +++ b/wallpapers.nix @@ -0,0 +1,34 @@ +# Configuration for randomly setting wallpapers. +{ config, pkgs, ... }: + +{ + # Configure random setting of wallpapers + systemd.user.services.clone-wallpapers = { + description = "Clone wallpaper repository"; + enable = true; + before = [ "feh-wp.service" "feh-wp.timer" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.fish}/bin/fish -c '${pkgs.coreutils}/bin/stat %h/wallpapers; or ${pkgs.git}/bin/git clone https://git.tazj.in/tazjin/wallpapers.git %h/wallpapers'"; + }; + }; + + systemd.user.services.feh-wp = { + description = "Randomly set wallpaper via feh"; + serviceConfig = { + Type = "oneshot"; + WorkingDirectory = "%h/wallpapers"; + ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'"; + }; + }; + + systemd.user.timers.feh-wp = { + description = "Set a random wallpaper every hour"; + wantedBy = [ "timers.target" ]; + + timerConfig = { + OnActiveSec = "3second"; + OnUnitActiveSec = "1hour"; + }; + }; +} -- cgit 1.4.1 From 296ae9f1fdd6ca499358e49901faeb985f5e926b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 17 Oct 2017 00:28:57 +0200 Subject: feat(pkgs): Add 'wallpapers' derivation Adds a derivation that fetches my wallpapers from git. I'm getting closer to understanding "the Nix way", i.e. that maybe thinking about stuff like this in terms of "the wallpapers should be in my home folder" is incorrect. --- pkgs/wallpapers.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pkgs/wallpapers.nix diff --git a/pkgs/wallpapers.nix b/pkgs/wallpapers.nix new file mode 100644 index 0000000000..2f15e45113 --- /dev/null +++ b/pkgs/wallpapers.nix @@ -0,0 +1,21 @@ +# Fetch my wallpapers from git +with import {}; + +stdenv.mkDerivation { + name = "tazjins-wallpapers-1"; + + src = fetchgit { + url = "https://git.tazj.in/tazjin/wallpapers.git"; + rev = "3bce73b605ba5f848cb4e7cc33058a2be3952c68"; + }; + + installPhase = '' + mkdir -p $out/share/wallpapers + cp -r $src/* $out/share/wallpapers + ''; + + meta = with stdenv.lib; { + description = "tazjin's wallpaper collection"; + platforms = platforms.all; + }; +} -- cgit 1.4.1 From 4327d0e0b982f8ab7ad43b3ddc784a9a8907a158 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 17 Oct 2017 00:32:48 +0200 Subject: refactor(desktop): Split out desktop configuration * move desktop configuration to own nix file * remove old clone-wallpapers service * use wallpapers nix package for randomly setting wallpaper --- configuration.nix | 24 +----------------------- desktop.nix | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ wallpapers.nix | 34 ---------------------------------- 3 files changed, 52 insertions(+), 57 deletions(-) create mode 100644 desktop.nix delete mode 100644 wallpapers.nix diff --git a/configuration.nix b/configuration.nix index 421b025497..c03dc06ebb 100644 --- a/configuration.nix +++ b/configuration.nix @@ -10,7 +10,7 @@ ./hardware-configuration.nix ./local-configuration.nix ./packages.nix - ./wallpapers.nix + ./desktop.nix ]; # Use the systemd-boot EFI boot loader. @@ -22,21 +22,6 @@ # Set your time zone. time.timeZone = "Europe/Oslo"; - # Enable the X11 windowing system. - services.xserver.enable = true; - services.xserver.layout = "us,no"; - services.xserver.xkbOptions = "caps:super, grp:shifts_toggle"; - - # Configure i3 & compositor - services.xserver.windowManager.i3.enable = true; - services.compton.enable = true; - services.compton.backend = "xrender"; - - # Configure Redshift for Oslo - services.redshift.enable = true; - services.redshift.latitude = "59.911491"; - services.redshift.longitude = "10.757933"; - # Configure shell environment programs.fish.enable = true; programs.ssh.startAgent = true; @@ -46,13 +31,6 @@ # Configure other random applications: programs.java.enable = true; - # Configure fonts - fonts = { - fonts = with pkgs; [ - input-fonts - ]; - }; - # Configure user account users.defaultUserShell = pkgs.fish; users.extraUsers.vincent = { diff --git a/desktop.nix b/desktop.nix new file mode 100644 index 0000000000..335e15d87d --- /dev/null +++ b/desktop.nix @@ -0,0 +1,51 @@ +# Configuration for the desktop environment + +{ config, pkgs, ... }: + +let wallpapers = import ./pkgs/wallpapers.nix; +in { + # Configure basic X-server stuff: + services.xserver.enable = true; + services.xserver.layout = "us,no"; + services.xserver.xkbOptions = "caps:super, grp:shifts_toggle"; + + # configure desktop environment: + services.xserver.windowManager.i3.enable = true; + services.compton.enable = true; + services.compton.backend = "xrender"; # this should be the default! + + # Configure Redshift for Oslo + services.redshift.enable = true; + services.redshift.latitude = "59.911491"; + services.redshift.longitude = "10.757933"; + + # Configure fonts + fonts = { + fonts = with pkgs; [ + input-fonts + ]; + }; + + # Ensure wallpapers are "installed" + environment.systemPackages = [ wallpapers ]; + + # Configure random setting of wallpapers + systemd.user.services.feh-wp = { + description = "Randomly set wallpaper via feh"; + serviceConfig = { + Type = "oneshot"; + WorkingDirectory = "${wallpapers}/share/wallpapers"; + ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'"; + }; + }; + + systemd.user.timers.feh-wp = { + description = "Set a random wallpaper every hour"; + wantedBy = [ "timers.target" ]; + + timerConfig = { + OnActiveSec = "3second"; + OnUnitActiveSec = "1hour"; + }; + }; +} diff --git a/wallpapers.nix b/wallpapers.nix deleted file mode 100644 index 4faf7ef52c..0000000000 --- a/wallpapers.nix +++ /dev/null @@ -1,34 +0,0 @@ -# Configuration for randomly setting wallpapers. -{ config, pkgs, ... }: - -{ - # Configure random setting of wallpapers - systemd.user.services.clone-wallpapers = { - description = "Clone wallpaper repository"; - enable = true; - before = [ "feh-wp.service" "feh-wp.timer" ]; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.fish}/bin/fish -c '${pkgs.coreutils}/bin/stat %h/wallpapers; or ${pkgs.git}/bin/git clone https://git.tazj.in/tazjin/wallpapers.git %h/wallpapers'"; - }; - }; - - systemd.user.services.feh-wp = { - description = "Randomly set wallpaper via feh"; - serviceConfig = { - Type = "oneshot"; - WorkingDirectory = "%h/wallpapers"; - ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'"; - }; - }; - - systemd.user.timers.feh-wp = { - description = "Set a random wallpaper every hour"; - wantedBy = [ "timers.target" ]; - - timerConfig = { - OnActiveSec = "3second"; - OnUnitActiveSec = "1hour"; - }; - }; -} -- cgit 1.4.1 From bcec9f836006933c1b90c5c054ca33ae3bff90d5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 17 Oct 2017 00:41:00 +0200 Subject: fix(desktop): Bind feh-wp.timer to graphical target --- desktop.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop.nix b/desktop.nix index 335e15d87d..60b827cb6f 100644 --- a/desktop.nix +++ b/desktop.nix @@ -41,7 +41,8 @@ in { systemd.user.timers.feh-wp = { description = "Set a random wallpaper every hour"; - wantedBy = [ "timers.target" ]; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; timerConfig = { OnActiveSec = "3second"; -- cgit 1.4.1 From b8e419583cf782fd52062da1531c64c0cafac755 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 17 Oct 2017 00:43:14 +0200 Subject: fix(desktop): Start feh-wp.timer faster --- desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop.nix b/desktop.nix index 60b827cb6f..541d1a4580 100644 --- a/desktop.nix +++ b/desktop.nix @@ -45,7 +45,7 @@ in { partOf = [ "graphical-session.target" ]; timerConfig = { - OnActiveSec = "3second"; + OnActiveSec = "1second"; OnUnitActiveSec = "1hour"; }; }; -- cgit 1.4.1 From 73bf498781cd23f5150e89335ebe77a5bb5430c6 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 17 Oct 2017 01:18:18 +0200 Subject: feat: Install google-cloud-sdk --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 83fe2bc119..aafa57ba75 100644 --- a/packages.nix +++ b/packages.nix @@ -24,6 +24,7 @@ in { git gnumake gnupg + google-cloud-sdk htop i3lock jetbrains.idea-community -- cgit 1.4.1 From cb33e5222ff6905c7a63c9f43b8bf1809a4dfc00 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 17 Oct 2017 01:27:41 +0200 Subject: feat(pkgs): Install custom kontemplate package --- packages.nix | 1 + pkgs/kontemplate.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/kontemplate.nix diff --git a/packages.nix b/packages.nix index aafa57ba75..25bdb0160e 100644 --- a/packages.nix +++ b/packages.nix @@ -57,6 +57,7 @@ in { latest.rustChannels.stable.rust # Custom packages: + (import pkgs/kontemplate.nix) (import pkgs/nixfd.nix) ]; } diff --git a/pkgs/kontemplate.nix b/pkgs/kontemplate.nix new file mode 100644 index 0000000000..4f322c8178 --- /dev/null +++ b/pkgs/kontemplate.nix @@ -0,0 +1,22 @@ +# Install the latest kontemplate version +with import {}; + +stdenv.mkDerivation { + name = "kontemplate-1.2.0"; + + src = fetchzip { + url = "https://github.com/tazjin/kontemplate/releases/download/v1.2.0/kontemplate-1.2.0-f8b6ad6-linux-amd64.tar.gz"; + sha256 = "09siirhr1m9lc91bkw4h4l1qpnjnl03yr5m9mjfxdkp5gzmkcb9r"; + }; + + installPhase = '' + mkdir -p $out/bin + mv kontemplate $out/bin/kontemplate + ''; + + meta = with stdenv.lib; { + description = "Extremely simple Kubernetes resource templates"; + homepage = "http://kontemplate.works"; + license = licenses.mit; + }; +} -- cgit 1.4.1 From ed1b60b588061b326286eada0cbf15c458b345c1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 17 Oct 2017 15:59:08 +0200 Subject: feat(pkgs): Install nixops --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 25bdb0160e..09bd797407 100644 --- a/packages.nix +++ b/packages.nix @@ -31,6 +31,7 @@ in { kubernetes lxappearance-gtk3 manpages + nixops numix-gtk-theme numix-icon-theme openjdk -- cgit 1.4.1 From 0e84a3827373842e28fa7831ad0a2d3f28bba6de Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 17 Oct 2017 16:18:11 +0200 Subject: feat: Enable VirtualBox & Docker --- configuration.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/configuration.nix b/configuration.nix index c03dc06ebb..ca97e3d903 100644 --- a/configuration.nix +++ b/configuration.nix @@ -16,18 +16,23 @@ # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - hardware.pulseaudio.enable = true; - - # Set your time zone. time.timeZone = "Europe/Oslo"; - # Configure shell environment + # Configure shell environment: programs.fish.enable = true; programs.ssh.startAgent = true; services.emacs.enable = true; services.emacs.defaultEditor = true; + # Configure VirtualBox (needed for local NixOps testing): + virtualisation.virtualbox.host.enable = true; + + # Configure Docker (with socket activation): + # Side note: ... virtualisation? ... + virtualisation.docker.enable = true; + virtualisation.docker.autoPrune.enable = true; + # Configure other random applications: programs.java.enable = true; -- cgit 1.4.1 From b2585a0bcf45a495d3e69283f9be97e057f457e6 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 18 Oct 2017 00:58:03 +0200 Subject: feat: Add myself to the 'docker' group --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index ca97e3d903..a0d06e9554 100644 --- a/configuration.nix +++ b/configuration.nix @@ -39,7 +39,7 @@ # Configure user account users.defaultUserShell = pkgs.fish; users.extraUsers.vincent = { - extraGroups = [ "wheel" ]; + extraGroups = [ "wheel" "docker" ]; isNormalUser = true; uid = 1000; shell = pkgs.fish; -- cgit 1.4.1 From 6118c611c0060c5e46c21c6c7feffa1147d0c138 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 18 Oct 2017 15:16:28 +0200 Subject: feat(pkgs): Add terraform-bin package The source build of Terraform is currently broken in NixOS. This adds a binary package. --- packages.nix | 2 ++ pkgs/terraform-bin.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/terraform-bin.nix diff --git a/packages.nix b/packages.nix index 09bd797407..6563a98e65 100644 --- a/packages.nix +++ b/packages.nix @@ -31,6 +31,7 @@ in { kubernetes lxappearance-gtk3 manpages + maven nixops numix-gtk-theme numix-icon-theme @@ -60,6 +61,7 @@ in { # Custom packages: (import pkgs/kontemplate.nix) (import pkgs/nixfd.nix) + (import pkgs/terraform-bin.nix) ]; } diff --git a/pkgs/terraform-bin.nix b/pkgs/terraform-bin.nix new file mode 100644 index 0000000000..cb1481df83 --- /dev/null +++ b/pkgs/terraform-bin.nix @@ -0,0 +1,28 @@ +# Package to install a Terraform binary release. +# This is necessary because the Terraform package on Nix does not currently +# build for some reason. + +with import {}; + +stdenv.mkDerivation rec { + name = "terraform-${version}"; + version = "0.10.7"; + + src = fetchzip { + url = "https://releases.hashicorp.com/terraform/0.10.7/terraform_0.10.7_linux_amd64.zip"; + sha256 = "189g94bb1d3wxzp720a5vki91czsqmk728469wa1fdkl43cdqd2n"; + }; + + installPhase = '' + mkdir -p $out/bin + mv terraform $out/bin/terraform + ''; + + meta = with stdenv.lib; { + description = "Terraform is a tool for building, changing, and combining infrastructure safely and efficiently"; + homepage = "https://www.terraform.io/"; + license = licenses.mpl20; + }; + + # +} -- cgit 1.4.1 From 0ceef2ac3f8d622136ff28047a4e9a5d01e34e0b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 18 Oct 2017 15:33:08 +0200 Subject: feat: Install openssl --- packages.nix | 1 + pkgs/terraform-bin.nix | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages.nix b/packages.nix index 6563a98e65..cb67d63869 100644 --- a/packages.nix +++ b/packages.nix @@ -36,6 +36,7 @@ in { numix-gtk-theme numix-icon-theme openjdk + openssl pass pavucontrol ripgrep diff --git a/pkgs/terraform-bin.nix b/pkgs/terraform-bin.nix index cb1481df83..a12900d6a3 100644 --- a/pkgs/terraform-bin.nix +++ b/pkgs/terraform-bin.nix @@ -23,6 +23,4 @@ stdenv.mkDerivation rec { homepage = "https://www.terraform.io/"; license = licenses.mpl20; }; - - # } -- cgit 1.4.1 From 9361addb5412c843ae4548d14a879f135e4dea80 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 19 Oct 2017 01:48:27 +0200 Subject: feat: Install jq How could I even forget about this? --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index cb67d63869..0884514c8a 100644 --- a/packages.nix +++ b/packages.nix @@ -28,6 +28,7 @@ in { htop i3lock jetbrains.idea-community + jq kubernetes lxappearance-gtk3 manpages -- cgit 1.4.1 From 8fe1795f16914806381706438c90679b851f0540 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 19 Oct 2017 19:54:15 +0200 Subject: feat(adho): Enable bluetooth --- adho-configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index b9dba8e3ff..5374f62fd6 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -26,4 +26,6 @@ psk = "speakeasy"; }; }; + + hardware.bluetooth.enable = true; } -- cgit 1.4.1 From 2d80f468d0e1571a8152af9c3835698281b1bf2f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 19 Oct 2017 19:54:22 +0200 Subject: fix(pkgs): Use correct IntelliJ IDEA version I actually have an Ultimate license, so I should probably use that. --- packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.nix b/packages.nix index 0884514c8a..ebd98e8e82 100644 --- a/packages.nix +++ b/packages.nix @@ -27,7 +27,7 @@ in { google-cloud-sdk htop i3lock - jetbrains.idea-community + jetbrains.idea-ultimate jq kubernetes lxappearance-gtk3 -- cgit 1.4.1 From 19f165484b51326d2ec670f07979af35cb82e347 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 20 Oct 2017 20:22:51 +0200 Subject: feat(adho): Configure larger local POSIX queue sizes Required for some testing at work. --- adho-configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 5374f62fd6..a9328925ab 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -28,4 +28,10 @@ }; hardware.bluetooth.enable = true; + + # Configure POSIX queue limits (for work) + systemd.tmpfiles.rules = let mqueue = "/proc/sys/fs/mqueue"; in [ + "w ${mqueue}/msgsize_max - - - - ${toString (64 * 1024)}" + "w ${mqueue}/msg_max - - - - 50" + ]; } -- cgit 1.4.1 From 30f101e75d124def77af7c9cc8727e2bdd990f81 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 20 Oct 2017 20:23:08 +0200 Subject: feat: Install iftop --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index ebd98e8e82..e8a2645d40 100644 --- a/packages.nix +++ b/packages.nix @@ -27,6 +27,7 @@ in { google-cloud-sdk htop i3lock + iftop jetbrains.idea-ultimate jq kubernetes -- cgit 1.4.1 From a8a9bf130048ec1c71ed44a3930da0bd13c626d8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 20 Oct 2017 21:46:49 +0200 Subject: feat(pkgs): Add mq-cli package --- packages.nix | 1 + pkgs/mq-cli.nix | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/mq-cli.nix diff --git a/packages.nix b/packages.nix index e8a2645d40..899d0114bc 100644 --- a/packages.nix +++ b/packages.nix @@ -63,6 +63,7 @@ in { # Custom packages: (import pkgs/kontemplate.nix) + (import pkgs/mq-cli.nix) (import pkgs/nixfd.nix) (import pkgs/terraform-bin.nix) ]; diff --git a/pkgs/mq-cli.nix b/pkgs/mq-cli.nix new file mode 100644 index 0000000000..03aa34b266 --- /dev/null +++ b/pkgs/mq-cli.nix @@ -0,0 +1,35 @@ +# Build and install mq-cli. + +with import {}; + +let + # The cached Cargo registry moves *very* slowly, override it: + newRegistry = rustRegistry.overrideAttrs (oldAttrs: rec { + name = "rustRegistry-2017-10-20"; + src = fetchFromGitHub { + owner = "rust-lang"; + repo = "crates.io-index"; + rev = "a1e85af8f57ba61e505c2cb2dc359b66caf355e9"; + sha256 = "0xcszw287kqlz15ikflsim36mrvpvlb2y074vg22szz0r48nn06v"; + }; + }); +in rustPlatform.buildRustPackage rec { + name = "mqcli-${version}"; + version = "0.1.0"; + + rustRegistry = newRegistry; + depsSha256 = "1mdh5adnf58qn0gm2l9bp9dar2h577wvnhnlq8wj8a54vmgpp3ic"; + + src = fetchFromGitHub { + owner = "aprilabank"; + repo = "mq-cli"; + rev = "2c71e092f69f5cd3c31ad8a84aa4168118579898"; + sha256 = "10m11fis5dv3v9y5rg48nbg7170bzakdban5mrjaj2vkv9qgslii"; + }; + + meta = with stdenv.lib; { + description = "CLI interface to POSIX message queues"; + homepage = https://github.com/aprilabank/mq-cli; + license = licenses.mit; + }; +} -- cgit 1.4.1 From 7fe75e01386f24385ae9ccc624e3d8561df8bcbb Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 20 Oct 2017 23:22:10 +0200 Subject: feat(dotfiles): Begin controlling various dotfiles from Nix Moves my i3 configuration into a nix derivation called 'tazjins-dotfiles'. A good step towards fully declarative system configuration! --- configuration.nix | 1 + desktop.nix | 6 +- dotfiles.nix | 31 +++++++++ dotfiles/i3.conf | 163 +++++++++++++++++++++++++++++++++++++++++++++++ stallo-configuration.nix | 1 - 5 files changed, 200 insertions(+), 2 deletions(-) create mode 100644 dotfiles.nix create mode 100644 dotfiles/i3.conf diff --git a/configuration.nix b/configuration.nix index a0d06e9554..aae8c61db4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -11,6 +11,7 @@ ./local-configuration.nix ./packages.nix ./desktop.nix + ./dotfiles.nix ]; # Use the systemd-boot EFI boot loader. diff --git a/desktop.nix b/desktop.nix index 541d1a4580..85e9f4b9a8 100644 --- a/desktop.nix +++ b/desktop.nix @@ -10,7 +10,11 @@ in { services.xserver.xkbOptions = "caps:super, grp:shifts_toggle"; # configure desktop environment: - services.xserver.windowManager.i3.enable = true; + services.xserver.windowManager.i3 = { + enable = true; + configFile = "/etc/i3/config"; + }; + services.compton.enable = true; services.compton.backend = "xrender"; # this should be the default! diff --git a/dotfiles.nix b/dotfiles.nix new file mode 100644 index 0000000000..8ba5f976f7 --- /dev/null +++ b/dotfiles.nix @@ -0,0 +1,31 @@ +# Bundle configuration files into a derivation. +# I call this derivation dotfiles despite that not technically being true +# anymore ... + +{ config, pkgs, ...}: + +let dotfiles = pkgs.stdenv.mkDerivation { + name = "tazjins-dotfiles"; + + srcs = [ + ./dotfiles + ]; + + installPhase = '' + mkdir -p $out/dotfiles + cp ./* $out/dotfiles/ + ''; +}; +in { + # /etc/ is a special place in NixOS! + # Symlinks that need to be created there must be specified explicitly. + environment.etc = { + "i3/config" = { + source = "${dotfiles}/dotfiles/i3.conf"; + # Setting a mode causes Nix to copy the file instead of symlinking it. + # For i3 config in particular this is desirable because I want to be able + # to modify and reload it before committing a change. + mode = "0644"; + }; + }; +} diff --git a/dotfiles/i3.conf b/dotfiles/i3.conf new file mode 100644 index 0000000000..d42ce2716c --- /dev/null +++ b/dotfiles/i3.conf @@ -0,0 +1,163 @@ +# i3 config file (v4) +# +# Please see http://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +font pango:Input Mono 11 + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +bindsym $mod+Return exec alacritty + +# start an emacs frame +bindsym $mod+e exec emacsclient -c -n + +# kill focused window +bindsym $mod+Shift+q kill + +# start rofi (a program launcher) +bindsym XF86Search exec rofi -show run +bindsym $mod+d exec rofi -show run + +bindsym $mod+p exec passmenu + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+semicolon focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+semicolon move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+x layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# switch to workspace +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace 1 +bindsym $mod+Shift+2 move container to workspace 2 +bindsym $mod+Shift+3 move container to workspace 3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +# move workspace to next output +bindsym $mod+Shift+m move workspace to output left + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status + position top +} + +# Disable window title bars +new_window 1pixel + +# Switch back and forth between workspaces automatically +workspace_auto_back_and_forth yes + +# Brightness controls +bindsym XF86MonBrightnessDown exec light -U 10 +bindsym XF86MonBrightnessUp exec light -A 10 + +# Volume controls +bindsym XF86AudioMute exec --no-startup-id "pulseaudio-ctl mute" +bindsym XF86AudioRaiseVolume exec --no-startup-id "pulseaudio-ctl up" +bindsym XF86AudioLowerVolume exec --no-startup-id "pulseaudio-ctl down" + +# Lock screen +bindsym F7 exec i3lock + +# Enable floating for popup windows (e.g. pinentry) +for_window [title="pinentry"] floating enable diff --git a/stallo-configuration.nix b/stallo-configuration.nix index 57f55d774d..2925152824 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -1,4 +1,3 @@ - # Local configuration for 'stallo' (Home desktop PC) { config, ...}: -- cgit 1.4.1 From 106ca2094072a516a8df820d9c31a9be6bbbc75c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 20 Oct 2017 23:37:07 +0200 Subject: feat(dotfiles): Add fish-shell & tmux configuration --- dotfiles.nix | 14 +++++--------- dotfiles/config.fish | 27 +++++++++++++++++++++++++++ dotfiles/tmux.conf | 14 ++++++++++++++ 3 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 dotfiles/config.fish create mode 100644 dotfiles/tmux.conf diff --git a/dotfiles.nix b/dotfiles.nix index 8ba5f976f7..e999bc2bc1 100644 --- a/dotfiles.nix +++ b/dotfiles.nix @@ -12,20 +12,16 @@ let dotfiles = pkgs.stdenv.mkDerivation { ]; installPhase = '' - mkdir -p $out/dotfiles - cp ./* $out/dotfiles/ + mkdir -p $out + cp ./* $out/ ''; }; in { # /etc/ is a special place in NixOS! # Symlinks that need to be created there must be specified explicitly. environment.etc = { - "i3/config" = { - source = "${dotfiles}/dotfiles/i3.conf"; - # Setting a mode causes Nix to copy the file instead of symlinking it. - # For i3 config in particular this is desirable because I want to be able - # to modify and reload it before committing a change. - mode = "0644"; - }; + "i3/config".source = "${dotfiles}/i3.conf"; + "tmux.conf".source = "${dotfiles}/tmux.conf"; + "fish/foreign-env/tazjin".source = "${dotfiles}/config.fish"; }; } diff --git a/dotfiles/config.fish b/dotfiles/config.fish new file mode 100644 index 0000000000..55809a2ab6 --- /dev/null +++ b/dotfiles/config.fish @@ -0,0 +1,27 @@ +# Configure classic prompt +set fish_color_user --bold blue +set fish_color_cwd --bold white +#set __fish_git_prompt_color green +set __fish_git_prompt_showcolorhints yes +set __fish_git_prompt_color_prefix purple +set __fish_git_prompt_color_suffix purple + +# Fish configuration +set fish_greeting "" +set PATH $HOME/.local/bin $GOPATH/bin $PATH + +# Editor configuration +set -gx EDITOR "emacsclient" +set -gx ALTERNATE_EDITOR "emacs -q -nw" +set -gx VISUAL "emacsclient" + +# Miscellaneous +eval (direnv hook fish) + +# Useful command aliases +alias gpr 'git pull --rebase' +alias gco 'git checkout' +alias gf 'git fetch' +alias gap 'git add -p' +alias pbcopy 'xclip -selection clipboard' +alias edit 'emacsclient -n' diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf new file mode 100644 index 0000000000..6c20ae0370 --- /dev/null +++ b/dotfiles/tmux.conf @@ -0,0 +1,14 @@ +set -g status off +set -gw mode-keys emacs +setw -g mouse on + +# Correctly set window titles +set -g set-titles on +set -g set-titles-string "#W (#T)" + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-yank' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' -- cgit 1.4.1 From 8cf6fb036048b8c326baefa721a872c69aeb8d0b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 20 Oct 2017 23:45:02 +0200 Subject: feat(dotfiles): Add rofi configuration --- dotfiles.nix | 1 + dotfiles/rofi.conf | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 dotfiles/rofi.conf diff --git a/dotfiles.nix b/dotfiles.nix index e999bc2bc1..893d69bea5 100644 --- a/dotfiles.nix +++ b/dotfiles.nix @@ -23,5 +23,6 @@ in { "i3/config".source = "${dotfiles}/i3.conf"; "tmux.conf".source = "${dotfiles}/tmux.conf"; "fish/foreign-env/tazjin".source = "${dotfiles}/config.fish"; + "rofi.conf".source = "${dotfiles}/rofi.conf"; }; } diff --git a/dotfiles/rofi.conf b/dotfiles/rofi.conf new file mode 100644 index 0000000000..6663d67f4d --- /dev/null +++ b/dotfiles/rofi.conf @@ -0,0 +1,3 @@ +rofi.matching: fuzzy +rofi.levenshtein-sort: true +#include "/usr/share/rofi/themes//DarkBlue.theme" -- cgit 1.4.1 From b67fca345a39457c0a9f089b81584a87a612ecec Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 20 Oct 2017 23:46:17 +0200 Subject: feat(dotfiles): Add alacritty configuration --- dotfiles.nix | 1 + dotfiles/alacritty.yml | 264 +++++++++++++++++++++++++++++++++++++++++++++++++ dotfiles/i3.conf | 2 +- 3 files changed, 266 insertions(+), 1 deletion(-) create mode 100644 dotfiles/alacritty.yml diff --git a/dotfiles.nix b/dotfiles.nix index 893d69bea5..5fd509996a 100644 --- a/dotfiles.nix +++ b/dotfiles.nix @@ -24,5 +24,6 @@ in { "tmux.conf".source = "${dotfiles}/tmux.conf"; "fish/foreign-env/tazjin".source = "${dotfiles}/config.fish"; "rofi.conf".source = "${dotfiles}/rofi.conf"; + "alacritty.yml".source = "${dotfiles}/alacritty.yml"; }; } diff --git a/dotfiles/alacritty.yml b/dotfiles/alacritty.yml new file mode 100644 index 0000000000..742b36d229 --- /dev/null +++ b/dotfiles/alacritty.yml @@ -0,0 +1,264 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator + + +# Any items in the `env` entry below will be added as +# environment variables. Some entries may override variables +# set by alacritty it self. +env: + # TERM env customization. + # + # If this property is not set, alacritty will set it to xterm-256color. + # + # Note that some xterm terminfo databases don't declare support for italics. + # You can verify this by checking for the presence of `smso` and `sitm` in + # `infocmp xterm-256color`. + TERM: xterm-256color + +# Window dimensions in character columns and lines +# (changes require restart) +dimensions: + columns: 80 + lines: 24 + +# Adds this many blank pixels of padding around the window +# Units are physical pixels; this is not DPI aware. +# (change requires restart) +padding: + x: 2 + y: 2 + +# The FreeType rasterizer needs to know the device DPI for best results +# (changes require restart) +dpi: + x: 96.0 + y: 96.0 + +# Display tabs using this many cells (changes require restart) +tabspaces: 4 + +# When true, bold text is drawn using the bright variant of colors. +draw_bold_text_with_bright_colors: true + +# Font configuration (changes require restart) +font: + # The normal (roman) font face to use. + normal: + family: Input Mono + bold: + family: Input Mono + italic: + family: Input Mono + + # Point size of the font + size: 11.0 + + # Offset is the extra space around each character. offset.y can be thought of + # as modifying the linespacing, and offset.x as modifying the letter spacing. + offset: + x: 0.0 + y: 0.0 + + # Glyph offset determines the locations of the glyphs within their cells with + # the default being at the bottom. Increase the x offset to move the glyph to + # the right, increase the y offset to move the glyph upward. + glyph_offset: + x: 0.0 + y: 0.0 + + # OS X only: use thin stroke font rendering. Thin strokes are suitable + # for retina displays, but for non-retina you probably want this set to + # false. + use_thin_strokes: true + +# Should display the render timer +render_timer: false + +# Use custom cursor colors. If true, display the cursor in the cursor.foreground +# and cursor.background colors, otherwise invert the colors of the cursor. +custom_cursor_colors: false + +# Colors (Tomorrow Night Bright) +colors: + # Default colors + primary: + background: '0x181818' + foreground: '0xe4e4ef' + + # Colors the cursor will use if `custom_cursor_colors` is true + cursor: + text: '0x000000' + cursor: '0xf5f5f5' + + # Normal colors + normal: + black: '0x282828' + red: '0xf43841' + green: '0x73c936' + yellow: '0xffdd33' + blue: '0x96a6c8' + magenta: '0x9e95c7' + cyan: '0x1fad83' + white: '0xf5f5f5' + + # Bright colors + bright: + black: '0x484848' + red: '0xff4f58' + green: '0x73c936' + yellow: '0xffdd33' + blue: '0x5f627f' + magenta: '0x9e95c7' + cyan: '0x1fad83' + white: '0xffffff' + +# Visual Bell +# +# Any time the BEL code is received, Alacritty "rings" the visual bell. Once +# rung, the terminal background will be set to white and transition back to the +# default background color. You can control the rate of this transition by +# setting the `duration` property (represented in milliseconds). You can also +# configure the transition function by setting the `animation` property. +# +# Possible values for `animation` +# `Ease` +# `EaseOut` +# `EaseOutSine` +# `EaseOutQuad` +# `EaseOutCubic` +# `EaseOutQuart` +# `EaseOutQuint` +# `EaseOutExpo` +# `EaseOutCirc` +# `Linear` +# +# To completely disable the visual bell, set its duration to 0. +# +visual_bell: + animation: EaseOutExpo + duration: 0 + +# Background opacity +background_opacity: 0.95 + +# Key bindings +# +# Each binding is defined as an object with some properties. Most of the +# properties are optional. All of the alphabetical keys should have a letter for +# the `key` value such as `V`. Function keys are probably what you would expect +# as well (F1, F2, ..). The number keys above the main keyboard are encoded as +# `Key1`, `Key2`, etc. Keys on the number pad are encoded `Number1`, `Number2`, +# etc. These all match the glutin::VirtualKeyCode variants. +# +# Possible values for `mods` +# `Command`, `Super` refer to the super/command/windows key +# `Control` for the control key +# `Shift` for the Shift key +# `Alt` and `Option` refer to alt/option +# +# mods may be combined with a `|`. For example, requiring control and shift +# looks like: +# +# mods: Control|Shift +# +# The parser is currently quite sensitive to whitespace and capitalization - +# capitalization must match exactly, and piped items must not have whitespace +# around them. +# +# Either an `action`, `chars`, or `command` field must be present. +# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`. +# `chars` writes the specified string every time that binding is activated. +# These should generally be escape sequences, but they can be configured to +# send arbitrary strings of bytes. +# `command` must be a map containing a `program` string, and `args` array of +# strings. For example: +# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } } +# +# Want to add a binding (e.g. "PageUp") but are unsure what the X sequence +# (e.g. "\x1b[5~") is? Open another terminal (like xterm) without tmux, +# then run `showkey -a` to get the sequence associated to a key combination. +key_bindings: + - { key: V, mods: Control|Shift, action: Paste } + - { key: C, mods: Control|Shift, action: Copy } + - { key: Q, mods: Command, action: Quit } + - { key: W, mods: Command, action: Quit } + - { key: Insert, mods: Shift, action: PasteSelection } + - { key: Home, chars: "\x1bOH", mode: AppCursor } + - { key: Home, chars: "\x1b[H", mode: ~AppCursor } + - { key: End, chars: "\x1bOF", mode: AppCursor } + - { key: End, chars: "\x1b[F", mode: ~AppCursor } + - { key: PageUp, mods: Shift, chars: "\x1b[5;2~" } + - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } + - { key: PageUp, chars: "\x1b[5~" } + - { key: PageDown, mods: Shift, chars: "\x1b[6;2~" } + - { key: PageDown, mods: Control, chars: "\x1b[6;5~" } + - { key: PageDown, chars: "\x1b[6~" } + - { key: Left, mods: Shift, chars: "\x1b[1;2D" } + - { key: Left, mods: Control, chars: "\x1b[1;5D" } + - { key: Left, mods: Alt, chars: "\x1b[1;3D" } + - { key: Left, chars: "\x1b[D", mode: ~AppCursor } + - { key: Left, chars: "\x1bOD", mode: AppCursor } + - { key: Right, mods: Shift, chars: "\x1b[1;2C" } + - { key: Right, mods: Control, chars: "\x1b[1;5C" } + - { key: Right, mods: Alt, chars: "\x1b[1;3C" } + - { key: Right, chars: "\x1b[C", mode: ~AppCursor } + - { key: Right, chars: "\x1bOC", mode: AppCursor } + - { key: Up, mods: Shift, chars: "\x1b[1;2A" } + - { key: Up, mods: Control, chars: "\x1b[1;5A" } + - { key: Up, mods: Alt, chars: "\x1b[1;3A" } + - { key: Up, chars: "\x1b[A", mode: ~AppCursor } + - { key: Up, chars: "\x1bOA", mode: AppCursor } + - { key: Down, mods: Shift, chars: "\x1b[1;2B" } + - { key: Down, mods: Control, chars: "\x1b[1;5B" } + - { key: Down, mods: Alt, chars: "\x1b[1;3B" } + - { key: Down, chars: "\x1b[B", mode: ~AppCursor } + - { key: Down, chars: "\x1bOB", mode: AppCursor } + - { key: Tab, mods: Shift, chars: "\x1b[Z" } + - { key: F1, chars: "\x1bOP" } + - { key: F2, chars: "\x1bOQ" } + - { key: F3, chars: "\x1bOR" } + - { key: F4, chars: "\x1bOS" } + - { key: F5, chars: "\x1b[15~" } + - { key: F6, chars: "\x1b[17~" } + - { key: F7, chars: "\x1b[18~" } + - { key: F8, chars: "\x1b[19~" } + - { key: F9, chars: "\x1b[20~" } + - { key: F10, chars: "\x1b[21~" } + - { key: F11, chars: "\x1b[23~" } + - { key: F12, chars: "\x1b[24~" } + - { key: Back, chars: "\x7f" } + - { key: Back, mods: Alt, chars: "\x1b\x7f" } + - { key: Insert, chars: "\x1b[2~" } + - { key: Delete, chars: "\x1b[3~" } + +# Mouse bindings +# +# Currently doesn't support modifiers. Both the `mouse` and `action` fields must +# be specified. +# +# Values for `mouse`: +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# Values for `action`: +# - Paste +# - PasteSelection +# - Copy (TODO) +mouse_bindings: + - { mouse: Middle, action: PasteSelection } + +mouse: + double_click: { threshold: 300 } + triple_click: { threshold: 300 } + +selection: + semantic_escape_chars: ",│`|:\"' ()[]{}<>" + +hide_cursor_when_typing: false + +# Live config reload (changes require restart) +live_config_reload: true + +shell: + program: tmux diff --git a/dotfiles/i3.conf b/dotfiles/i3.conf index d42ce2716c..e398b1b9df 100644 --- a/dotfiles/i3.conf +++ b/dotfiles/i3.conf @@ -10,7 +10,7 @@ font pango:Input Mono 11 floating_modifier $mod # start a terminal -bindsym $mod+Return exec alacritty +bindsym $mod+Return exec alacritty --config-file /etc/alacritty.yml # start an emacs frame bindsym $mod+e exec emacsclient -c -n -- cgit 1.4.1 From d7ae1b70d3d52b3432e3b927ee99af6ef246f87f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 21 Oct 2017 00:03:56 +0200 Subject: fix(dotfiles): Overwrite default NixOS fish config NixOS by default adds some fish-config setup that I don't think I want, but it's a bit unclear what the goal of it is. I've overwritten it now and things still work fine! --- dotfiles.nix | 2 +- dotfiles/config.fish | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/dotfiles.nix b/dotfiles.nix index 5fd509996a..e0f74b5c60 100644 --- a/dotfiles.nix +++ b/dotfiles.nix @@ -22,7 +22,7 @@ in { environment.etc = { "i3/config".source = "${dotfiles}/i3.conf"; "tmux.conf".source = "${dotfiles}/tmux.conf"; - "fish/foreign-env/tazjin".source = "${dotfiles}/config.fish"; + "fish/config.fish".source = "${dotfiles}/config.fish"; "rofi.conf".source = "${dotfiles}/rofi.conf"; "alacritty.yml".source = "${dotfiles}/alacritty.yml"; }; diff --git a/dotfiles/config.fish b/dotfiles/config.fish index 55809a2ab6..a6c611f705 100644 --- a/dotfiles/config.fish +++ b/dotfiles/config.fish @@ -1,10 +1,6 @@ # Configure classic prompt set fish_color_user --bold blue set fish_color_cwd --bold white -#set __fish_git_prompt_color green -set __fish_git_prompt_showcolorhints yes -set __fish_git_prompt_color_prefix purple -set __fish_git_prompt_color_suffix purple # Fish configuration set fish_greeting "" -- cgit 1.4.1 From e86392b55a28e3aa8321c6026e35f3d84d909eaa Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 21 Oct 2017 00:05:11 +0200 Subject: feat(dotfiles/fish): Alias ls to exa Old habits die hard, but I really want more Rust in my userland. --- dotfiles/config.fish | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotfiles/config.fish b/dotfiles/config.fish index a6c611f705..3d6d598455 100644 --- a/dotfiles/config.fish +++ b/dotfiles/config.fish @@ -21,3 +21,6 @@ alias gf 'git fetch' alias gap 'git add -p' alias pbcopy 'xclip -selection clipboard' alias edit 'emacsclient -n' + +# Old habits die hard (also ls is just easier to type): +alias ls 'exa' -- cgit 1.4.1 From bc1f098bac7f8269a668f91a704ff4fc4b0bba49 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 21 Oct 2017 00:09:00 +0200 Subject: feat(dotfiles/fish): re-enable VCS prompt colour hints --- dotfiles/config.fish | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dotfiles/config.fish b/dotfiles/config.fish index 3d6d598455..084c7fb100 100644 --- a/dotfiles/config.fish +++ b/dotfiles/config.fish @@ -2,6 +2,11 @@ set fish_color_user --bold blue set fish_color_cwd --bold white +# Enable colour hints in VCS prompt: +set __fish_git_prompt_showcolorhints yes +set __fish_git_prompt_color_prefix purple +set __fish_git_prompt_color_suffix purple + # Fish configuration set fish_greeting "" set PATH $HOME/.local/bin $GOPATH/bin $PATH -- cgit 1.4.1 From 9b7810ae428418907d62765a7724a8362f2952a7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 21 Oct 2017 00:33:39 +0200 Subject: style(all): Consistently use block/attr format & clean up --- adho-configuration.nix | 32 +++++++++++++++++--------------- configuration.nix | 33 ++++++++++++++++++++------------- desktop.nix | 34 ++++++++++++++++++++-------------- dotfiles.nix | 8 ++++---- stallo-configuration.nix | 14 ++++++++------ 5 files changed, 69 insertions(+), 52 deletions(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index a9328925ab..d3560a5166 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -3,27 +3,29 @@ { boot.initrd.luks.devices.adho.device = "/dev/disk/by-uuid/722006b0-9654-4ea1-8703-e0cf9ac1905e"; - networking.hostName = "adho"; services.xserver.libinput.enable = true; services.xserver.videoDrivers = [ "intel" ]; programs.light.enable = true; - networking.wireless.enable = true; - networking.wireless.networks = { - # Welcome to roast club! - "How do I computer?" = { - psk = "washyourface"; - }; + networking = { + hostName = "adho"; + wireless.enable = true; + wireless.networks = { + # Welcome to roast club! + "How do I computer?" = { + psk = "washyourface"; + }; - # Did someone say wifi credentials are secret? - # http://bit.ly/2gI43QP - "Amesto-mobile" = { - psk = "ostemAt1"; - }; + # Did someone say wifi credentials are secret? + # http://bit.ly/2gI43QP + "Amesto-mobile" = { + psk = "ostemAt1"; + }; - # Public places in Oslo: - "Abelone" = { - psk = "speakeasy"; + # Public places in Oslo: + "Abelone" = { + psk = "speakeasy"; + }; }; }; diff --git a/configuration.nix b/configuration.nix index aae8c61db4..4fd9c71d26 100644 --- a/configuration.nix +++ b/configuration.nix @@ -20,22 +20,27 @@ hardware.pulseaudio.enable = true; time.timeZone = "Europe/Oslo"; - # Configure shell environment: - programs.fish.enable = true; - programs.ssh.startAgent = true; + # Configure emacs: + # (actually, that's a lie, this only installs emacs!) services.emacs.enable = true; services.emacs.defaultEditor = true; - # Configure VirtualBox (needed for local NixOps testing): - virtualisation.virtualbox.host.enable = true; + virtualisation = { + # Configure VirtualBox (needed for local NixOps testing): + virtualbox.host.enable = true; - # Configure Docker (with socket activation): - # Side note: ... virtualisation? ... - virtualisation.docker.enable = true; - virtualisation.docker.autoPrune.enable = true; + # Configure Docker (with socket activation): + # Side note: ... why is this in virtualisation? ... + docker.enable = true; + docker.autoPrune.enable = true; + }; - # Configure other random applications: - programs.java.enable = true; + # Configure various other applications: + programs = { + java.enable = true; + fish.enable = true; + ssh.startAgent = true; + }; # Configure user account users.defaultUserShell = pkgs.fish; @@ -46,8 +51,10 @@ shell = pkgs.fish; }; - security.sudo.enable = true; - security.sudo.extraConfig = "wheel ALL=(ALL:ALL) SETENV: ALL"; + security.sudo = { + enable = true; + extraConfig = "wheel ALL=(ALL:ALL) SETENV: ALL"; + }; # This value determines the NixOS release with which your system is to be # compatible, in order to avoid breaking some software such as database diff --git a/desktop.nix b/desktop.nix index 85e9f4b9a8..7554de7f93 100644 --- a/desktop.nix +++ b/desktop.nix @@ -5,9 +5,11 @@ let wallpapers = import ./pkgs/wallpapers.nix; in { # Configure basic X-server stuff: - services.xserver.enable = true; - services.xserver.layout = "us,no"; - services.xserver.xkbOptions = "caps:super, grp:shifts_toggle"; + services.xserver = { + enable = true; + layout = "us,no"; + xkbOptions = "caps:super, grp:shifts_toggle"; + }; # configure desktop environment: services.xserver.windowManager.i3 = { @@ -16,12 +18,16 @@ in { }; services.compton.enable = true; - services.compton.backend = "xrender"; # this should be the default! + # this should be the default! in fact, it will soon be: + # https://github.com/NixOS/nixpkgs/pull/30486 + services.compton.backend = "xrender"; # Configure Redshift for Oslo - services.redshift.enable = true; - services.redshift.latitude = "59.911491"; - services.redshift.longitude = "10.757933"; + services.redshift = { + enable = true; + latitude = "59.911491"; + longitude = "10.757933"; + }; # Configure fonts fonts = { @@ -30,26 +36,26 @@ in { ]; }; - # Ensure wallpapers are "installed" - environment.systemPackages = [ wallpapers ]; - # Configure random setting of wallpapers systemd.user.services.feh-wp = { description = "Randomly set wallpaper via feh"; serviceConfig = { - Type = "oneshot"; + Type = "oneshot"; WorkingDirectory = "${wallpapers}/share/wallpapers"; + + # Manually shuffle because feh's --randomize option can't be restricted to + # just certain file types. ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'"; }; }; systemd.user.timers.feh-wp = { description = "Set a random wallpaper every hour"; - wantedBy = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; timerConfig = { - OnActiveSec = "1second"; + OnActiveSec = "1second"; OnUnitActiveSec = "1hour"; }; }; diff --git a/dotfiles.nix b/dotfiles.nix index e0f74b5c60..4032c873a3 100644 --- a/dotfiles.nix +++ b/dotfiles.nix @@ -20,10 +20,10 @@ in { # /etc/ is a special place in NixOS! # Symlinks that need to be created there must be specified explicitly. environment.etc = { - "i3/config".source = "${dotfiles}/i3.conf"; - "tmux.conf".source = "${dotfiles}/tmux.conf"; + "alacritty.yml".source = "${dotfiles}/alacritty.yml"; "fish/config.fish".source = "${dotfiles}/config.fish"; - "rofi.conf".source = "${dotfiles}/rofi.conf"; - "alacritty.yml".source = "${dotfiles}/alacritty.yml"; + "i3/config".source = "${dotfiles}/i3.conf"; + "rofi.conf".source = "${dotfiles}/rofi.conf"; + "tmux.conf".source = "${dotfiles}/tmux.conf"; }; } diff --git a/stallo-configuration.nix b/stallo-configuration.nix index 2925152824..b58497f9e4 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -7,12 +7,14 @@ # Use proprietary nvidia driver services.xserver.videoDrivers = [ "nvidia" ]; - networking.hostName = "stallo"; - networking.wireless.enable = true; - networking.wireless.networks = { - "How do I computer?" = { - # Welcome to roast club! - psk = "washyourface"; + networking = { + hostName = "stallo"; + wireless.enable = true; + wireless.networks = { + "How do I computer?" = { + # Welcome to roast club! + psk = "washyourface"; + }; }; }; } -- cgit 1.4.1 From ba3a9c53eb776d44c9be4d172e56b954f6d083c7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 21 Oct 2017 00:33:54 +0200 Subject: feat(desktop): Install some more fonts Adds fonts that will be useful for switching to i3status-rust and its powerline mode! --- desktop.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/desktop.nix b/desktop.nix index 7554de7f93..284789dec5 100644 --- a/desktop.nix +++ b/desktop.nix @@ -32,7 +32,11 @@ in { # Configure fonts fonts = { fonts = with pkgs; [ + font-awesome-ttf input-fonts + noto-fonts-cjk + noto-fonts-emoji + powerline-fonts ]; }; -- cgit 1.4.1 From 83bbedbb6f6347e91dbb91f13d5da2d154ad9807 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Oct 2017 01:30:22 +0200 Subject: feat(adho): Add another wifi network --- adho-configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index d3560a5166..7246f54190 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -26,6 +26,11 @@ "Abelone" = { psk = "speakeasy"; }; + + # Eugene's apartment: + "GET_5G_4FD250" = { + psk = "62636342"; + }; }; }; -- cgit 1.4.1 From 5f5ed214f054e6f3cc6422dd775fb2db9829419c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Oct 2017 20:45:50 +0200 Subject: feat(dotfiles/fish): Add Cargo-installed tools to $PATH --- dotfiles/config.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/config.fish b/dotfiles/config.fish index 084c7fb100..6a491fac5d 100644 --- a/dotfiles/config.fish +++ b/dotfiles/config.fish @@ -9,7 +9,7 @@ set __fish_git_prompt_color_suffix purple # Fish configuration set fish_greeting "" -set PATH $HOME/.local/bin $GOPATH/bin $PATH +set PATH $HOME/.local/bin $HOME/.cargo/bin $PATH # Editor configuration set -gx EDITOR "emacsclient" -- cgit 1.4.1 From 55d35fc19bd26afbb3fc4270bc96ca77a1c946bc Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 23 Oct 2017 00:34:50 +0200 Subject: feat(stallo): Enable PostgreSQL for development --- stallo-configuration.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stallo-configuration.nix b/stallo-configuration.nix index b58497f9e4..c3e73d41f4 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -17,4 +17,7 @@ }; }; }; + + # Enable PostgreSQL for development + services.postgresql.enable = true; } -- cgit 1.4.1 From 94be3b03ba3b7060ade315121ddcaddab1d6f5a9 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 23 Oct 2017 10:05:16 +0200 Subject: fix(dotfiles/alacritty): Slightly increase font size --- dotfiles/alacritty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/alacritty.yml b/dotfiles/alacritty.yml index 742b36d229..3135bf55ad 100644 --- a/dotfiles/alacritty.yml +++ b/dotfiles/alacritty.yml @@ -50,7 +50,7 @@ font: family: Input Mono # Point size of the font - size: 11.0 + size: 12.0 # Offset is the extra space around each character. offset.y can be thought of # as modifying the linespacing, and offset.x as modifying the letter spacing. -- cgit 1.4.1 From 2c3ea872d6e18536359aff8e05862c45584a7b62 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 23 Oct 2017 10:05:47 +0200 Subject: refactor: Enable PostgreSQL on both machines --- configuration.nix | 3 +++ stallo-configuration.nix | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configuration.nix b/configuration.nix index 4fd9c71d26..44b3040d8b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -42,6 +42,9 @@ ssh.startAgent = true; }; + # Enable PostgreSQL for development + services.postgresql.enable = true; + # Configure user account users.defaultUserShell = pkgs.fish; users.extraUsers.vincent = { diff --git a/stallo-configuration.nix b/stallo-configuration.nix index c3e73d41f4..b58497f9e4 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -17,7 +17,4 @@ }; }; }; - - # Enable PostgreSQL for development - services.postgresql.enable = true; } -- cgit 1.4.1 From 2eb27420e1cd75ec93b6f86063e8b34d644d35a4 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 24 Oct 2017 01:20:25 +0200 Subject: feat(pkgs): Add pulseaudio-ctl This is required for i3! --- packages.nix | 1 + pkgs/pulseaudio-ctl.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 pkgs/pulseaudio-ctl.nix diff --git a/packages.nix b/packages.nix index 899d0114bc..13bdc5abaf 100644 --- a/packages.nix +++ b/packages.nix @@ -66,6 +66,7 @@ in { (import pkgs/mq-cli.nix) (import pkgs/nixfd.nix) (import pkgs/terraform-bin.nix) + (import pkgs/pulseaudio-ctl.nix) ]; } diff --git a/pkgs/pulseaudio-ctl.nix b/pkgs/pulseaudio-ctl.nix new file mode 100644 index 0000000000..9651ea097f --- /dev/null +++ b/pkgs/pulseaudio-ctl.nix @@ -0,0 +1,26 @@ +with import {}; + +stdenv.mkDerivation rec { + name = "pulseaudio-ctl-${version}"; + version = "v1.66"; + + src = fetchzip { + url = "https://github.com/graysky2/pulseaudio-ctl/archive/${version}.tar.gz"; + sha256 = "19a24w7y19551ar41q848w7r1imqkl9cpff4dpb7yry7qp1yjg0y"; + }; + + buildFlags = ''PREFIX=$(out)''; + + # Force Nix to detect the runtime dependency on 'bc' + preInstall = '' + sed -i 's|bc)|${bc}/bin/bc)|g' common/pulseaudio-ctl + ''; + + installFlags = ''PREFIX=$(out)''; + + meta = with stdenv.lib; { + description = "Control pulseaudio volume from the shell or mapped to keyboard shortcuts"; + homepage = "https://github.com/graysky2/pulseaudio-ctl"; + license = licenses.mit; + }; +} -- cgit 1.4.1 From 52dffda4c0582b8112f21be967be50d9dd3b7e6b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 25 Oct 2017 17:20:06 +0200 Subject: feat(adho): Add phone-tethering network --- adho-configuration.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 7246f54190..a36bc264b1 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -10,6 +10,8 @@ networking = { hostName = "adho"; wireless.enable = true; + wireless.userControlled.enable = true; + wireless.networks = { # Welcome to roast club! "How do I computer?" = { @@ -22,6 +24,13 @@ psk = "ostemAt1"; }; + # On the go! + "Rumpetroll" = { + psk = "fisk1234"; + # If this network exists, chances are that I want it: + priority = 10; + }; + # Public places in Oslo: "Abelone" = { psk = "speakeasy"; -- cgit 1.4.1 From fa224c48d9b3df4ab4d59d3fb72c055ab133e749 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 25 Oct 2017 17:20:24 +0200 Subject: feat(pkgs): Install dnsutils --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 13bdc5abaf..aa844f8413 100644 --- a/packages.nix +++ b/packages.nix @@ -17,6 +17,7 @@ in { alacritty curl direnv + dnsutils exa fd fish -- cgit 1.4.1 From dfe1f191a9960c9e05403f040802ec942febe284 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 25 Oct 2017 17:22:29 +0200 Subject: docs: Update README with setup instructions --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 970f25e6e9..5205b618b0 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,15 @@ NixOS configuration =================== -Set up the unstable channel first: +My NixOS config. Some manual steps required before the first run! + +Make sure submodules are cloned: `git submodule update --init`. + +Set up the unstable NixOS channel: ``` nix-channel --add http://nixos.org/channels/nixos-unstable nixos-unstable nix-channel --update ``` -## TODO - -* [ ] place i3 (and related) configuration automatically -* [ ] place [emacs configuration](https://github.com/tazjin/emacs.d) automatically -* [ ] configure channel automatically (if possible) -* [ ] configure Rust setup +Symlink local machine configuration to `/etc/nixos/local-configuration.nix`. -- cgit 1.4.1 From d22510b15f6cdb039f3a21e04de3687de1866a00 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 29 Oct 2017 16:47:05 +0100 Subject: feat(adho): Install Steam --- adho-configuration.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index a36bc264b1..c08ec73500 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -1,5 +1,5 @@ # Local configuration for 'adho' (Thinkpad T470s) -{ config, ...}: +{ config, pkgs, ...}: { boot.initrd.luks.devices.adho.device = "/dev/disk/by-uuid/722006b0-9654-4ea1-8703-e0cf9ac1905e"; @@ -7,6 +7,11 @@ services.xserver.videoDrivers = [ "intel" ]; programs.light.enable = true; + # Attempt to get Steam & co to run: + hardware.opengl.driSupport32Bit = true; + hardware.pulseaudio.support32Bit = true; + environment.systemPackages = [ pkgs.steam ]; + networking = { hostName = "adho"; wireless.enable = true; -- cgit 1.4.1 From 197f33574e8f4ea7ac5413e6bc6e2bac47bae756 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 29 Oct 2017 16:47:22 +0100 Subject: fix(adho): Use 5Ghz network at home --- adho-configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index c08ec73500..d6089673fa 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -19,7 +19,7 @@ wireless.networks = { # Welcome to roast club! - "How do I computer?" = { + "How do I computer fast?" = { psk = "washyourface"; }; -- cgit 1.4.1 From cd2f1fdabb147ab9a146afb3d379fb6802e9121d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 30 Oct 2017 00:30:12 +0100 Subject: feat(pkgs): Enable Evolution & GNOME key ring --- configuration.nix | 3 +++ packages.nix | 1 + 2 files changed, 4 insertions(+) diff --git a/configuration.nix b/configuration.nix index 44b3040d8b..6ca7966990 100644 --- a/configuration.nix +++ b/configuration.nix @@ -25,6 +25,9 @@ services.emacs.enable = true; services.emacs.defaultEditor = true; + # Enable GNOME keyring (required for Evolution) + services.gnome3.gnome-keyring.enable = true; + virtualisation = { # Configure VirtualBox (needed for local NixOps testing): virtualbox.host.enable = true; diff --git a/packages.nix b/packages.nix index aa844f8413..2343f4ab88 100644 --- a/packages.nix +++ b/packages.nix @@ -23,6 +23,7 @@ in { fish gcc git + gnome3.evolution gnumake gnupg google-cloud-sdk -- cgit 1.4.1 From 87f46244aef0819032c50bacf24bd41ea21930b7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 31 Oct 2017 00:45:57 +0100 Subject: fix(pkgs): Install additional evolution dependencies Evolution depends on these packages in order to function correctly. It can actually not even resize window panes (!) without dconf, which is a bit ridiculous. --- packages.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages.nix b/packages.nix index 2343f4ab88..8022578e8c 100644 --- a/packages.nix +++ b/packages.nix @@ -23,7 +23,9 @@ in { fish gcc git + gnome3.dconf gnome3.evolution + gnome3.glib_networking gnumake gnupg google-cloud-sdk @@ -43,6 +45,7 @@ in { openssl pass pavucontrol + pkgconfig ripgrep rofi rofi-pass -- cgit 1.4.1 From 4dcb1df11c8bb925e5beae4c7cb138056490afa2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 2 Nov 2017 16:50:46 +0100 Subject: feat: Configure JACK setup for use with Overtone --- configuration.nix | 4 ++++ packages.nix | 1 + 2 files changed, 5 insertions(+) diff --git a/configuration.nix b/configuration.nix index 6ca7966990..3ea65328c7 100644 --- a/configuration.nix +++ b/configuration.nix @@ -20,6 +20,10 @@ hardware.pulseaudio.enable = true; time.timeZone = "Europe/Oslo"; + # Configure audio setup for JACK + Overtone + boot.kernelModules = [ "snd-seq" "snd-rawmidi" ]; + hardware.pulseaudio.package = pkgs.pulseaudioFull; + # Configure emacs: # (actually, that's a lie, this only installs emacs!) services.emacs.enable = true; diff --git a/packages.nix b/packages.nix index 8022578e8c..175843e054 100644 --- a/packages.nix +++ b/packages.nix @@ -46,6 +46,7 @@ in { pass pavucontrol pkgconfig + qjackctl ripgrep rofi rofi-pass -- cgit 1.4.1 From 22919d1535b2e393965ae684d4740b68674bc88d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 5 Nov 2017 22:52:54 +0100 Subject: feat(pkgs): Bump Kontemplate to v1.3.0 --- pkgs/kontemplate.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/kontemplate.nix b/pkgs/kontemplate.nix index 4f322c8178..d6f686dcb8 100644 --- a/pkgs/kontemplate.nix +++ b/pkgs/kontemplate.nix @@ -2,11 +2,11 @@ with import {}; stdenv.mkDerivation { - name = "kontemplate-1.2.0"; + name = "kontemplate-1.3.0"; src = fetchzip { - url = "https://github.com/tazjin/kontemplate/releases/download/v1.2.0/kontemplate-1.2.0-f8b6ad6-linux-amd64.tar.gz"; - sha256 = "09siirhr1m9lc91bkw4h4l1qpnjnl03yr5m9mjfxdkp5gzmkcb9r"; + url = "https://github.com/tazjin/kontemplate/releases/download/v1.3.0/kontemplate-1.3.0-98daa6b-linux-amd64.tar.gz"; + sha256 = "0byybdc1xli96rxyg3wf7548b055ca355qavi435riwlkmn9c5da"; }; installPhase = '' -- cgit 1.4.1 From 52367acba1c1c6b47e3239009172f8136d1d47db Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 6 Nov 2017 22:10:36 +0100 Subject: chore: Disable VirtualBox again --- configuration.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/configuration.nix b/configuration.nix index 3ea65328c7..810176a37b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -33,9 +33,6 @@ services.gnome3.gnome-keyring.enable = true; virtualisation = { - # Configure VirtualBox (needed for local NixOps testing): - virtualbox.host.enable = true; - # Configure Docker (with socket activation): # Side note: ... why is this in virtualisation? ... docker.enable = true; -- cgit 1.4.1 From 4851c19543920a2a353327477f63640d0fcb9819 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 6 Nov 2017 22:10:59 +0100 Subject: chore: Disable PostgreSQL --- configuration.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/configuration.nix b/configuration.nix index 810176a37b..899735e05d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -46,9 +46,6 @@ ssh.startAgent = true; }; - # Enable PostgreSQL for development - services.postgresql.enable = true; - # Configure user account users.defaultUserShell = pkgs.fish; users.extraUsers.vincent = { -- cgit 1.4.1 From fc17dfbbfc44bea129f8de24d3af3bf18e9146f1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 6 Nov 2017 22:14:26 +0100 Subject: feat: Set up openssl.dev links in system environment This makes building stuff without nix-shell somewhat easier. --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 175843e054..4dda623d95 100644 --- a/packages.nix +++ b/packages.nix @@ -43,6 +43,7 @@ in { numix-icon-theme openjdk openssl + openssl.dev pass pavucontrol pkgconfig -- cgit 1.4.1 From 7b67a50fc00cecebc27b335fd22894dbade9c040 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 7 Nov 2017 00:25:29 +0100 Subject: feat(pkgs): Install rustracer --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 4dda623d95..1ba08c2e7d 100644 --- a/packages.nix +++ b/packages.nix @@ -51,6 +51,7 @@ in { ripgrep rofi rofi-pass + rustracer spotify stdmanpages tdesktop -- cgit 1.4.1 From 2c921e157d956b9287a4f08034c08616314feeb7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 8 Nov 2017 15:35:04 +0100 Subject: feat(adho): Add FSCONS & Hackeriet networks --- adho-configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index d6089673fa..feb8da2c35 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -45,6 +45,14 @@ "GET_5G_4FD250" = { psk = "62636342"; }; + + # FSCONS 2017 + "uioguest" = {}; + + # Hackeriet! + "hackeriet.no" = { + psk = "hackeriet.no"; + }; }; }; -- cgit 1.4.1 From a43657841b208072c98b4623bfa093fdb595f278 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 9 Nov 2017 10:40:51 +0100 Subject: feat(pkgs): Add stern-bin package --- packages.nix | 3 ++- pkgs/stern-bin.nix | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 pkgs/stern-bin.nix diff --git a/packages.nix b/packages.nix index 1ba08c2e7d..2e1d267cbf 100644 --- a/packages.nix +++ b/packages.nix @@ -73,8 +73,9 @@ in { (import pkgs/kontemplate.nix) (import pkgs/mq-cli.nix) (import pkgs/nixfd.nix) - (import pkgs/terraform-bin.nix) (import pkgs/pulseaudio-ctl.nix) + (import pkgs/stern-bin.nix) + (import pkgs/terraform-bin.nix) ]; } diff --git a/pkgs/stern-bin.nix b/pkgs/stern-bin.nix new file mode 100644 index 0000000000..27cadcb510 --- /dev/null +++ b/pkgs/stern-bin.nix @@ -0,0 +1,25 @@ +with import {}; + +stdenv.mkDerivation rec { + name = "stern-${version}"; + version = "1.5.1"; + + src = fetchurl { + url = "https://github.com/wercker/stern/releases/download/${version}/stern_linux_amd64"; + sha256 = "0xjxhgi1mlkbqimf0fk5cxr6lvwxrr2z49bnw4b1vqpd1gdqjyiv"; + name = "stern"; + }; + + phases = "installPhase"; + installPhase = '' + mkdir -p $out/bin + cp $src $out/bin/stern + chmod +x $out/bin/stern + ''; + + meta = with stdenv.lib; { + description = "Multi pod and container log tailing for Kubernetes"; + homepage = "https://github.com/wercker/stern"; + }; +} + -- cgit 1.4.1 From 60d7ccd4a5a353eb3093c3ffff0df830fa3615fa Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 10 Nov 2017 09:54:31 +0100 Subject: feat(adho): Add Cafe Sara network --- adho-configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index feb8da2c35..a4d72d56bc 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -53,6 +53,11 @@ "hackeriet.no" = { psk = "hackeriet.no"; }; + + # Cafe Sara + "Sara Nett" = { + psk = "sarabar1989"; + }; }; }; -- cgit 1.4.1 From 2ba26218ac4a8da47e7e1b6ee9781e60d36d509b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 13 Nov 2017 14:45:26 +0100 Subject: feat(pkgs): Bump MQ version --- pkgs/mq-cli.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/mq-cli.nix b/pkgs/mq-cli.nix index 03aa34b266..c007b9b479 100644 --- a/pkgs/mq-cli.nix +++ b/pkgs/mq-cli.nix @@ -18,13 +18,13 @@ in rustPlatform.buildRustPackage rec { version = "0.1.0"; rustRegistry = newRegistry; - depsSha256 = "1mdh5adnf58qn0gm2l9bp9dar2h577wvnhnlq8wj8a54vmgpp3ic"; + depsSha256 = "138a4dgwhf78bnmxz2ibxqz1wifq5046czxd0w8a4gwngy2ryiqs"; src = fetchFromGitHub { owner = "aprilabank"; repo = "mq-cli"; - rev = "2c71e092f69f5cd3c31ad8a84aa4168118579898"; - sha256 = "10m11fis5dv3v9y5rg48nbg7170bzakdban5mrjaj2vkv9qgslii"; + rev = "d908fe1cbc7de0bff7cadbe0b3851d50229b7de2"; + sha256 = "0c4myav65dzks53q4grin9lhcz1jzpddqnihf2h9lm098dhrswkp"; }; meta = with stdenv.lib; { -- cgit 1.4.1 From d79b7f45e70ca5250a5421dd4dab330dda17ad36 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 15 Nov 2017 15:27:22 +0100 Subject: feat(pkgs): Install gopass-bin --- packages.nix | 1 + pkgs/gopass-bin.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/gopass-bin.nix diff --git a/packages.nix b/packages.nix index 2e1d267cbf..13e91cd394 100644 --- a/packages.nix +++ b/packages.nix @@ -76,6 +76,7 @@ in { (import pkgs/pulseaudio-ctl.nix) (import pkgs/stern-bin.nix) (import pkgs/terraform-bin.nix) + (import pkgs/gopass-bin.nix { inherit pkgs; }) ]; } diff --git a/pkgs/gopass-bin.nix b/pkgs/gopass-bin.nix new file mode 100644 index 0000000000..30705726e8 --- /dev/null +++ b/pkgs/gopass-bin.nix @@ -0,0 +1,25 @@ +{ pkgs ? import {} }: + +with pkgs; stdenv.mkDerivation rec { + name = "gopass-bin-${version}"; + version = "1.6.1"; + + src = fetchzip { + url = "https://github.com/justwatchcom/gopass/releases/download/v${version}/gopass-${version}-linux-386.tar.gz"; + sha256 = "06iif74akcfb8n1h3ggig56a8y854p4dc7dpxpdfy6w9ra514phq"; + }; + + phases = "installPhase"; + installPhase = '' + mkdir -p $out/bin $out/share/fish/completions + cp $src/fish.completion $out/share/fish/completions/gopass.fish + cp $src/gopass $out/bin/gopass + chmod +x $out/bin/gopass + ''; + + meta = with stdenv.lib; { + description = "password-store like password manager with team functionality"; + license = licenses.mit; + homepage = "https://github.com/justwatchcom/gopass"; + }; +} -- cgit 1.4.1 From 7ca55c3fd5bb3434c4e1f5b30821a5d1a56fbced Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 15 Nov 2017 18:34:39 +0100 Subject: feat(desktop): Move from i3 to exwm Emacs just controls everything now. Why not! Rather than using the builtin NixOS support for EXWM I've added a custom snippet that takes care of the launching. This assumes that the user launching the session has my emacs configuration installed, which I, in practice, always do. * remove setup of i3wm (until I'm comfortable using exwm I will keep the i3 configuration files around) * disable compton (exwm brings its own compositor) * disable auto-starting of emacs user service * enable & configure exwm (also see correlating commits in my emacs.d repository) --- configuration.nix | 2 +- desktop.nix | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/configuration.nix b/configuration.nix index 899735e05d..0553c8cf4e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -26,7 +26,7 @@ # Configure emacs: # (actually, that's a lie, this only installs emacs!) - services.emacs.enable = true; + services.emacs.install = true; services.emacs.defaultEditor = true; # Enable GNOME keyring (required for Evolution) diff --git a/desktop.nix b/desktop.nix index 284789dec5..12149a0728 100644 --- a/desktop.nix +++ b/desktop.nix @@ -1,6 +1,6 @@ # Configuration for the desktop environment -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: let wallpapers = import ./pkgs/wallpapers.nix; in { @@ -9,18 +9,19 @@ in { enable = true; layout = "us,no"; xkbOptions = "caps:super, grp:shifts_toggle"; - }; - # configure desktop environment: - services.xserver.windowManager.i3 = { - enable = true; - configFile = "/etc/i3/config"; + # Give EXWM permission to control the session. + displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER"; }; - services.compton.enable = true; - # this should be the default! in fact, it will soon be: - # https://github.com/NixOS/nixpkgs/pull/30486 - services.compton.backend = "xrender"; + # Configure desktop environment: + services.xserver.windowManager.session = lib.singleton { + name = "exwm"; + start = '' + ${pkgs.emacs}/bin/emacs --daemon -f exwm-enable + emacsclient -c + ''; + }; # Configure Redshift for Oslo services.redshift = { -- cgit 1.4.1 From 7e0a55f697ae8443e12593bafe9f4c6efe6e08f1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 20 Nov 2017 22:00:50 +0100 Subject: feat(adho): Add a few more wifi networks --- adho-configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index a4d72d56bc..db594799ef 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -58,6 +58,14 @@ "Sara Nett" = { psk = "sarabar1989"; }; + + # Sync Compund + "RWDS" = { + psk = "radicalagenda"; + }; + + "espressohouse" = {}; + "Gotanet Open" = {}; }; }; -- cgit 1.4.1 From f2403271eca3c57058d42ed267dc719ee9d701ed Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 24 Nov 2017 09:28:05 +0100 Subject: feat(pkgs): Install SBCL & friends --- packages.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages.nix b/packages.nix index 13e91cd394..3dfe4ebb65 100644 --- a/packages.nix +++ b/packages.nix @@ -35,6 +35,7 @@ in { jetbrains.idea-ultimate jq kubernetes + lispPackages.quicklisp lxappearance-gtk3 manpages maven @@ -52,6 +53,7 @@ in { rofi rofi-pass rustracer + sbcl spotify stdmanpages tdesktop -- cgit 1.4.1 From ab11ea21764ea7fee9161fa8ffaed2aeff9e7513 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 24 Nov 2017 09:28:15 +0100 Subject: feat(adho): Add BrewDog network --- adho-configuration.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index db594799ef..c6869f3b67 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -59,11 +59,15 @@ psk = "sarabar1989"; }; - # Sync Compund + # Sync Compound "RWDS" = { psk = "radicalagenda"; }; + "BrewDog" = { + psk = "welovebeer"; + }; + "espressohouse" = {}; "Gotanet Open" = {}; }; -- cgit 1.4.1 From aa13319d6e6b0f7c26c54fb76a44974d567a368c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 21 Dec 2017 11:04:21 +0100 Subject: chore(adho): Remove Steam & related config --- adho-configuration.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index c6869f3b67..f026a040fa 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -7,11 +7,6 @@ services.xserver.videoDrivers = [ "intel" ]; programs.light.enable = true; - # Attempt to get Steam & co to run: - hardware.opengl.driSupport32Bit = true; - hardware.pulseaudio.support32Bit = true; - environment.systemPackages = [ pkgs.steam ]; - networking = { hostName = "adho"; wireless.enable = true; -- cgit 1.4.1 From 2a2af6cff79d154f5420942a6e8fafacca312077 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 21 Dec 2017 11:04:36 +0100 Subject: feat(adho): Add a few networks in Stockholm --- adho-configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index f026a040fa..e4b12c0dd2 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -63,8 +63,16 @@ psk = "welovebeer"; }; + # Dima's + "What's a Bad Idea?" = { + psk = "DQDxzrzIvy0YtDwH"; + }; + "espressohouse" = {}; "Gotanet Open" = {}; + "wifi.flytoget.no" = {}; + "AIRPORT" = {}; + "ilcaffelovesyou" = {}; }; }; -- cgit 1.4.1 From c2b9c03714862cfc8616e6f6a8c062b0a4bbacbf Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 24 Dec 2017 18:07:10 +0100 Subject: feat(adho): Add The Thief wifi --- adho-configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index e4b12c0dd2..f66f6762ce 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -68,6 +68,7 @@ psk = "DQDxzrzIvy0YtDwH"; }; + "The Thief" = {}; "espressohouse" = {}; "Gotanet Open" = {}; "wifi.flytoget.no" = {}; -- cgit 1.4.1 From 4a3c771a2316bfe096ba8d0ada9a20464b328ba6 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 24 Dec 2017 18:07:20 +0100 Subject: refactor(pkgs): Switch to stable Firefox distribution Since Firefox Quantum is in stable, I don't need to use the beta binary anymore. --- packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages.nix b/packages.nix index 3dfe4ebb65..8075182fd3 100644 --- a/packages.nix +++ b/packages.nix @@ -29,6 +29,7 @@ in { gnumake gnupg google-cloud-sdk + firefox-bin htop i3lock iftop @@ -64,8 +65,7 @@ in { xclip xfce.xfce4-screenshooter - # nixos-unstable.* packages: - unstable.firefox-beta-bin + # Unstable packages: unstable.numix-cursor-theme # Overlay packages: -- cgit 1.4.1 From bd10830d84c188ebdb1d2fdbe817364c857adba2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 24 Dec 2017 18:07:40 +0100 Subject: chore(dotfiles): Remove i3 config --- dotfiles.nix | 1 - dotfiles/i3.conf | 163 ------------------------------------------------------- 2 files changed, 164 deletions(-) delete mode 100644 dotfiles/i3.conf diff --git a/dotfiles.nix b/dotfiles.nix index 4032c873a3..203341c8ed 100644 --- a/dotfiles.nix +++ b/dotfiles.nix @@ -22,7 +22,6 @@ in { environment.etc = { "alacritty.yml".source = "${dotfiles}/alacritty.yml"; "fish/config.fish".source = "${dotfiles}/config.fish"; - "i3/config".source = "${dotfiles}/i3.conf"; "rofi.conf".source = "${dotfiles}/rofi.conf"; "tmux.conf".source = "${dotfiles}/tmux.conf"; }; diff --git a/dotfiles/i3.conf b/dotfiles/i3.conf deleted file mode 100644 index e398b1b9df..0000000000 --- a/dotfiles/i3.conf +++ /dev/null @@ -1,163 +0,0 @@ -# i3 config file (v4) -# -# Please see http://i3wm.org/docs/userguide.html for a complete reference! - -set $mod Mod4 - -font pango:Input Mono 11 - -# Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -# start a terminal -bindsym $mod+Return exec alacritty --config-file /etc/alacritty.yml - -# start an emacs frame -bindsym $mod+e exec emacsclient -c -n - -# kill focused window -bindsym $mod+Shift+q kill - -# start rofi (a program launcher) -bindsym XF86Search exec rofi -show run -bindsym $mod+d exec rofi -show run - -bindsym $mod+p exec passmenu - -# change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon focus right - -# alternatively, you can use the cursor keys: -bindsym $mod+Left focus left -bindsym $mod+Down focus down -bindsym $mod+Up focus up -bindsym $mod+Right focus right - -# move focused window -bindsym $mod+Shift+j move left -bindsym $mod+Shift+k move down -bindsym $mod+Shift+l move up -bindsym $mod+Shift+semicolon move right - -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right - -# split in horizontal orientation -bindsym $mod+h split h - -# split in vertical orientation -bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+x layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -#bindsym $mod+d focus child - -# switch to workspace -bindsym $mod+1 workspace 1 -bindsym $mod+2 workspace 2 -bindsym $mod+3 workspace 3 -bindsym $mod+4 workspace 4 -bindsym $mod+5 workspace 5 -bindsym $mod+6 workspace 6 -bindsym $mod+7 workspace 7 -bindsym $mod+8 workspace 8 -bindsym $mod+9 workspace 9 -bindsym $mod+0 workspace 10 - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace 1 -bindsym $mod+Shift+2 move container to workspace 2 -bindsym $mod+Shift+3 move container to workspace 3 -bindsym $mod+Shift+4 move container to workspace 4 -bindsym $mod+Shift+5 move container to workspace 5 -bindsym $mod+Shift+6 move container to workspace 6 -bindsym $mod+Shift+7 move container to workspace 7 -bindsym $mod+Shift+8 move container to workspace 8 -bindsym $mod+Shift+9 move container to workspace 9 -bindsym $mod+Shift+0 move container to workspace 10 - -# move workspace to next output -bindsym $mod+Shift+m move workspace to output left - -# reload the configuration file -bindsym $mod+Shift+c reload -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" - -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym j resize shrink width 10 px or 10 ppt - bindsym k resize grow height 10 px or 10 ppt - bindsym l resize shrink height 10 px or 10 ppt - bindsym semicolon resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - -bindsym $mod+r mode "resize" - -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) -bar { - status_command i3status - position top -} - -# Disable window title bars -new_window 1pixel - -# Switch back and forth between workspaces automatically -workspace_auto_back_and_forth yes - -# Brightness controls -bindsym XF86MonBrightnessDown exec light -U 10 -bindsym XF86MonBrightnessUp exec light -A 10 - -# Volume controls -bindsym XF86AudioMute exec --no-startup-id "pulseaudio-ctl mute" -bindsym XF86AudioRaiseVolume exec --no-startup-id "pulseaudio-ctl up" -bindsym XF86AudioLowerVolume exec --no-startup-id "pulseaudio-ctl down" - -# Lock screen -bindsym F7 exec i3lock - -# Enable floating for popup windows (e.g. pinentry) -for_window [title="pinentry"] floating enable -- cgit 1.4.1 From 50785da62dcd858523a68dc50a7fd6df7fce08c5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 24 Dec 2017 18:08:54 +0100 Subject: chore(dotfiles/pkgs): Remove rofi and configuration No longer need this with EXWM, where Helm replaces all these features. --- dotfiles.nix | 1 - dotfiles/rofi.conf | 3 --- packages.nix | 2 -- 3 files changed, 6 deletions(-) delete mode 100644 dotfiles/rofi.conf diff --git a/dotfiles.nix b/dotfiles.nix index 203341c8ed..2e952207d4 100644 --- a/dotfiles.nix +++ b/dotfiles.nix @@ -22,7 +22,6 @@ in { environment.etc = { "alacritty.yml".source = "${dotfiles}/alacritty.yml"; "fish/config.fish".source = "${dotfiles}/config.fish"; - "rofi.conf".source = "${dotfiles}/rofi.conf"; "tmux.conf".source = "${dotfiles}/tmux.conf"; }; } diff --git a/dotfiles/rofi.conf b/dotfiles/rofi.conf deleted file mode 100644 index 6663d67f4d..0000000000 --- a/dotfiles/rofi.conf +++ /dev/null @@ -1,3 +0,0 @@ -rofi.matching: fuzzy -rofi.levenshtein-sort: true -#include "/usr/share/rofi/themes//DarkBlue.theme" diff --git a/packages.nix b/packages.nix index 8075182fd3..50c3adb369 100644 --- a/packages.nix +++ b/packages.nix @@ -51,8 +51,6 @@ in { pkgconfig qjackctl ripgrep - rofi - rofi-pass rustracer sbcl spotify -- cgit 1.4.1 From 5fd46c706209bb01671fd27577168d3ddda169a1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 4 Jan 2018 23:22:07 +0100 Subject: feat(desktop): Re-enable Compton --- desktop.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop.nix b/desktop.nix index 12149a0728..2ea6cf6235 100644 --- a/desktop.nix +++ b/desktop.nix @@ -14,6 +14,11 @@ in { displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER"; }; + + # Apparently when you have house guests they complain about your screen tearing! + services.compton.enable = true; + services.compton.backend = "xrender"; + # Configure desktop environment: services.xserver.windowManager.session = lib.singleton { name = "exwm"; -- cgit 1.4.1 From 0381b667514dd53ebb27b8281def38bc0ca00f89 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 31 Dec 2017 16:48:03 +0100 Subject: feat(adho): Add various travel-related wifi networks --- adho-configuration.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index f66f6762ce..8b4e926614 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -68,12 +68,15 @@ psk = "DQDxzrzIvy0YtDwH"; }; + "Norwegian Internet Access" = {}; + "NSB_INTERAKTIV" = {}; "The Thief" = {}; "espressohouse" = {}; "Gotanet Open" = {}; "wifi.flytoget.no" = {}; "AIRPORT" = {}; "ilcaffelovesyou" = {}; + "WIFIonICE" = {}; }; }; -- cgit 1.4.1 From 568c4cc115108b41f0d0ac267f3f35687e08759d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Jan 2018 14:53:47 +0100 Subject: feat(adho): Add Teknologihuset wifi --- adho-configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 8b4e926614..2841c93b94 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -68,6 +68,10 @@ psk = "DQDxzrzIvy0YtDwH"; }; + "SafetyWiFi - Teknologihuset" = { + psk = "tech4ever"; + }; + "Norwegian Internet Access" = {}; "NSB_INTERAKTIV" = {}; "The Thief" = {}; -- cgit 1.4.1 From d68582360a6523c05608369bc4b2095c68daca32 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 12 Jan 2018 22:56:46 +0100 Subject: feat(desktop): Type parentheses the Lisp-machine way https://www.reddit.com/r/lisp/comments/78tx8f/typing_parentheses_the_lisp_machine_way/ --- desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop.nix b/desktop.nix index 2ea6cf6235..b306cd5196 100644 --- a/desktop.nix +++ b/desktop.nix @@ -8,7 +8,7 @@ in { services.xserver = { enable = true; layout = "us,no"; - xkbOptions = "caps:super, grp:shifts_toggle"; + xkbOptions = "caps:super, grp:shifts_toggle, parens:swap_brackets"; # Give EXWM permission to control the session. displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER"; -- cgit 1.4.1 From 5a77ed60d4d0d935cdde649191a1075de41aef26 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 14 Jan 2018 00:25:14 +0100 Subject: feat(adho): Add Lorry's network --- adho-configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 2841c93b94..465d5fc701 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -81,6 +81,7 @@ "AIRPORT" = {}; "ilcaffelovesyou" = {}; "WIFIonICE" = {}; + "Lorry Gjest" = {}; }; }; -- cgit 1.4.1 From b8aed1e2d6ea35cc2c0c6a6f93982dc5fce59f17 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 19 Jan 2018 15:57:13 +0100 Subject: chore(pkgs): Pin Rust release to 1.23.0 (2018-01-04) --- packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.nix b/packages.nix index 50c3adb369..14abe88dff 100644 --- a/packages.nix +++ b/packages.nix @@ -67,7 +67,7 @@ in { unstable.numix-cursor-theme # Overlay packages: - latest.rustChannels.stable.rust + (rustChannelOf { date = "2018-01-04"; channel = "stable"; }).rust # Rust 1.23.0 # Custom packages: (import pkgs/kontemplate.nix) -- cgit 1.4.1 From 1c4c3ee467b6cd6d1a920af04aff22a14a40c38a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 2 Feb 2018 10:59:27 +0100 Subject: feat(adho): Add Amundsen wifi --- adho-configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 465d5fc701..83b8f865a1 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -82,6 +82,7 @@ "ilcaffelovesyou" = {}; "WIFIonICE" = {}; "Lorry Gjest" = {}; + "Amundsengjest" = {}; }; }; -- cgit 1.4.1 From 52ff13093acb9e68e8b94309764b07dccd7dc4ef Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 18 Feb 2018 12:31:13 +0100 Subject: fix(stallo): Use 5Ghz network at home --- stallo-configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stallo-configuration.nix b/stallo-configuration.nix index b58497f9e4..3a3205cbb5 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -11,7 +11,7 @@ hostName = "stallo"; wireless.enable = true; wireless.networks = { - "How do I computer?" = { + "How do I computer fast?" = { # Welcome to roast club! psk = "washyourface"; }; -- cgit 1.4.1 From d36ca272299c681aba0a80853ecc4cdb77b75111 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 19 Feb 2018 08:55:07 +0100 Subject: feat(adho): Add Tjuvholmen Pluss wifi --- adho-configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 83b8f865a1..63a1a1a672 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -72,6 +72,10 @@ psk = "tech4ever"; }; + "Selvaag Pluss" = { + psk = "detlilleekstra"; + }; + "Norwegian Internet Access" = {}; "NSB_INTERAKTIV" = {}; "The Thief" = {}; -- cgit 1.4.1 From 9042d0a9870469aee9c75cfbf142e9ef11f39011 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 3 Mar 2018 15:37:38 +0100 Subject: chore(adho): Update office wifi configuration --- adho-configuration.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index 63a1a1a672..1e50df292f 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -18,12 +18,6 @@ psk = "washyourface"; }; - # Did someone say wifi credentials are secret? - # http://bit.ly/2gI43QP - "Amesto-mobile" = { - psk = "ostemAt1"; - }; - # On the go! "Rumpetroll" = { psk = "fisk1234"; @@ -76,6 +70,10 @@ psk = "detlilleekstra"; }; + "Langler" = { + psk = "Oslo2018"; + }; + "Norwegian Internet Access" = {}; "NSB_INTERAKTIV" = {}; "The Thief" = {}; -- cgit 1.4.1 From 95eedea9ac2763f43fad0643d3a35a76227aea47 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 4 Mar 2018 00:07:38 +0100 Subject: feat(emacs): Install required emacs packages via Nix --- desktop.nix | 5 +++-- emacs.nix | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 emacs.nix diff --git a/desktop.nix b/desktop.nix index b306cd5196..bb3041f1c5 100644 --- a/desktop.nix +++ b/desktop.nix @@ -3,6 +3,7 @@ { config, lib, pkgs, ... }: let wallpapers = import ./pkgs/wallpapers.nix; + emacs = import ./emacs.nix { inherit pkgs; }; in { # Configure basic X-server stuff: services.xserver = { @@ -23,8 +24,8 @@ in { services.xserver.windowManager.session = lib.singleton { name = "exwm"; start = '' - ${pkgs.emacs}/bin/emacs --daemon -f exwm-enable - emacsclient -c + ${emacs}/bin/emacs --daemon -f exwm-enable + ${emacs}/bin/emacsclient -c ''; }; diff --git a/emacs.nix b/emacs.nix new file mode 100644 index 0000000000..ec7da68bbb --- /dev/null +++ b/emacs.nix @@ -0,0 +1,66 @@ +# Derivation for Emacs configured with the packages that I need: + +{ pkgs ? import {} }: + +let emacsWithPackages = with pkgs; (emacsPackagesNgGen emacs).emacsWithPackages; + +# Custom code for packages missing from the current Nix packages. + +in emacsWithPackages(epkgs: + # Actual ELPA packages (the enlightened!) + (with epkgs.elpaPackages; [ + ace-window + adjust-parens + avy + company + exwm + pinentry + rainbow-mode + undo-tree + which-key + ]) ++ + + # Stable packages: + (with epkgs.melpaStablePackages; [ + browse-kill-ring + cargo + dash + dash-functional + dockerfile-mode + erlang + flycheck + go-mode + gruber-darker-theme + haskell-mode + helm + ht + idle-highlight-mode + magit + markdown-mode-plus + multi-term + multiple-cursors + nix-mode + paredit + password-store + racer + rainbow-delimiters + rust-mode + s + sly + sly-company + smart-mode-line + string-edit + terraform-mode + yaml-mode + ]) ++ + + # Bleeding-edge packages: + (with epkgs.melpaPackages; [ + helm-pass + pg + racket-mode + restclient + sly-quicklisp + uuidgen + ]) +) -- cgit 1.4.1 From 8f7a720fcf9fbd07fdeb9516f50b71283ecfc3f5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 4 Mar 2018 00:33:19 +0100 Subject: fix: Make custom emacs available on system $PATH --- configuration.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index 0553c8cf4e..96f4ac9ac2 100644 --- a/configuration.nix +++ b/configuration.nix @@ -26,8 +26,11 @@ # Configure emacs: # (actually, that's a lie, this only installs emacs!) - services.emacs.install = true; - services.emacs.defaultEditor = true; + services.emacs = { + install = true; + defaultEditor = true; + package = import ./emacs.nix { inherit pkgs; }; + }; # Enable GNOME keyring (required for Evolution) services.gnome3.gnome-keyring.enable = true; -- cgit 1.4.1 From 57c047b5fd0e8dc505f735ef32d05fb66b3dd78c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 4 Mar 2018 01:53:41 +0100 Subject: fix(emacs): Use custom sly derivations The upstream sly derivations don't seem to work. This adds custom build instructions for the sly and sly-company Emacs packages. --- emacs.nix | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/emacs.nix b/emacs.nix index ec7da68bbb..99c49fa334 100644 --- a/emacs.nix +++ b/emacs.nix @@ -1,8 +1,43 @@ # Derivation for Emacs configured with the packages that I need: -{ pkgs ? import {} }: +{ pkgs ? import {} }: let emacsWithPackages = with pkgs; (emacsPackagesNgGen emacs).emacsWithPackages; +sly = with pkgs; emacsPackagesNg.melpaBuild { + pname = "sly"; + version = "20180221.1414"; + + src = fetchFromGitHub { + owner = "joaotavora"; + repo = "sly"; + rev = "486bfbe95612bcdc0960c490207970a188e0fbb9"; + sha256 = "0ib4q4k3h3qn88pymyjjmlmnpizdn1mfg5gpk5a715nqsgxlg09l"; + }; + + recipeFile = fetchurl { + url = "https://raw.githubusercontent.com/melpa/melpa/23b9e64887a290fca7c7ab2718f627f8d728575f/recipes/sly"; + sha256 = "1pmyqjk8fdlzwvrlx8h6fq0savksfny78fhmr8r7b07pi20y6n9l"; + name = "sly"; + }; +}; + +# Building sly-company requires quite some dancing because +# company-mode is required at build time. +trivialBuildWithCompany = with pkgs; callPackage { + emacs = with pkgs; emacsWithPackages(epkgs: [ epkgs.elpaPackages.company ]); +}; + +sly-company = with pkgs; trivialBuildWithCompany { + pname = "sly-company"; + version = "master"; + + src = fetchFromGitHub { + owner = "joaotavora"; + repo = "sly-company"; + rev = "dfe18218e4b2ee9874394b50f82f5172f41c462c"; + sha256 = "1bj8w2wfq944cnhsk5xx41mfrjv89scrg4w98kqgda5drkpdf8a7"; + }; +}; # Custom code for packages missing from the current Nix packages. @@ -46,8 +81,6 @@ in emacsWithPackages(epkgs: rainbow-delimiters rust-mode s - sly - sly-company smart-mode-line string-edit terraform-mode @@ -60,7 +93,9 @@ in emacsWithPackages(epkgs: pg racket-mode restclient - sly-quicklisp uuidgen - ]) + ]) ++ + + # Custom packaged Emacs packages: + [ sly sly-company ] ) -- cgit 1.4.1 From 0937f19408621d950507782772ae6c88777b5bd6 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 4 Mar 2018 19:32:19 +0100 Subject: feat(pkgs/emacs): Add Haskell development packages --- emacs.nix | 1 + packages.nix | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/emacs.nix b/emacs.nix index 99c49fa334..e192cebf91 100644 --- a/emacs.nix +++ b/emacs.nix @@ -70,6 +70,7 @@ in emacsWithPackages(epkgs: helm ht idle-highlight-mode + intero magit markdown-mode-plus multi-term diff --git a/packages.nix b/packages.nix index 14abe88dff..27435e545d 100644 --- a/packages.nix +++ b/packages.nix @@ -63,6 +63,16 @@ in { xclip xfce.xfce4-screenshooter + # Haskell packages: + cabal-install + ghc + hlint + stack + stack2nix + haskellPackages.intero + haskellPackages.stylish-haskell + haskellPackages.yesod-bin + # Unstable packages: unstable.numix-cursor-theme -- cgit 1.4.1 From bcd317f23df6d076470879c706ca025659bfa722 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 4 Mar 2018 22:08:07 +0100 Subject: refactor(pkgs): Add wallpapers to top-level package set --- desktop.nix | 5 ++--- packages.nix | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/desktop.nix b/desktop.nix index bb3041f1c5..6ff41cbfde 100644 --- a/desktop.nix +++ b/desktop.nix @@ -2,8 +2,7 @@ { config, lib, pkgs, ... }: -let wallpapers = import ./pkgs/wallpapers.nix; - emacs = import ./emacs.nix { inherit pkgs; }; +let emacs = import ./emacs.nix { inherit pkgs; }; in { # Configure basic X-server stuff: services.xserver = { @@ -52,7 +51,7 @@ in { description = "Randomly set wallpaper via feh"; serviceConfig = { Type = "oneshot"; - WorkingDirectory = "${wallpapers}/share/wallpapers"; + WorkingDirectory = "${pkgs.wallpapers}/share/wallpapers"; # Manually shuffle because feh's --randomize option can't be restricted to # just certain file types. diff --git a/packages.nix b/packages.nix index 27435e545d..4cbe8ba60f 100644 --- a/packages.nix +++ b/packages.nix @@ -8,8 +8,13 @@ let unstable = import { config.allowUnfree = true; }; rust-overlay = import nixpkgs-mozilla/rust-overlay.nix; in { # Configure the Nix package manager - nixpkgs.config.allowUnfree = true; - nixpkgs.overlays = [ rust-overlay ]; + nixpkgs = { + overlays = [ rust-overlay ]; + config.allowUnfree = true; + config.packageOverrides = oldPkgs: oldPkgs // { + wallpapers = import ./pkgs/wallpapers.nix; + }; + }; # ... and declare packages to be installed. environment.systemPackages = with pkgs; [ -- cgit 1.4.1 From 92ae9eed7a0a75a0e403227dbe2b436a20c231b3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 6 Mar 2018 12:09:03 +0100 Subject: feat(emacs): Add custom nix-mode derivation Adds a nix-mode derivation that uses the latest nix-mode from master. --- emacs.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/emacs.nix b/emacs.nix index e192cebf91..dad2c106c1 100644 --- a/emacs.nix +++ b/emacs.nix @@ -39,7 +39,24 @@ sly-company = with pkgs; trivialBuildWithCompany { }; }; -# Custom code for packages missing from the current Nix packages. +# The nix-mode in the official repositories is old and annoying to +# work with, pin it to something newer instead: +nix-mode = with pkgs; emacsPackagesNg.melpaBuild { + pname = "nix-mode"; + version = "20180306"; + + src = fetchFromGitHub { + owner = "NixOS"; + repo = "nix-mode"; + rev = "0ac0271f6c8acdbfddfdbb1211a1972ae562ec17"; + sha256 = "157vy4xkvaqd76km47sh41wykbjmfrzvg40jxgppnalq9pjxfinp"; + }; + + recipeFile = writeText "nix-mode-recipe" '' + (nix-mode :repo "NixOS/nix-mode" :fetcher github + :files (:defaults (:exclude "nix-mode-mmm.el"))) + ''; +}; in emacsWithPackages(epkgs: # Actual ELPA packages (the enlightened!) @@ -75,7 +92,6 @@ in emacsWithPackages(epkgs: markdown-mode-plus multi-term multiple-cursors - nix-mode paredit password-store racer @@ -98,5 +114,5 @@ in emacsWithPackages(epkgs: ]) ++ # Custom packaged Emacs packages: - [ sly sly-company ] + [ sly sly-company nix-mode ] ) -- cgit 1.4.1 From 602b8b4ef06341fad4b60bc946d7406cafb321f8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 6 Mar 2018 12:33:27 +0100 Subject: fix(pkgs): Remove outdated nix-mode from Nix package See https://github.com/NixOS/nixpkgs/issues/36372 for details --- packages.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages.nix b/packages.nix index 4cbe8ba60f..db803db9a6 100644 --- a/packages.nix +++ b/packages.nix @@ -13,6 +13,12 @@ in { config.allowUnfree = true; config.packageOverrides = oldPkgs: oldPkgs // { wallpapers = import ./pkgs/wallpapers.nix; + + # Remove nix-mode from the Nix package as a workaround for + # https://github.com/NixOS/nixpkgs/issues/36372 + nix = oldPkgs.nix.overrideAttrs (oldAttrs: rec { + postInstall = "rm -rf $out/share/emacs"; + }); }; }; -- cgit 1.4.1 From 9def7c32ebbdbb7ce434ed6dbed8e071ad139793 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 9 Mar 2018 11:08:47 +0100 Subject: feat(emacs): Install edit-server Install edit-server package for use with the "Edit in Emacs" Firefox extension. --- emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.nix b/emacs.nix index dad2c106c1..019dd26b2b 100644 --- a/emacs.nix +++ b/emacs.nix @@ -106,6 +106,7 @@ in emacsWithPackages(epkgs: # Bleeding-edge packages: (with epkgs.melpaPackages; [ + edit-server helm-pass pg racket-mode -- cgit 1.4.1 From 4b1a1522cc3dd688f752c57aef749f8e3c7998b7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 9 Mar 2018 11:09:04 +0100 Subject: feat(desktop): Enable Russian keyboard layout --- desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop.nix b/desktop.nix index 6ff41cbfde..836f980261 100644 --- a/desktop.nix +++ b/desktop.nix @@ -7,7 +7,7 @@ in { # Configure basic X-server stuff: services.xserver = { enable = true; - layout = "us,no"; + layout = "us,no,ru"; xkbOptions = "caps:super, grp:shifts_toggle, parens:swap_brackets"; # Give EXWM permission to control the session. -- cgit 1.4.1 From 25b8c72a9887c55f49774d8faaae62bea5b78425 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 17 Mar 2018 21:46:36 +0100 Subject: feat(stallo): Enable SSH daemon --- stallo-configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stallo-configuration.nix b/stallo-configuration.nix index 3a3205cbb5..f7a41299c5 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -4,6 +4,8 @@ { boot.initrd.luks.devices.stallo-luks.device = "/dev/disk/by-uuid/b484cf1e-a27b-4785-8bd6-fa85a004b073"; + services.openssh.enable = true; + # Use proprietary nvidia driver services.xserver.videoDrivers = [ "nvidia" ]; -- cgit 1.4.1 From 175e20fb14666d967a2319f12f24fbfe7477a047 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 17 Mar 2018 21:47:17 +0100 Subject: feat(adho): Add initial CUPS configuration --- adho-configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 1e50df292f..7b74d22418 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -7,6 +7,12 @@ services.xserver.videoDrivers = [ "intel" ]; programs.light.enable = true; + # Office printer configuration + services.printing.enable = true; + services.printing.drivers = [ pkgs.hplip ]; + services.avahi.enable = true; + services.avahi.nssmdns = true; + networking = { hostName = "adho"; wireless.enable = true; -- cgit 1.4.1 From 779227164a8a8c7c91da79c2c8daa131db4939fa Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 17 Mar 2018 21:47:27 +0100 Subject: feat(emacs): Add Kotlin & TOML mode --- emacs.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs.nix b/emacs.nix index 019dd26b2b..7c879a5924 100644 --- a/emacs.nix +++ b/emacs.nix @@ -108,9 +108,11 @@ in emacsWithPackages(epkgs: (with epkgs.melpaPackages; [ edit-server helm-pass + kotlin-mode pg racket-mode restclient + toml-mode uuidgen ]) ++ -- cgit 1.4.1 From fc7b24245fb700dd428d4e2e16820ff3d692c4ea Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 19 Mar 2018 13:43:18 +0100 Subject: refactor(pkgs): Install kontemplate from nixpkgs Kontemplate has been upstreamed into Nix (yay!). --- packages.nix | 3 +-- pkgs/kontemplate.nix | 22 ---------------------- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 pkgs/kontemplate.nix diff --git a/packages.nix b/packages.nix index db803db9a6..d999f61591 100644 --- a/packages.nix +++ b/packages.nix @@ -86,12 +86,12 @@ in { # Unstable packages: unstable.numix-cursor-theme + unstable.kontemplate # Overlay packages: (rustChannelOf { date = "2018-01-04"; channel = "stable"; }).rust # Rust 1.23.0 # Custom packages: - (import pkgs/kontemplate.nix) (import pkgs/mq-cli.nix) (import pkgs/nixfd.nix) (import pkgs/pulseaudio-ctl.nix) @@ -100,4 +100,3 @@ in { (import pkgs/gopass-bin.nix { inherit pkgs; }) ]; } - diff --git a/pkgs/kontemplate.nix b/pkgs/kontemplate.nix deleted file mode 100644 index d6f686dcb8..0000000000 --- a/pkgs/kontemplate.nix +++ /dev/null @@ -1,22 +0,0 @@ -# Install the latest kontemplate version -with import {}; - -stdenv.mkDerivation { - name = "kontemplate-1.3.0"; - - src = fetchzip { - url = "https://github.com/tazjin/kontemplate/releases/download/v1.3.0/kontemplate-1.3.0-98daa6b-linux-amd64.tar.gz"; - sha256 = "0byybdc1xli96rxyg3wf7548b055ca355qavi435riwlkmn9c5da"; - }; - - installPhase = '' - mkdir -p $out/bin - mv kontemplate $out/bin/kontemplate - ''; - - meta = with stdenv.lib; { - description = "Extremely simple Kubernetes resource templates"; - homepage = "http://kontemplate.works"; - license = licenses.mit; - }; -} -- cgit 1.4.1 From e0178686406ac98d7f3dc28e3f8f32c4a18ebe99 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 22 Mar 2018 17:49:08 +0100 Subject: feat(adho): Open Chromecast-related ports in firewall --- adho-configuration.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 7b74d22418..53a410c29b 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -92,6 +92,9 @@ "Lorry Gjest" = {}; "Amundsengjest" = {}; }; + + # Open Chromecast-related ports + firewall.allowedTCPPorts = [ 5556 5558 ]; }; hardware.bluetooth.enable = true; -- cgit 1.4.1 From 2a6d57e97b04d2e987f317d43389c2cf398df20e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 26 Mar 2018 23:06:25 +0200 Subject: feat(emacs): Install elm-mode --- emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.nix b/emacs.nix index 7c879a5924..6b7b2bd711 100644 --- a/emacs.nix +++ b/emacs.nix @@ -107,6 +107,7 @@ in emacsWithPackages(epkgs: # Bleeding-edge packages: (with epkgs.melpaPackages; [ edit-server + elm-mode helm-pass kotlin-mode pg -- cgit 1.4.1 From 01aed568e561f072eeeb9df4c608ce2271e77912 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 4 Apr 2018 17:10:12 +0200 Subject: feat: Update to NixOS 18.03 As the subject says ... This only includes some minor changes in configuration. Most interestingly several packages that I used to have in this repository as custom packages are now available in `nixos-unstable`. Unfortunately they weren't included in NixOS 18.03 though ... Either way, this is cleaner. --- configuration.nix | 2 +- packages.nix | 21 ++++----------------- pkgs/gopass-bin.nix | 25 ------------------------- pkgs/mq-cli.nix | 35 ----------------------------------- pkgs/nixfd.nix | 28 ---------------------------- pkgs/stern-bin.nix | 25 ------------------------- pkgs/terraform-bin.nix | 26 -------------------------- pkgs/wallpapers.nix | 5 +++-- 8 files changed, 8 insertions(+), 159 deletions(-) delete mode 100644 pkgs/gopass-bin.nix delete mode 100644 pkgs/mq-cli.nix delete mode 100644 pkgs/nixfd.nix delete mode 100644 pkgs/stern-bin.nix delete mode 100644 pkgs/terraform-bin.nix diff --git a/configuration.nix b/configuration.nix index 96f4ac9ac2..1ccb504d65 100644 --- a/configuration.nix +++ b/configuration.nix @@ -67,5 +67,5 @@ # compatible, in order to avoid breaking some software such as database # servers. You should change this only after NixOS release notes say you # should. - system.stateVersion = "17.09"; # Did you read the comment? + system.stateVersion = "18.03"; # Did you read the comment? } diff --git a/packages.nix b/packages.nix index d999f61591..890f10f28c 100644 --- a/packages.nix +++ b/packages.nix @@ -5,20 +5,12 @@ { config, pkgs, ... }: let unstable = import { config.allowUnfree = true; }; - rust-overlay = import nixpkgs-mozilla/rust-overlay.nix; in { # Configure the Nix package manager nixpkgs = { - overlays = [ rust-overlay ]; config.allowUnfree = true; config.packageOverrides = oldPkgs: oldPkgs // { wallpapers = import ./pkgs/wallpapers.nix; - - # Remove nix-mode from the Nix package as a workaround for - # https://github.com/NixOS/nixpkgs/issues/36372 - nix = oldPkgs.nix.overrideAttrs (oldAttrs: rec { - postInstall = "rm -rf $out/share/emacs"; - }); }; }; @@ -31,6 +23,7 @@ in { dnsutils exa fd + firefox-bin fish gcc git @@ -40,7 +33,7 @@ in { gnumake gnupg google-cloud-sdk - firefox-bin + gopass htop i3lock iftop @@ -67,6 +60,7 @@ in { spotify stdmanpages tdesktop + terraform_0_10 tig tmux tree @@ -87,16 +81,9 @@ in { # Unstable packages: unstable.numix-cursor-theme unstable.kontemplate - - # Overlay packages: - (rustChannelOf { date = "2018-01-04"; channel = "stable"; }).rust # Rust 1.23.0 + unstable.mq-cli # Custom packages: - (import pkgs/mq-cli.nix) - (import pkgs/nixfd.nix) (import pkgs/pulseaudio-ctl.nix) - (import pkgs/stern-bin.nix) - (import pkgs/terraform-bin.nix) - (import pkgs/gopass-bin.nix { inherit pkgs; }) ]; } diff --git a/pkgs/gopass-bin.nix b/pkgs/gopass-bin.nix deleted file mode 100644 index 30705726e8..0000000000 --- a/pkgs/gopass-bin.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs ? import {} }: - -with pkgs; stdenv.mkDerivation rec { - name = "gopass-bin-${version}"; - version = "1.6.1"; - - src = fetchzip { - url = "https://github.com/justwatchcom/gopass/releases/download/v${version}/gopass-${version}-linux-386.tar.gz"; - sha256 = "06iif74akcfb8n1h3ggig56a8y854p4dc7dpxpdfy6w9ra514phq"; - }; - - phases = "installPhase"; - installPhase = '' - mkdir -p $out/bin $out/share/fish/completions - cp $src/fish.completion $out/share/fish/completions/gopass.fish - cp $src/gopass $out/bin/gopass - chmod +x $out/bin/gopass - ''; - - meta = with stdenv.lib; { - description = "password-store like password manager with team functionality"; - license = licenses.mit; - homepage = "https://github.com/justwatchcom/gopass"; - }; -} diff --git a/pkgs/mq-cli.nix b/pkgs/mq-cli.nix deleted file mode 100644 index c007b9b479..0000000000 --- a/pkgs/mq-cli.nix +++ /dev/null @@ -1,35 +0,0 @@ -# Build and install mq-cli. - -with import {}; - -let - # The cached Cargo registry moves *very* slowly, override it: - newRegistry = rustRegistry.overrideAttrs (oldAttrs: rec { - name = "rustRegistry-2017-10-20"; - src = fetchFromGitHub { - owner = "rust-lang"; - repo = "crates.io-index"; - rev = "a1e85af8f57ba61e505c2cb2dc359b66caf355e9"; - sha256 = "0xcszw287kqlz15ikflsim36mrvpvlb2y074vg22szz0r48nn06v"; - }; - }); -in rustPlatform.buildRustPackage rec { - name = "mqcli-${version}"; - version = "0.1.0"; - - rustRegistry = newRegistry; - depsSha256 = "138a4dgwhf78bnmxz2ibxqz1wifq5046czxd0w8a4gwngy2ryiqs"; - - src = fetchFromGitHub { - owner = "aprilabank"; - repo = "mq-cli"; - rev = "d908fe1cbc7de0bff7cadbe0b3851d50229b7de2"; - sha256 = "0c4myav65dzks53q4grin9lhcz1jzpddqnihf2h9lm098dhrswkp"; - }; - - meta = with stdenv.lib; { - description = "CLI interface to POSIX message queues"; - homepage = https://github.com/aprilabank/mq-cli; - license = licenses.mit; - }; -} diff --git a/pkgs/nixfd.nix b/pkgs/nixfd.nix deleted file mode 100644 index 71e6ff82e9..0000000000 --- a/pkgs/nixfd.nix +++ /dev/null @@ -1,28 +0,0 @@ -with import {}; - -# Build and install my nixfd tool. -with rustPlatform; - -buildRustPackage rec { - name = "nixfd-${version}"; - version = "0.1.0"; - - # This hash is of course total bullshit due to the dummy libc dependency - # caused by: - # https://github.com/NixOS/nixpkgs/issues/22737 - depsSha256 = "0iihnyq50qbq0fkvcj5jxilcw7d3bwd1x3gwcq0mzrcah23say0j"; - - src = fetchFromGitHub { - owner = "tazjin"; - repo = "nixfd"; - rev = "dbadc9ef8486070f26677154fa032a47d732b7a9"; - sha256 = "162301lc4znlqbansmaw9sla1rwi2s5nfmhl3z752n6aj2gcvz89"; - }; - - meta = with stdenv.lib; { - description = "Tired of waiting for nix-env -qaP?"; - homepage = https://github.com/tazjin/nixfd; - license = licenses.mit; - platforms = platforms.all; - }; -} diff --git a/pkgs/stern-bin.nix b/pkgs/stern-bin.nix deleted file mode 100644 index 27cadcb510..0000000000 --- a/pkgs/stern-bin.nix +++ /dev/null @@ -1,25 +0,0 @@ -with import {}; - -stdenv.mkDerivation rec { - name = "stern-${version}"; - version = "1.5.1"; - - src = fetchurl { - url = "https://github.com/wercker/stern/releases/download/${version}/stern_linux_amd64"; - sha256 = "0xjxhgi1mlkbqimf0fk5cxr6lvwxrr2z49bnw4b1vqpd1gdqjyiv"; - name = "stern"; - }; - - phases = "installPhase"; - installPhase = '' - mkdir -p $out/bin - cp $src $out/bin/stern - chmod +x $out/bin/stern - ''; - - meta = with stdenv.lib; { - description = "Multi pod and container log tailing for Kubernetes"; - homepage = "https://github.com/wercker/stern"; - }; -} - diff --git a/pkgs/terraform-bin.nix b/pkgs/terraform-bin.nix deleted file mode 100644 index a12900d6a3..0000000000 --- a/pkgs/terraform-bin.nix +++ /dev/null @@ -1,26 +0,0 @@ -# Package to install a Terraform binary release. -# This is necessary because the Terraform package on Nix does not currently -# build for some reason. - -with import {}; - -stdenv.mkDerivation rec { - name = "terraform-${version}"; - version = "0.10.7"; - - src = fetchzip { - url = "https://releases.hashicorp.com/terraform/0.10.7/terraform_0.10.7_linux_amd64.zip"; - sha256 = "189g94bb1d3wxzp720a5vki91czsqmk728469wa1fdkl43cdqd2n"; - }; - - installPhase = '' - mkdir -p $out/bin - mv terraform $out/bin/terraform - ''; - - meta = with stdenv.lib; { - description = "Terraform is a tool for building, changing, and combining infrastructure safely and efficiently"; - homepage = "https://www.terraform.io/"; - license = licenses.mpl20; - }; -} diff --git a/pkgs/wallpapers.nix b/pkgs/wallpapers.nix index 2f15e45113..3a26a54fb7 100644 --- a/pkgs/wallpapers.nix +++ b/pkgs/wallpapers.nix @@ -5,8 +5,9 @@ stdenv.mkDerivation { name = "tazjins-wallpapers-1"; src = fetchgit { - url = "https://git.tazj.in/tazjin/wallpapers.git"; - rev = "3bce73b605ba5f848cb4e7cc33058a2be3952c68"; + url = "https://git.tazj.in/tazjin/wallpapers.git"; + rev = "3bce73b605ba5f848cb4e7cc33058a2be3952c68"; + sha256 = "1gjlazag7x005sf2bd6a7dw5p9ry5vjgzmvycsyiw3pv9b1gzc0j"; }; installPhase = '' -- cgit 1.4.1 From 6b40b8af85efc1a95864892e7e88398e848c0eb4 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Apr 2018 12:43:33 +0200 Subject: feat(adho): Add The Dubliner's wifi --- adho-configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 53a410c29b..efc17812fe 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -54,6 +54,12 @@ psk = "sarabar1989"; }; + # The Dubliner + "DubGjest" = { + # of course + psk = "Guinness"; + }; + # Sync Compound "RWDS" = { psk = "radicalagenda"; -- cgit 1.4.1 From 37c182cebbe78af78d31a7a0d6f2b0ac1cbc1213 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Apr 2018 12:43:42 +0200 Subject: feat(desktop): Add "screen-lock with wallpapers" shell script --- desktop.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop.nix b/desktop.nix index 836f980261..d03cf1244f 100644 --- a/desktop.nix +++ b/desktop.nix @@ -3,6 +3,9 @@ { config, lib, pkgs, ... }: let emacs = import ./emacs.nix { inherit pkgs; }; +screenLock = pkgs.writeShellScriptBin "screen-lock" '' + find ${pkgs.wallpapers} -name "*.png" | shuf -n1 | xargs i3lock -f -t -i +''; in { # Configure basic X-server stuff: services.xserver = { @@ -14,6 +17,8 @@ in { displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER"; }; + # Add a shell script with random screen lock wallpaper selection + environment.systemPackages = [ screenLock ]; # Apparently when you have house guests they complain about your screen tearing! services.compton.enable = true; -- cgit 1.4.1 From 6987d5b66e5e24c2e60bcc40ad2a30823962ebe6 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Apr 2018 12:44:09 +0200 Subject: feat(services): Enable PostgreSQL on all machines --- configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration.nix b/configuration.nix index 1ccb504d65..b120961dfa 100644 --- a/configuration.nix +++ b/configuration.nix @@ -49,6 +49,8 @@ ssh.startAgent = true; }; + services.postgresql.enable = true; + # Configure user account users.defaultUserShell = pkgs.fish; users.extraUsers.vincent = { -- cgit 1.4.1 From 47b6f2497711f6848c62625d54ff4c7b9d4e4623 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 5 Apr 2018 13:09:37 +0200 Subject: fix(dotfiles/fish): Fix shell setup for Nix 2.0 --- dotfiles/config.fish | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotfiles/config.fish b/dotfiles/config.fish index 6a491fac5d..d52d6f61d6 100644 --- a/dotfiles/config.fish +++ b/dotfiles/config.fish @@ -29,3 +29,6 @@ alias edit 'emacsclient -n' # Old habits die hard (also ls is just easier to type): alias ls 'exa' + +# Fix up nix-env & friends for Nix 2.0 +export NIX_REMOTE=daemon -- cgit 1.4.1 From 79ce1dc6939913657f392a05297a23e31c1e25b0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Apr 2018 13:17:30 +0200 Subject: refactor(packages): Pin unstable channel in packages.nix Pins the unstable Nix channel to a specific commit and uses package overrides to move select packages from that channel into the system Nix packages. --- packages.nix | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/packages.nix b/packages.nix index 890f10f28c..d5bb576512 100644 --- a/packages.nix +++ b/packages.nix @@ -4,13 +4,30 @@ { config, pkgs, ... }: -let unstable = import { config.allowUnfree = true; }; +let + # Channels last updated: 2014-04-22 + + + # Certain packages from unstable are required in my daily setup. To + # get access to them, they are hand-picked from the unstable channel + # and set as overrides on the system package set. + unstable = import (pkgs.fetchFromGitHub { + owner = "NixOS"; + repo = "nixpkgs-channels"; + rev = "6c064e6b1f34a8416f990db0cc617a7195f71588"; + sha256 = "1rqzh475xn43phagrr30lb0fd292c1s8as53irihsnd5wcksnbyd"; + }) { config.allowUnfree = true; }; in { # Configure the Nix package manager nixpkgs = { config.allowUnfree = true; config.packageOverrides = oldPkgs: oldPkgs // { wallpapers = import ./pkgs/wallpapers.nix; + pulseaudio-ctl = import pkgs/pulseaudio-ctl.nix; + + kontemplate = unstable.kontemplate; + mq-cli = unstable.mq-cli; + }; }; @@ -40,18 +57,22 @@ in { jetbrains.idea-ultimate jq kubernetes + kontemplate lispPackages.quicklisp lxappearance-gtk3 manpages maven + mq-cli nixops numix-gtk-theme numix-icon-theme + numix-cursor-theme openjdk openssl openssl.dev pass pavucontrol + pulseaudio-ctl pkgconfig qjackctl ripgrep @@ -77,13 +98,5 @@ in { haskellPackages.intero haskellPackages.stylish-haskell haskellPackages.yesod-bin - - # Unstable packages: - unstable.numix-cursor-theme - unstable.kontemplate - unstable.mq-cli - - # Custom packages: - (import pkgs/pulseaudio-ctl.nix) ]; } -- cgit 1.4.1 From 7c581e4f645630d097af65043bcf694852cb1bb3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Apr 2018 13:18:20 +0200 Subject: feat(emacs): Pin EXWM to 0.18 There are several severe regressions from EXWM 0.15 to EXWM 0.17. This commit pins the version to the somewhat newer 0.18 in hope that it resolves those issues again. --- emacs.nix | 6 ++++-- packages.nix | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/emacs.nix b/emacs.nix index 6b7b2bd711..08bb346771 100644 --- a/emacs.nix +++ b/emacs.nix @@ -1,6 +1,6 @@ # Derivation for Emacs configured with the packages that I need: -{ pkgs ? import {} }: +{ pkgs }: let emacsWithPackages = with pkgs; (emacsPackagesNgGen emacs).emacsWithPackages; sly = with pkgs; emacsPackagesNg.melpaBuild { @@ -59,13 +59,15 @@ nix-mode = with pkgs; emacsPackagesNg.melpaBuild { }; in emacsWithPackages(epkgs: + # Pinned packages: + (with pkgs.pinnedEmacs; [ exwm ]) ++ + # Actual ELPA packages (the enlightened!) (with epkgs.elpaPackages; [ ace-window adjust-parens avy company - exwm pinentry rainbow-mode undo-tree diff --git a/packages.nix b/packages.nix index d5bb576512..fe85f82dba 100644 --- a/packages.nix +++ b/packages.nix @@ -28,6 +28,8 @@ in { kontemplate = unstable.kontemplate; mq-cli = unstable.mq-cli; + # Override EXWM from 0.17 -> 0.18 + pinnedEmacs.exwm = unstable.emacsPackagesNg.elpaPackages.exwm; }; }; -- cgit 1.4.1 From 605b455c9324b4d050a55c4827aa3192a87dbbe7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Apr 2018 13:37:50 +0200 Subject: refactor(packages): Pin unstable using builtins.fetchTarball This is fetched at evaluation time and removes the dependency on first having some packages in scope. --- packages.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages.nix b/packages.nix index fe85f82dba..c2d5a133da 100644 --- a/packages.nix +++ b/packages.nix @@ -5,18 +5,21 @@ { config, pkgs, ... }: let + fetchChannel = { rev, sha256 }: import (fetchTarball { + inherit sha256; + url = "https://github.com/NixOS/nixpkgs-channels/archive/${rev}.tar.gz"; + }) { config.allowUnfree = true; }; + # Channels last updated: 2014-04-22 # Certain packages from unstable are required in my daily setup. To # get access to them, they are hand-picked from the unstable channel # and set as overrides on the system package set. - unstable = import (pkgs.fetchFromGitHub { - owner = "NixOS"; - repo = "nixpkgs-channels"; - rev = "6c064e6b1f34a8416f990db0cc617a7195f71588"; + unstable = fetchChannel { + rev = "6c064e6b1f34a8416f990db0cc617a7195f71588"; sha256 = "1rqzh475xn43phagrr30lb0fd292c1s8as53irihsnd5wcksnbyd"; - }) { config.allowUnfree = true; }; + }; in { # Configure the Nix package manager nixpkgs = { -- cgit 1.4.1 From 676531c5aa82b2c487e39df094a410e4e80a4462 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Apr 2018 13:38:17 +0200 Subject: feat(packages): Pin stable channel to git commit Instead of relying on nix-channel, pin the stable channel and override it on the whole machine. --- packages.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages.nix b/packages.nix index c2d5a133da..9c1c4b0590 100644 --- a/packages.nix +++ b/packages.nix @@ -12,6 +12,13 @@ let # Channels last updated: 2014-04-22 + # Instead of relying on Nix channels and ending up with out-of-sync + # situations between machines, the commit for the stable Nix channel + # is pinned here. + stable = fetchChannel { + rev = "06c576b0525da85f2de86b3c13bb796d6a0c20f6"; + sha256 = "01cra89drfjf3yhii5na0j5ivap2wcs0h8i0xcxrjs946nk4pp5j"; + }; # Certain packages from unstable are required in my daily setup. To # get access to them, they are hand-picked from the unstable channel @@ -24,7 +31,9 @@ in { # Configure the Nix package manager nixpkgs = { config.allowUnfree = true; - config.packageOverrides = oldPkgs: oldPkgs // { + # To use the pinned channel, the original package set is thrown + # away in the overrides: + config.packageOverrides = oldPkgs: stable // { wallpapers = import ./pkgs/wallpapers.nix; pulseaudio-ctl = import pkgs/pulseaudio-ctl.nix; -- cgit 1.4.1 From 95ce08981535c308ad12e3aa9e6eb58eceb3a071 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 23 Apr 2018 15:32:57 +0200 Subject: feat(desktop): Install Helvetica Neue font --- desktop.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop.nix b/desktop.nix index d03cf1244f..306de50c26 100644 --- a/desktop.nix +++ b/desktop.nix @@ -48,6 +48,7 @@ in { noto-fonts-cjk noto-fonts-emoji powerline-fonts + helvetica-neue-lt-std ]; }; -- cgit 1.4.1 From 636b1396f8721b2498c5b4e6ef3b5be665a075ea Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 23 Apr 2018 15:33:05 +0200 Subject: feat(emacs): Install nginx-mode --- emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.nix b/emacs.nix index 08bb346771..6f154ccccb 100644 --- a/emacs.nix +++ b/emacs.nix @@ -94,6 +94,7 @@ in emacsWithPackages(epkgs: markdown-mode-plus multi-term multiple-cursors + nginx-mode paredit password-store racer -- cgit 1.4.1 From 79944a66ef446603c969e64debec5d31fc0bbfc2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 24 Apr 2018 12:08:52 +0200 Subject: feat(dotfiles/fish): Add alias for 'servedir' --- dotfiles/config.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/dotfiles/config.fish b/dotfiles/config.fish index d52d6f61d6..c9cd656ced 100644 --- a/dotfiles/config.fish +++ b/dotfiles/config.fish @@ -26,6 +26,7 @@ alias gf 'git fetch' alias gap 'git add -p' alias pbcopy 'xclip -selection clipboard' alias edit 'emacsclient -n' +alias servedir 'nix-shell -p haskellPackages.wai-app-static --run warp' # Old habits die hard (also ls is just easier to type): alias ls 'exa' -- cgit 1.4.1 From 7f34861ef1c685af75a0a89449f005a04245ea16 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 24 Apr 2018 23:58:03 +0200 Subject: feat(packages): Add Rust packages globally --- packages.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages.nix b/packages.nix index 9c1c4b0590..602bc00fbd 100644 --- a/packages.nix +++ b/packages.nix @@ -49,6 +49,8 @@ in { environment.systemPackages = with pkgs; [ # Default nixos.* packages: alacritty + binutils-unwrapped + cargo curl direnv dnsutils @@ -70,26 +72,27 @@ in { iftop jetbrains.idea-ultimate jq - kubernetes kontemplate + kubernetes lispPackages.quicklisp lxappearance-gtk3 manpages maven mq-cli nixops + numix-cursor-theme numix-gtk-theme numix-icon-theme - numix-cursor-theme openjdk openssl openssl.dev pass pavucontrol - pulseaudio-ctl pkgconfig + pulseaudio-ctl qjackctl ripgrep + rustc rustracer sbcl spotify -- cgit 1.4.1 From eab23ce91281fdcad9d2d27d7722b22e2f6a8f3c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 28 Apr 2018 17:45:36 +0200 Subject: feat(config): Use 1.1.1.1 DNS servers --- configuration.nix | 6 ++++++ stallo-configuration.nix | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/configuration.nix b/configuration.nix index b120961dfa..36c7d4a8f3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -24,6 +24,12 @@ boot.kernelModules = [ "snd-seq" "snd-rawmidi" ]; hardware.pulseaudio.package = pkgs.pulseaudioFull; + # Don't use ISP's DNS servers: + networking.nameservers = [ + "1.1.1.1" + "1.0.0.1" + ]; + # Configure emacs: # (actually, that's a lie, this only installs emacs!) services.emacs = { diff --git a/stallo-configuration.nix b/stallo-configuration.nix index f7a41299c5..120544b1a3 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -18,5 +18,10 @@ psk = "washyourface"; }; }; + # IPv6 at home, of course: + nameservers = [ + "2606:4700:4700::1111" + "2606:4700:4700::1001" + ]; }; } -- cgit 1.4.1 From 851d43e7380e84be6fb2f6bc6fae345629d85d70 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 28 Apr 2018 17:46:13 +0200 Subject: refactor(adho/config): Open Chromecast-ports on all machines --- adho-configuration.nix | 3 --- configuration.nix | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index efc17812fe..178903511a 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -98,9 +98,6 @@ "Lorry Gjest" = {}; "Amundsengjest" = {}; }; - - # Open Chromecast-related ports - firewall.allowedTCPPorts = [ 5556 5558 ]; }; hardware.bluetooth.enable = true; diff --git a/configuration.nix b/configuration.nix index 36c7d4a8f3..76466c7e39 100644 --- a/configuration.nix +++ b/configuration.nix @@ -30,6 +30,9 @@ "1.0.0.1" ]; + # Open Chromecast-related ports + firewall.allowedTCPPorts = [ 5556 5558 ]; + # Configure emacs: # (actually, that's a lie, this only installs emacs!) services.emacs = { -- cgit 1.4.1 From 6f2a45fe58e966c50ce472580d0cfaa2ba145ea0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 28 Apr 2018 17:53:32 +0200 Subject: style(config): Minor style fix --- configuration.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/configuration.nix b/configuration.nix index 76466c7e39..27c55b47a0 100644 --- a/configuration.nix +++ b/configuration.nix @@ -24,14 +24,16 @@ boot.kernelModules = [ "snd-seq" "snd-rawmidi" ]; hardware.pulseaudio.package = pkgs.pulseaudioFull; - # Don't use ISP's DNS servers: - networking.nameservers = [ - "1.1.1.1" - "1.0.0.1" - ]; + networking = { + # Don't use ISP's DNS servers: + nameservers = [ + "1.1.1.1" + "1.0.0.1" + ]; - # Open Chromecast-related ports - firewall.allowedTCPPorts = [ 5556 5558 ]; + # Open Chromecast-related ports + firewall.allowedTCPPorts = [ 5556 5558 ]; + }; # Configure emacs: # (actually, that's a lie, this only installs emacs!) -- cgit 1.4.1 From 6a35699045824839b3667fb688557424e655bc46 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 1 May 2018 14:07:24 +0200 Subject: chore(packages): Bump channel versions --- packages.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages.nix b/packages.nix index 602bc00fbd..e6a765a1aa 100644 --- a/packages.nix +++ b/packages.nix @@ -10,22 +10,22 @@ let url = "https://github.com/NixOS/nixpkgs-channels/archive/${rev}.tar.gz"; }) { config.allowUnfree = true; }; - # Channels last updated: 2014-04-22 + # Channels last updated: 2014-05-01 # Instead of relying on Nix channels and ending up with out-of-sync # situations between machines, the commit for the stable Nix channel # is pinned here. stable = fetchChannel { - rev = "06c576b0525da85f2de86b3c13bb796d6a0c20f6"; - sha256 = "01cra89drfjf3yhii5na0j5ivap2wcs0h8i0xcxrjs946nk4pp5j"; + rev = "ce0d9d638ded6119f19d87e433e160603683fb1b"; + sha256 = "0na6kjk4xw6gqrn3a903yv3zfa64bspq2q3kd6wyf52y44j3s8sx"; }; # Certain packages from unstable are required in my daily setup. To # get access to them, they are hand-picked from the unstable channel # and set as overrides on the system package set. unstable = fetchChannel { - rev = "6c064e6b1f34a8416f990db0cc617a7195f71588"; - sha256 = "1rqzh475xn43phagrr30lb0fd292c1s8as53irihsnd5wcksnbyd"; + rev = "1b1be29bf827fc177100ae175030b2fda4132e47"; + sha256 = "0dnwyvh2xfbf35apf17iw59hscf1jdqn8nx7hm7yh9c0ypkh2qy3"; }; in { # Configure the Nix package manager -- cgit 1.4.1 From be749fdd22a1e8e7ae023c0fa6f23365b70a7c9c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 1 May 2018 14:08:36 +0200 Subject: fix(config): Clean /tmp on boot --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index 27c55b47a0..af5a21cc5e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,6 +17,7 @@ # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + boot.cleanTmpDir = true; hardware.pulseaudio.enable = true; time.timeZone = "Europe/Oslo"; -- cgit 1.4.1 From 693f92731bd119bb83eae3e63ee26fa235433861 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 1 May 2018 15:05:53 +0200 Subject: feat(emacs): Install ivy & related packages Finally getting around to ditching Helm ... --- emacs.nix | 7 ++++++- packages.nix | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 6f154ccccb..633b83be24 100644 --- a/emacs.nix +++ b/emacs.nix @@ -60,7 +60,12 @@ nix-mode = with pkgs; emacsPackagesNg.melpaBuild { in emacsWithPackages(epkgs: # Pinned packages: - (with pkgs.pinnedEmacs; [ exwm ]) ++ + (with pkgs.pinnedEmacs; [ + exwm + ivy + ivy-gitlab + ivy-pass + ]) ++ # Actual ELPA packages (the enlightened!) (with epkgs.elpaPackages; [ diff --git a/packages.nix b/packages.nix index e6a765a1aa..bf739b38e8 100644 --- a/packages.nix +++ b/packages.nix @@ -42,6 +42,9 @@ in { # Override EXWM from 0.17 -> 0.18 pinnedEmacs.exwm = unstable.emacsPackagesNg.elpaPackages.exwm; + pinnedEmacs.ivy = unstable.emacsPackagesNg.melpaPackages.ivy; + pinnedEmacs.ivy-pass = unstable.emacsPackagesNg.melpaPackages.ivy-pass; + pinnedEmacs.ivy-gitlab = unstable.emacsPackagesNg.melpaPackages.ivy-gitlab; }; }; -- cgit 1.4.1 From f4d1bb966cae1562b2d7baba1759b25733213539 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 1 May 2018 15:22:23 +0200 Subject: fix(config): Use OpenJDK instead of Oracle JDK --- configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration.nix b/configuration.nix index af5a21cc5e..8d1b1d4d03 100644 --- a/configuration.nix +++ b/configuration.nix @@ -57,6 +57,8 @@ # Configure various other applications: programs = { java.enable = true; + java.package = pkgs.openjdk; + fish.enable = true; ssh.startAgent = true; }; -- cgit 1.4.1 From 5cf456e4f58b00698680afd64b150d81f7824f1e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 1 May 2018 16:06:28 +0200 Subject: refactor(emacs): Install packages directly from MELPA Never use MELPA Stable, as it's based on the assumption that authors at least occasionally tag their code (they don't). --- emacs.nix | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/emacs.nix b/emacs.nix index 633b83be24..98e482d795 100644 --- a/emacs.nix +++ b/emacs.nix @@ -59,13 +59,8 @@ nix-mode = with pkgs; emacsPackagesNg.melpaBuild { }; in emacsWithPackages(epkgs: - # Pinned packages: - (with pkgs.pinnedEmacs; [ - exwm - ivy - ivy-gitlab - ivy-pass - ]) ++ + # Pinned packages (from unstable): + (with pkgs; with lib; attrValues pinnedEmacs) ++ # Actual ELPA packages (the enlightened!) (with epkgs.elpaPackages; [ @@ -79,22 +74,25 @@ in emacsWithPackages(epkgs: which-key ]) ++ - # Stable packages: - (with epkgs.melpaStablePackages; [ + # MELPA packages: + (with epkgs.melpaPackages; [ browse-kill-ring cargo dash dash-functional dockerfile-mode + edit-server + elm-mode erlang + flx flycheck go-mode gruber-darker-theme haskell-mode - helm ht idle-highlight-mode intero + kotlin-mode magit markdown-mode-plus multi-term @@ -102,27 +100,19 @@ in emacsWithPackages(epkgs: nginx-mode paredit password-store + pg racer + racket-mode rainbow-delimiters + restclient rust-mode s smart-mode-line string-edit terraform-mode - yaml-mode - ]) ++ - - # Bleeding-edge packages: - (with epkgs.melpaPackages; [ - edit-server - elm-mode - helm-pass - kotlin-mode - pg - racket-mode - restclient toml-mode uuidgen + yaml-mode ]) ++ # Custom packaged Emacs packages: -- cgit 1.4.1 From 7c673cd0d053e7231bde40aba826a9cd779845a8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 1 May 2018 16:07:02 +0200 Subject: feat(packages): Add more emacs packages from unstable Additional packages for ivy are installed from unstable, too, in order to avoid compatibility issues with the ivy version in stable. --- packages.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages.nix b/packages.nix index bf739b38e8..ecf2550bb8 100644 --- a/packages.nix +++ b/packages.nix @@ -40,11 +40,15 @@ in { kontemplate = unstable.kontemplate; mq-cli = unstable.mq-cli; - # Override EXWM from 0.17 -> 0.18 + # Override various Emacs packages from unstable: + pinnedEmacs.counsel = unstable.emacsPackagesNg.melpaPackages.counsel; + pinnedEmacs.counsel-tramp = unstable.emacsPackagesNg.melpaPackages.counsel-tramp; pinnedEmacs.exwm = unstable.emacsPackagesNg.elpaPackages.exwm; pinnedEmacs.ivy = unstable.emacsPackagesNg.melpaPackages.ivy; - pinnedEmacs.ivy-pass = unstable.emacsPackagesNg.melpaPackages.ivy-pass; pinnedEmacs.ivy-gitlab = unstable.emacsPackagesNg.melpaPackages.ivy-gitlab; + pinnedEmacs.ivy-hydra = unstable.emacsPackagesNg.melpaPackages.ivy-hydra; + pinnedEmacs.ivy-pass = unstable.emacsPackagesNg.melpaPackages.ivy-pass; + pinnedEmacs.swiper = unstable.emacsPackagesNg.melpaPackages.swiper; }; }; -- cgit 1.4.1 From a6de90aec7a43c9c15bc3822e844f963be6e2771 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 5 May 2018 12:22:26 +0200 Subject: fix(desktop): Enable exporting of X-server configuration This enables commands like `localectl list-keymaps` etc. to work correctly. --- desktop.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop.nix b/desktop.nix index 306de50c26..277134898f 100644 --- a/desktop.nix +++ b/desktop.nix @@ -12,6 +12,7 @@ in { enable = true; layout = "us,no,ru"; xkbOptions = "caps:super, grp:shifts_toggle, parens:swap_brackets"; + exportConfiguration = true; # Give EXWM permission to control the session. displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER"; -- cgit 1.4.1 From cefc584e558a32db85ffb2c65188a0690c93557c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 5 May 2018 12:28:40 +0200 Subject: feat(packages): Add several system-wide packages --- packages.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages.nix b/packages.nix index ecf2550bb8..866e3a105d 100644 --- a/packages.nix +++ b/packages.nix @@ -61,9 +61,11 @@ in { curl direnv dnsutils + evince exa fd - firefox-bin + file + firefox-unwrapped fish gcc git @@ -86,6 +88,7 @@ in { manpages maven mq-cli + ngrok nixops numix-cursor-theme numix-gtk-theme @@ -97,19 +100,26 @@ in { pavucontrol pkgconfig pulseaudio-ctl + pwgen qjackctl ripgrep rustc rustracer sbcl + screen + siege spotify stdmanpages tdesktop terraform_0_10 tig tmux + tokei + transmission tree + units unzip + vlc xclip xfce.xfce4-screenshooter -- cgit 1.4.1 From 484da65eed33b70dadde8dc3e8039d28d19b836e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 7 May 2018 14:23:54 +0200 Subject: refactor(pkgs): Use rustup instead of rustc --- packages.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages.nix b/packages.nix index 866e3a105d..96bc6b95d7 100644 --- a/packages.nix +++ b/packages.nix @@ -103,8 +103,7 @@ in { pwgen qjackctl ripgrep - rustc - rustracer + rustup sbcl screen siege -- cgit 1.4.1 From 33167c8a865f75b1c83244513baeae643ec66599 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 7 May 2018 14:24:07 +0200 Subject: refactor(services): Enable OpenSSH on all machines --- configuration.nix | 2 ++ stallo-configuration.nix | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index 8d1b1d4d03..a4891b812d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -44,6 +44,8 @@ package = import ./emacs.nix { inherit pkgs; }; }; + services.openssh.enable = true; + # Enable GNOME keyring (required for Evolution) services.gnome3.gnome-keyring.enable = true; diff --git a/stallo-configuration.nix b/stallo-configuration.nix index 120544b1a3..a9a6eb6100 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -4,8 +4,6 @@ { boot.initrd.luks.devices.stallo-luks.device = "/dev/disk/by-uuid/b484cf1e-a27b-4785-8bd6-fa85a004b073"; - services.openssh.enable = true; - # Use proprietary nvidia driver services.xserver.videoDrivers = [ "nvidia" ]; -- cgit 1.4.1 From 5ad29253b25bcb470f1a05f56393acfbea45860e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 7 May 2018 14:40:31 +0200 Subject: feat(packages): Install latest lsp-mode & lsp-rust in emacs --- packages.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages.nix b/packages.nix index 96bc6b95d7..215119a595 100644 --- a/packages.nix +++ b/packages.nix @@ -41,14 +41,18 @@ in { mq-cli = unstable.mq-cli; # Override various Emacs packages from unstable: - pinnedEmacs.counsel = unstable.emacsPackagesNg.melpaPackages.counsel; - pinnedEmacs.counsel-tramp = unstable.emacsPackagesNg.melpaPackages.counsel-tramp; - pinnedEmacs.exwm = unstable.emacsPackagesNg.elpaPackages.exwm; - pinnedEmacs.ivy = unstable.emacsPackagesNg.melpaPackages.ivy; - pinnedEmacs.ivy-gitlab = unstable.emacsPackagesNg.melpaPackages.ivy-gitlab; - pinnedEmacs.ivy-hydra = unstable.emacsPackagesNg.melpaPackages.ivy-hydra; - pinnedEmacs.ivy-pass = unstable.emacsPackagesNg.melpaPackages.ivy-pass; - pinnedEmacs.swiper = unstable.emacsPackagesNg.melpaPackages.swiper; + pinnedEmacs = { + counsel = unstable.emacsPackagesNg.melpaPackages.counsel; + counsel-tramp = unstable.emacsPackagesNg.melpaPackages.counsel-tramp; + exwm = unstable.emacsPackagesNg.elpaPackages.exwm; + ivy = unstable.emacsPackagesNg.melpaPackages.ivy; + ivy-gitlab = unstable.emacsPackagesNg.melpaPackages.ivy-gitlab; + ivy-hydra = unstable.emacsPackagesNg.melpaPackages.ivy-hydra; + ivy-pass = unstable.emacsPackagesNg.melpaPackages.ivy-pass; + swiper = unstable.emacsPackagesNg.melpaPackages.swiper; + lsp-mode = unstable.emacsPackagesNg.lsp-mode; + lsp-rust = unstable.emacsPackagesNg.lsp-rust; + }; }; }; -- cgit 1.4.1 From 7fcd4a9ccb56e84aabbead0367e37a421a5b5da1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 7 May 2018 14:43:35 +0200 Subject: refactor(emacs): Remove racer-mode, add smartparens --- emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 98e482d795..9aa2051a69 100644 --- a/emacs.nix +++ b/emacs.nix @@ -101,13 +101,13 @@ in emacsWithPackages(epkgs: paredit password-store pg - racer racket-mode rainbow-delimiters restclient rust-mode s smart-mode-line + smartparens string-edit terraform-mode toml-mode -- cgit 1.4.1 From a9493265eb049735a935b10f11b89aa2d0868c30 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 7 May 2018 14:43:47 +0200 Subject: style(pkgs): Slightly more readable emacs section --- packages.nix | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages.nix b/packages.nix index 215119a595..04a0e0aebc 100644 --- a/packages.nix +++ b/packages.nix @@ -41,17 +41,18 @@ in { mq-cli = unstable.mq-cli; # Override various Emacs packages from unstable: - pinnedEmacs = { - counsel = unstable.emacsPackagesNg.melpaPackages.counsel; - counsel-tramp = unstable.emacsPackagesNg.melpaPackages.counsel-tramp; - exwm = unstable.emacsPackagesNg.elpaPackages.exwm; - ivy = unstable.emacsPackagesNg.melpaPackages.ivy; - ivy-gitlab = unstable.emacsPackagesNg.melpaPackages.ivy-gitlab; - ivy-hydra = unstable.emacsPackagesNg.melpaPackages.ivy-hydra; - ivy-pass = unstable.emacsPackagesNg.melpaPackages.ivy-pass; - swiper = unstable.emacsPackagesNg.melpaPackages.swiper; - lsp-mode = unstable.emacsPackagesNg.lsp-mode; - lsp-rust = unstable.emacsPackagesNg.lsp-rust; + pinnedEmacs = with unstable.emacsPackagesNg; { + counsel = melpaPackages.counsel; + counsel-tramp = melpaPackages.counsel-tramp; + company-lsp = company-lsp; + exwm = elpaPackages.exwm; + ivy = melpaPackages.ivy; + ivy-gitlab = melpaPackages.ivy-gitlab; + ivy-hydra = melpaPackages.ivy-hydra; + ivy-pass = melpaPackages.ivy-pass; + swiper = melpaPackages.swiper; + lsp-mode = lsp-mode; + lsp-rust = lsp-rust; }; }; }; -- cgit 1.4.1 From 8cf7105e7db881e5799ab5e8ab0a1b9e1222863b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 8 May 2018 22:32:41 +0200 Subject: fix(packages): Install required LSP dependency (lsp-ui) --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 04a0e0aebc..ae6a8cc703 100644 --- a/packages.nix +++ b/packages.nix @@ -53,6 +53,7 @@ in { swiper = melpaPackages.swiper; lsp-mode = lsp-mode; lsp-rust = lsp-rust; + lsp-ui = lsp-ui; }; }; }; -- cgit 1.4.1 From 2a70e4e56c5cf503adc0a268a268869c7a6e3478 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 8 May 2018 23:34:30 +0200 Subject: fix(emacs): Install the correct Markdown mode --- emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 9aa2051a69..ac410f3d02 100644 --- a/emacs.nix +++ b/emacs.nix @@ -94,7 +94,7 @@ in emacsWithPackages(epkgs: intero kotlin-mode magit - markdown-mode-plus + markdown-mode multi-term multiple-cursors nginx-mode -- cgit 1.4.1 From 4a3d61555c2b159b4e5ab5b3990acc9b146153ac Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 8 May 2018 23:44:34 +0200 Subject: chore(emacs): Install markdown-mode from unstable The stable version does not seem to contain `gfm-view-mode` which is required by LSP. If it's not available the side-effect is nasty freezes of the entire emacs session. --- emacs.nix | 1 - packages.nix | 26 ++++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/emacs.nix b/emacs.nix index ac410f3d02..900aec3052 100644 --- a/emacs.nix +++ b/emacs.nix @@ -94,7 +94,6 @@ in emacsWithPackages(epkgs: intero kotlin-mode magit - markdown-mode multi-term multiple-cursors nginx-mode diff --git a/packages.nix b/packages.nix index ae6a8cc703..095bd8fc45 100644 --- a/packages.nix +++ b/packages.nix @@ -42,18 +42,20 @@ in { # Override various Emacs packages from unstable: pinnedEmacs = with unstable.emacsPackagesNg; { - counsel = melpaPackages.counsel; - counsel-tramp = melpaPackages.counsel-tramp; - company-lsp = company-lsp; - exwm = elpaPackages.exwm; - ivy = melpaPackages.ivy; - ivy-gitlab = melpaPackages.ivy-gitlab; - ivy-hydra = melpaPackages.ivy-hydra; - ivy-pass = melpaPackages.ivy-pass; - swiper = melpaPackages.swiper; - lsp-mode = lsp-mode; - lsp-rust = lsp-rust; - lsp-ui = lsp-ui; + inherit + company-lsp + counsel + counsel-tramp + exwm + ivy + ivy-gitlab + ivy-hydra + ivy-pass + lsp-mode + lsp-rust + lsp-ui + markdown-mode + swiper; }; }; }; -- cgit 1.4.1 From 1b289e5486df6055213ee14adcc5846105ab5555 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 9 May 2018 00:25:31 +0200 Subject: fix(dotfiles/fish): Fix fish shell in term-mode --- dotfiles/config.fish | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dotfiles/config.fish b/dotfiles/config.fish index c9cd656ced..de2c99ae60 100644 --- a/dotfiles/config.fish +++ b/dotfiles/config.fish @@ -33,3 +33,8 @@ alias ls 'exa' # Fix up nix-env & friends for Nix 2.0 export NIX_REMOTE=daemon + +# Fix display of fish in emacs' term-mode: +function fish_title + true +end -- cgit 1.4.1 From 29ab1eb0a110c74bf70c0da0c9c8d3ab4f7ab3d4 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 9 May 2018 00:58:34 +0200 Subject: feat(config): Enable Intel microcode updates on boot --- configuration.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configuration.nix b/configuration.nix index a4891b812d..063acf96b0 100644 --- a/configuration.nix +++ b/configuration.nix @@ -25,6 +25,9 @@ boot.kernelModules = [ "snd-seq" "snd-rawmidi" ]; hardware.pulseaudio.package = pkgs.pulseaudioFull; + # Update Intel microcode on boot (both machines have Intel CPUs): + hardware.cpu.intel.updateMicrocode = true; + networking = { # Don't use ISP's DNS servers: nameservers = [ -- cgit 1.4.1 From 76101fe330f9b604dcc23c35a646aee2e478e478 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 10 May 2018 16:13:51 +0200 Subject: fix(packages): Remove Cargo to let rustup take its place --- packages.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/packages.nix b/packages.nix index 095bd8fc45..1c8c75ab35 100644 --- a/packages.nix +++ b/packages.nix @@ -65,7 +65,6 @@ in { # Default nixos.* packages: alacritty binutils-unwrapped - cargo curl direnv dnsutils -- cgit 1.4.1 From bcd0f8aeb438fd0ba94dc8d8aaa2c0d479983a9d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 14 May 2018 12:51:24 +0200 Subject: feat(config): Enable OfflineIMAP user service --- configuration.nix | 6 ++++++ packages.nix | 1 + 2 files changed, 7 insertions(+) diff --git a/configuration.nix b/configuration.nix index 063acf96b0..08043924c1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -52,6 +52,12 @@ # Enable GNOME keyring (required for Evolution) services.gnome3.gnome-keyring.enable = true; + # Enable OfflineIMAP (configuration itself is user-data) + services.offlineimap = { + install = true; + path = with pkgs; [ pass notmuch ]; + }; + virtualisation = { # Configure Docker (with socket activation): # Side note: ... why is this in virtualisation? ... diff --git a/packages.nix b/packages.nix index 1c8c75ab35..58152704b2 100644 --- a/packages.nix +++ b/packages.nix @@ -97,6 +97,7 @@ in { mq-cli ngrok nixops + notmuch numix-cursor-theme numix-gtk-theme numix-icon-theme -- cgit 1.4.1 From 3f71d537b9c4bf2928e2b57cbdd9e291013b7a6e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 14 May 2018 12:56:26 +0200 Subject: chore(packages): Bump channel versions to latest --- packages.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages.nix b/packages.nix index 58152704b2..aa10104169 100644 --- a/packages.nix +++ b/packages.nix @@ -10,22 +10,22 @@ let url = "https://github.com/NixOS/nixpkgs-channels/archive/${rev}.tar.gz"; }) { config.allowUnfree = true; }; - # Channels last updated: 2014-05-01 + # Channels last updated: 2014-05-14 # Instead of relying on Nix channels and ending up with out-of-sync # situations between machines, the commit for the stable Nix channel # is pinned here. stable = fetchChannel { - rev = "ce0d9d638ded6119f19d87e433e160603683fb1b"; - sha256 = "0na6kjk4xw6gqrn3a903yv3zfa64bspq2q3kd6wyf52y44j3s8sx"; + rev = "ef74cafd3e5914fdadd08bf20303328d72d65d6c"; + sha256 = "0xj5gv8k40vi7fczrqv0ppcmhczddh30kyizvzfg5wyc15fm2dmg"; }; # Certain packages from unstable are required in my daily setup. To # get access to them, they are hand-picked from the unstable channel # and set as overrides on the system package set. unstable = fetchChannel { - rev = "1b1be29bf827fc177100ae175030b2fda4132e47"; - sha256 = "0dnwyvh2xfbf35apf17iw59hscf1jdqn8nx7hm7yh9c0ypkh2qy3"; + rev = "6db7f92cc2af827e8b8b181bf5ed828a1d0f141d"; + sha256 = "1hpgn22j35mgfyrrkgyg28fm4mzllk5wfv5mrrn29kiglqb462fr"; }; in { # Configure the Nix package manager -- cgit 1.4.1 From b70b1a18e4cfd2777ed0c2de3eb0aeecd09b35c0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 14 May 2018 13:24:23 +0200 Subject: feat(emacs): Add notmuch package --- emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 900aec3052..8e101a21d8 100644 --- a/emacs.nix +++ b/emacs.nix @@ -115,5 +115,5 @@ in emacsWithPackages(epkgs: ]) ++ # Custom packaged Emacs packages: - [ sly sly-company nix-mode ] + [ sly sly-company nix-mode pkgs.notmuch ] ) -- cgit 1.4.1 From d23c91ed022a828cdb464c1c15fa42802856e7f8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 23 May 2018 12:17:20 +0200 Subject: feat(emacs): Install markdown-toc and web-mode --- emacs.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs.nix b/emacs.nix index 8e101a21d8..adf704c243 100644 --- a/emacs.nix +++ b/emacs.nix @@ -94,6 +94,7 @@ in emacsWithPackages(epkgs: intero kotlin-mode magit + markdown-toc multi-term multiple-cursors nginx-mode @@ -111,6 +112,7 @@ in emacsWithPackages(epkgs: terraform-mode toml-mode uuidgen + web-mode yaml-mode ]) ++ -- cgit 1.4.1 From 37cb2d422e8de098268c1cc342eaf0971102a709 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 27 May 2018 20:11:11 +0200 Subject: chore(pkgs): Bump channel versions --- packages.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages.nix b/packages.nix index aa10104169..d0094d5f70 100644 --- a/packages.nix +++ b/packages.nix @@ -10,22 +10,21 @@ let url = "https://github.com/NixOS/nixpkgs-channels/archive/${rev}.tar.gz"; }) { config.allowUnfree = true; }; - # Channels last updated: 2014-05-14 + # Channels last updated: 2014-05-26 # Instead of relying on Nix channels and ending up with out-of-sync # situations between machines, the commit for the stable Nix channel # is pinned here. stable = fetchChannel { - rev = "ef74cafd3e5914fdadd08bf20303328d72d65d6c"; - sha256 = "0xj5gv8k40vi7fczrqv0ppcmhczddh30kyizvzfg5wyc15fm2dmg"; + rev = "2f6440eb09b7e6e3322720ac91ce7e2cdeb413f9"; + sha256 = "0vb7ikjscrp2rw0dfw6pilxqpjm50l5qg2x2mn1vfh93dkl2aan7"; }; - # Certain packages from unstable are required in my daily setup. To - # get access to them, they are hand-picked from the unstable channel - # and set as overrides on the system package set. + # Certain packages from unstable are hand-picked into the package + # set. unstable = fetchChannel { - rev = "6db7f92cc2af827e8b8b181bf5ed828a1d0f141d"; - sha256 = "1hpgn22j35mgfyrrkgyg28fm4mzllk5wfv5mrrn29kiglqb462fr"; + rev = "5da85431fb1df4fb3ac36730b2591ccc9bdf5c21"; + sha256 = "0pc15wh5al9dmhcj29gwqir3wzpyk2nrplibr5xjk2bdvw6sv6c1"; }; in { # Configure the Nix package manager @@ -65,6 +64,7 @@ in { # Default nixos.* packages: alacritty binutils-unwrapped + cargo curl direnv dnsutils @@ -86,7 +86,8 @@ in { htop i3lock iftop - jetbrains.idea-ultimate + # Upstream link is down: + # jetbrains.idea-ultimate jq kontemplate kubernetes @@ -97,7 +98,6 @@ in { mq-cli ngrok nixops - notmuch numix-cursor-theme numix-gtk-theme numix-icon-theme -- cgit 1.4.1 From 39a80ce37db1ded6db3bbeda6f0a5e14b56bf8c1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 27 May 2018 20:13:03 +0200 Subject: fix(pkgs): Use latest version of Terraform --- packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.nix b/packages.nix index d0094d5f70..6979939930 100644 --- a/packages.nix +++ b/packages.nix @@ -118,7 +118,7 @@ in { spotify stdmanpages tdesktop - terraform_0_10 + terraform tig tmux tokei -- cgit 1.4.1 From 1c8d15871860f47f0ad54c2fafb38f582a3b73ff Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 24 May 2018 08:16:59 +0200 Subject: fix(emacs): Install markdown-toc from unstable, too --- emacs.nix | 1 - packages.nix | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index adf704c243..e5780812df 100644 --- a/emacs.nix +++ b/emacs.nix @@ -94,7 +94,6 @@ in emacsWithPackages(epkgs: intero kotlin-mode magit - markdown-toc multi-term multiple-cursors nginx-mode diff --git a/packages.nix b/packages.nix index 6979939930..62103b2792 100644 --- a/packages.nix +++ b/packages.nix @@ -54,6 +54,7 @@ in { lsp-rust lsp-ui markdown-mode + markdown-toc swiper; }; }; -- cgit 1.4.1 From 7c01f06554b59b035c383dda08113f8d9ba52130 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 25 May 2018 10:47:56 +0200 Subject: feat(configuration): Make /etc/resolv.conf immutable --- configuration.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 08043924c1..de8fcdd395 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: { imports = @@ -39,6 +39,15 @@ firewall.allowedTCPPorts = [ 5556 5558 ]; }; + # Generate an immutable /etc/resolv.conf from the nameserver settings + # above (otherwise DHCP overwrites it): + environment.etc."resolv.conf" = with lib; with pkgs; { + source = writeText "resolv.conf" '' + ${concatStringsSep "\n" (map (ns: "nameserver ${ns}") config.networking.nameservers)} + options edns0 + ''; + }; + # Configure emacs: # (actually, that's a lie, this only installs emacs!) services.emacs = { -- cgit 1.4.1 From aa3d40f9a00652b1c44763c4a1a33c61cc238147 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 25 May 2018 17:42:50 +0200 Subject: feat(adho): Add Pils & Programmering wifi --- adho-configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 178903511a..6320e46721 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -86,6 +86,11 @@ psk = "Oslo2018"; }; + # Pils & Programmering + "BEKKguest" = { + psk = "guest7890"; + }; + "Norwegian Internet Access" = {}; "NSB_INTERAKTIV" = {}; "The Thief" = {}; -- cgit 1.4.1 From c7c831fddd87a293a661d2660f0cdf046326820d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 27 May 2018 19:12:14 +0200 Subject: feat(adho): Add Røverstaden wifi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adho-configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 6320e46721..bf8792c157 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -91,6 +91,11 @@ psk = "guest7890"; }; + # Røverstaden + "Roverstaden" = { + psk = "r0verstaden2018"; + }; + "Norwegian Internet Access" = {}; "NSB_INTERAKTIV" = {}; "The Thief" = {}; -- cgit 1.4.1 From ba1d18985a7b78821a1282b6c1f5cce5d29f0218 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 27 May 2018 19:12:24 +0200 Subject: feat(pkgs): Add systemd development libraries to system environment --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 62103b2792..631c43c836 100644 --- a/packages.nix +++ b/packages.nix @@ -118,6 +118,7 @@ in { siege spotify stdmanpages + systemd.dev tdesktop terraform tig -- cgit 1.4.1 From 9eb3ce6d74c79ca86e9d1579efd281168c8f4fe2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 31 May 2018 13:37:26 +0200 Subject: feat(pkgs): Install thinkfan --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 631c43c836..872f273284 100644 --- a/packages.nix +++ b/packages.nix @@ -121,6 +121,7 @@ in { systemd.dev tdesktop terraform + thinkfan tig tmux tokei -- cgit 1.4.1 From 59cd0bbd8b76dc886ca4d1e3d6c613d7393a8fd3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 31 May 2018 13:42:39 +0200 Subject: feat(pkgs): Cherry-pick emacs26 from nixpkgs master --- packages.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages.nix b/packages.nix index 872f273284..a0163eedc7 100644 --- a/packages.nix +++ b/packages.nix @@ -26,6 +26,12 @@ let rev = "5da85431fb1df4fb3ac36730b2591ccc9bdf5c21"; sha256 = "0pc15wh5al9dmhcj29gwqir3wzpyk2nrplibr5xjk2bdvw6sv6c1"; }; + + # Temporarily import a commit from master directly to pick emacs26. + # Should be removed once that update is in nixos-unstable. + master = import (fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/288ce0cb845c03fafa1f3c673440e9922f22131a.tar.gz"; + }) {}; in { # Configure the Nix package manager nixpkgs = { @@ -38,6 +44,7 @@ in { kontemplate = unstable.kontemplate; mq-cli = unstable.mq-cli; + emacs = master.emacs; # Override various Emacs packages from unstable: pinnedEmacs = with unstable.emacsPackagesNg; { -- cgit 1.4.1 From 6939aa9b3df2ebf304705833c17ba4483f9fc6ba Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 3 Jun 2018 22:35:34 +0200 Subject: feat(emacs): Replace LSP-mode with eglot LSP-mode in combination with the Rust language server does not really work as RLS is extremely unstable. This switches over to eglot, which automatically restarts RLS after every crash. From initial testing it seems to be slightly less annoying than the previous setup. --- emacs.nix | 18 +++++++++++++++--- packages.nix | 4 ---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/emacs.nix b/emacs.nix index e5780812df..8700ac6454 100644 --- a/emacs.nix +++ b/emacs.nix @@ -1,5 +1,4 @@ # Derivation for Emacs configured with the packages that I need: - { pkgs }: let emacsWithPackages = with pkgs; (emacsPackagesNgGen emacs).emacsWithPackages; @@ -58,6 +57,20 @@ nix-mode = with pkgs; emacsPackagesNg.melpaBuild { ''; }; +# The default Rust language server mode is not really usable, install +# `eglot` instead and hope for the best. +eglot = with pkgs; emacsPackagesNg.melpaBuild rec { + pname = "eglot"; + version = "0.8"; + + src = fetchFromGitHub { + owner = "joaotavora"; + repo = "eglot"; + rev = version; + sha256 = "1avsry84sp3s2vr2iz9dphm579xgw8pqlwffl75gn5akykgazwdx"; + }; +}; + in emacsWithPackages(epkgs: # Pinned packages (from unstable): (with pkgs; with lib; attrValues pinnedEmacs) ++ @@ -91,7 +104,6 @@ in emacsWithPackages(epkgs: haskell-mode ht idle-highlight-mode - intero kotlin-mode magit multi-term @@ -116,5 +128,5 @@ in emacsWithPackages(epkgs: ]) ++ # Custom packaged Emacs packages: - [ sly sly-company nix-mode pkgs.notmuch ] + [ sly sly-company nix-mode eglot pkgs.notmuch ] ) diff --git a/packages.nix b/packages.nix index a0163eedc7..4c96ebb9e5 100644 --- a/packages.nix +++ b/packages.nix @@ -49,7 +49,6 @@ in { # Override various Emacs packages from unstable: pinnedEmacs = with unstable.emacsPackagesNg; { inherit - company-lsp counsel counsel-tramp exwm @@ -57,9 +56,6 @@ in { ivy-gitlab ivy-hydra ivy-pass - lsp-mode - lsp-rust - lsp-ui markdown-mode markdown-toc swiper; -- cgit 1.4.1 From 87cb47cc8e66e6d425887d0fdddda9ec035154fe Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 10:32:09 +0200 Subject: feat(adho): Add Wurst wifi --- adho-configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index bf8792c157..ac91f16ff7 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -36,6 +36,10 @@ psk = "speakeasy"; }; + "Wurst" = { + psk = "wurst2015"; + }; + # Eugene's apartment: "GET_5G_4FD250" = { psk = "62636342"; -- cgit 1.4.1 From 969c0071820b29061d4efe3d230831ae5f7c97b3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 10:32:15 +0200 Subject: feat(pkgs): Add notmuch & msmtp to global system --- packages.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages.nix b/packages.nix index 4c96ebb9e5..b32fd51761 100644 --- a/packages.nix +++ b/packages.nix @@ -99,9 +99,11 @@ in { lxappearance-gtk3 manpages maven + msmtp mq-cli ngrok nixops + notmuch numix-cursor-theme numix-gtk-theme numix-icon-theme -- cgit 1.4.1 From 1239f26e8a771b4040e8ebd557de0738b4d7d24a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 16:26:24 +0200 Subject: feat(mail): Import email configuration into Nix This moves my email configuration into NixOS, including the following features: 1. Replaced the NixOS-builtin offlineimap user service with a custom one that runs notmuch-indexing as part of the systemd unit instead of a postsynchook, which is significantly more reliable. 2. Adds configuration for notmuch and its tagging. 3. Adds configuration for OfflineIMAP & MSMTP. Relevant emacs configuration has also been added to my emacs.d repository. --- configuration.nix | 11 ++------ dotfiles/msmtprc | 24 ++++++++++++++++ dotfiles/notmuch-config | 21 ++++++++++++++ dotfiles/offlineimaprc | 61 +++++++++++++++++++++++++++++++++++++++++ mail.nix | 73 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 182 insertions(+), 8 deletions(-) create mode 100644 dotfiles/msmtprc create mode 100644 dotfiles/notmuch-config create mode 100644 dotfiles/offlineimaprc create mode 100644 mail.nix diff --git a/configuration.nix b/configuration.nix index de8fcdd395..e4a9574292 100644 --- a/configuration.nix +++ b/configuration.nix @@ -7,11 +7,12 @@ { imports = [ + ./desktop.nix + ./dotfiles.nix ./hardware-configuration.nix ./local-configuration.nix + ./mail.nix ./packages.nix - ./desktop.nix - ./dotfiles.nix ]; # Use the systemd-boot EFI boot loader. @@ -61,12 +62,6 @@ # Enable GNOME keyring (required for Evolution) services.gnome3.gnome-keyring.enable = true; - # Enable OfflineIMAP (configuration itself is user-data) - services.offlineimap = { - install = true; - path = with pkgs; [ pass notmuch ]; - }; - virtualisation = { # Configure Docker (with socket activation): # Side note: ... why is this in virtualisation? ... diff --git a/dotfiles/msmtprc b/dotfiles/msmtprc new file mode 100644 index 0000000000..c6a9a7426a --- /dev/null +++ b/dotfiles/msmtprc @@ -0,0 +1,24 @@ +defaults + +port 587 +tls on +tls_trust_file /etc/ssl/certs/ca-certificates.crt + +# Aprila mail +account aprila +from vincent@aprila.no +host smtp.office365.com +auth on +user vincent@aprila.no +passwordeval pass show aprila/office365-mail + +# Runbox mail +account runbox +from mail@tazj.in +host mail.runbox.com +auth on +user mail@tazj.in +passwordeval pass show general/runbox-tazjin + +# Use Runbox as default +account default : runbox diff --git a/dotfiles/notmuch-config b/dotfiles/notmuch-config new file mode 100644 index 0000000000..083be6d8ca --- /dev/null +++ b/dotfiles/notmuch-config @@ -0,0 +1,21 @@ +# .notmuch-config - Configuration file for the notmuch mail system +# +# For more information about notmuch, see https://notmuchmail.org + +[database] +path=/home/vincent/mail + +[user] +name=Vincent Ambo +primary_email=mail@tazj.in +other_email=vincent@aprila.no;tazjin@gmail.com; + +[new] +tags=unread;inbox; +ignore= + +[search] +exclude_tags=deleted;spam; + +[maildir] +synchronize_flags=true diff --git a/dotfiles/offlineimaprc b/dotfiles/offlineimaprc new file mode 100644 index 0000000000..56840c99d1 --- /dev/null +++ b/dotfiles/offlineimaprc @@ -0,0 +1,61 @@ +[general] +accounts = aprila, tazjin, gmail + +[DEFAULT] +ssl = yes +sslcacertfile = /etc/ssl/certs/ca-certificates.crt + +# Main work account: +[Account aprila] +localrepository = aprila-local +remoterepository = aprila-remote + +[Repository aprila-local] +type = Maildir +localfolders = ~/mail/aprila + +[Repository aprila-remote] +type = IMAP +remotehost = outlook.office365.com +remoteuser = vincent@aprila.no +remotepassfile = ~/.config/mail/aprila-pass +# Office365 is a naughty boy when it comes to IMAP. Even worse, they +# also seem to have decided that they should change IMAP folder names +# based on the UI language. +# +# I can't be bothered to implement the entire (relatively long) +# blacklist, so I'll instead whitelist relevant folders: +folderfilter = lambda folder: folder in ['INBOX', 'Arkiv', 'Sende element'] + +# Private GMail account (old): +[Account gmail] +# maxage = 30 # otherwise the volume is too high ... +localrepository = gmail-local +remoterepository = gmail-remote +synclabels = yes + +[Repository gmail-local] +type = GmailMaildir +localfolders = ~/mail/gmail + +[Repository gmail-remote] +type = Gmail +remoteuser = tazjin@gmail.com +remotepassfile = ~/.config/mail/gmail-pass +folderfilter = lambda folder: folder == 'INBOX' + +# Main private account: +[Account tazjin] +localrepository = tazjin-local +remoterepository = tazjin-remote + +[Repository tazjin-local] +type = Maildir +localfolders = ~/mail/tazjin + +[Repository tazjin-remote] +type = IMAP +remotehost = mail.runbox.com +remoteuser = mail@tazj.in +remotepassfile = ~/.config/mail/tazjin-pass +auth_mechanisms = LOGIN diff --git a/mail.nix b/mail.nix new file mode 100644 index 0000000000..7fb70f196c --- /dev/null +++ b/mail.nix @@ -0,0 +1,73 @@ +# This file configures offlineimap, notmuch and MSMTP. +# +# Some manual configuration is required the first time this is +# applied: +# +# 1. Credential setup. +# 2. Linking of MSMTP config (ln -s /etc/msmtprc ~/.msmtprc) +# 3. Linking of notmuch config (ln -s /etc/notmuch-config ~/.notmuch-config) + +{ config, lib, pkgs, ... }: + +let offlineImapConfig = pkgs.writeText "offlineimaprc" + (builtins.readFile ./dotfiles/offlineimaprc); + +msmtpConfig = pkgs.writeText "msmtprc" + (builtins.readFile ./dotfiles/msmtprc); + +notmuchConfig = pkgs.writeText "notmuch-config" + (builtins.readFile ./dotfiles/notmuch-config); + +tagConfig = pkgs.writeText "notmuch-tags" '' + # Tag emacs-devel mailing list: + -inbox +emacs-devel -- to:emacs-devel@gnu.org OR cc:emacs-devel@gnu.org + + # Filter out Gitlab mails: + -inbox +gitlab -- from:gitlab@aprila.no + + # Tag my own mail (from other devices) as sent: + -inbox +sent -- folder:"aprila/Sende element" OR from:vincent@aprila.no OR from:mail@tazj.in +''; + +notmuchIndex = pkgs.writeShellScriptBin "notmuch-index" '' + echo "Indexing new mails in notmuch" + + # Index new mail + ${pkgs.notmuch}/bin/notmuch new + + # Apply tags + cat ${tagConfig} | ${pkgs.notmuch}/bin/notmuch tag --batch + + echo "Done indexing new mails" +''; +in { + # Enable OfflineIMAP timer & service: + systemd.user.timers.offlineimap = { + description = "OfflineIMAP timer"; + wantedBy = [ "default.target" ]; + + timerConfig = { + Unit = "offlineimap.service"; + OnCalendar = "*:0/2"; # every 2 minutes + Persistent = "true"; # persist timer state after reboots + }; + }; + + systemd.user.services.offlineimap = { + description = "OfflineIMAP service"; + path = with pkgs; [ pass notmuch ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.offlineimap}/bin/offlineimap -u syslog -o -c ${offlineImapConfig}"; + ExecStartPost = "${notmuchIndex}/bin/notmuch-index"; + TimeoutStartSec = "2min"; + }; + }; + + # Link configuration files to /etc/ (from where they will be linked + # further): + environment.etc = { + "msmtprc".source = msmtpConfig; + "notmuch-config".source = notmuchConfig; + }; +} -- cgit 1.4.1 From 535eef9de3b5e178570ed5772a8b5e72e05f94ed Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 16:33:52 +0200 Subject: docs(README): Update README It was about time --- README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5205b618b0..4f2e870f90 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,23 @@ NixOS configuration =================== -My NixOS config. Some manual steps required before the first run! +My NixOS configuration! It configures most of the packages I require +on my systems, sets up Emacs the way I need and does a bunch of other +interesting things. -Make sure submodules are cloned: `git submodule update --init`. +In contrast with earlier versions of this configuration, the Nix +channel versions are now pinned in Nix (see the beginning of +[packages.nix][]). -Set up the unstable NixOS channel: +Machine-local configuration is kept in files with the naming scheme +`$hostname-configuration.nix` and **must** be symlinked to +`local-configuration.nix` before the first configuration run. -``` -nix-channel --add http://nixos.org/channels/nixos-unstable nixos-unstable -nix-channel --update -``` +I'm publishing this repository (and my [emacs configuration][]) as a +convenience for myself, but also as a resource that people looking for +example Nix or Emacs configurations can browse through. -Symlink local machine configuration to `/etc/nixos/local-configuration.nix`. +Feel free to ping me with any questions you might have. + +[packages.nix]: packages.nix +[emacs configuration]: https://github.com/tazjin/emacs.d -- cgit 1.4.1 From e4f9255a3a8d1dbf115b9cf0451e59fa0d5232f5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 16:35:08 +0200 Subject: chore: Remove .gitmodules Mozilla overlay is no longer used. --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index b51f28b60a..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "nixpkgs-mozilla"] - path = nixpkgs-mozilla - url = git@github.com:mozilla/nixpkgs-mozilla.git -- cgit 1.4.1 From 8664bb77144569ee4c3dd43b89d1e535552317ff Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 16:35:46 +0200 Subject: chore: Remove nixkpgs-mozilla submodule link --- nixpkgs-mozilla | 1 - 1 file changed, 1 deletion(-) delete mode 160000 nixpkgs-mozilla diff --git a/nixpkgs-mozilla b/nixpkgs-mozilla deleted file mode 160000 index 6179dd8765..0000000000 --- a/nixpkgs-mozilla +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6179dd876578ca2931f864627598ede16ba6cdef -- cgit 1.4.1 From 9b5be54563ed54a5f2957d1d38530e0c4b992c2f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 20:42:07 +0200 Subject: chore(pkgs): Remove Evolution --- packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.nix b/packages.nix index b32fd51761..a9aaa3ae93 100644 --- a/packages.nix +++ b/packages.nix @@ -81,7 +81,6 @@ in { gcc git gnome3.dconf - gnome3.evolution gnome3.glib_networking gnumake gnupg @@ -107,6 +106,7 @@ in { numix-cursor-theme numix-gtk-theme numix-icon-theme + offlineimap openjdk openssl openssl.dev -- cgit 1.4.1 From 8460fd5ec50b45a4282271d77d8af5b384949057 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 20:42:15 +0200 Subject: fix(mail): Move wantedBy setting to timer unit It's not the (oneshot) service, it's the timer that needs to be "enableable". --- mail.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mail.nix b/mail.nix index 7fb70f196c..8e45f5af7c 100644 --- a/mail.nix +++ b/mail.nix @@ -44,7 +44,6 @@ in { # Enable OfflineIMAP timer & service: systemd.user.timers.offlineimap = { description = "OfflineIMAP timer"; - wantedBy = [ "default.target" ]; timerConfig = { Unit = "offlineimap.service"; @@ -56,6 +55,8 @@ in { systemd.user.services.offlineimap = { description = "OfflineIMAP service"; path = with pkgs; [ pass notmuch ]; + wantedBy = [ "default.target" ]; + serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.offlineimap}/bin/offlineimap -u syslog -o -c ${offlineImapConfig}"; -- cgit 1.4.1 From 6ad766993030040a3444c24fa371dd72a3c8db38 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 20:42:35 +0200 Subject: fix(offlineimaprc): Set maxage=90 on GMail account --- dotfiles/offlineimaprc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/offlineimaprc b/dotfiles/offlineimaprc index 56840c99d1..f9980dbc71 100644 --- a/dotfiles/offlineimaprc +++ b/dotfiles/offlineimaprc @@ -29,7 +29,7 @@ folderfilter = lambda folder: folder in ['INBOX', 'Arkiv', 'Sende element'] # Private GMail account (old): [Account gmail] -# maxage = 30 # otherwise the volume is too high ... +maxage = 90 # otherwise the volume is too high ... localrepository = gmail-local remoterepository = gmail-remote synclabels = yes -- cgit 1.4.1 From 858895aad36513c7c8b95673d10e0b7cbcb191d9 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 20:44:32 +0200 Subject: fix(offlineimaprc): offlineimap chokes on inline comments --- dotfiles/offlineimaprc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/offlineimaprc b/dotfiles/offlineimaprc index f9980dbc71..dd4752f4c3 100644 --- a/dotfiles/offlineimaprc +++ b/dotfiles/offlineimaprc @@ -29,7 +29,7 @@ folderfilter = lambda folder: folder in ['INBOX', 'Arkiv', 'Sende element'] # Private GMail account (old): [Account gmail] -maxage = 90 # otherwise the volume is too high ... +maxage = 90 localrepository = gmail-local remoterepository = gmail-remote synclabels = yes -- cgit 1.4.1 From b607fa5e608863574db1001ec94c02d17cc62f17 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 21:16:03 +0200 Subject: fix(mail): Let timer unit be wanted by timers.target --- mail.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail.nix b/mail.nix index 8e45f5af7c..4a83ee5482 100644 --- a/mail.nix +++ b/mail.nix @@ -44,6 +44,7 @@ in { # Enable OfflineIMAP timer & service: systemd.user.timers.offlineimap = { description = "OfflineIMAP timer"; + wantedBy = [ "timers.target" ]; timerConfig = { Unit = "offlineimap.service"; @@ -55,7 +56,6 @@ in { systemd.user.services.offlineimap = { description = "OfflineIMAP service"; path = with pkgs; [ pass notmuch ]; - wantedBy = [ "default.target" ]; serviceConfig = { Type = "oneshot"; -- cgit 1.4.1 From 8813e5555570eb025a2c33c34e62f7f646eb114f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 23:32:55 +0200 Subject: feat(emacs): Add websocket lib (and remove flycheck) --- emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 8700ac6454..6c7d4dd8ea 100644 --- a/emacs.nix +++ b/emacs.nix @@ -98,7 +98,6 @@ in emacsWithPackages(epkgs: elm-mode erlang flx - flycheck go-mode gruber-darker-theme haskell-mode @@ -124,6 +123,7 @@ in emacsWithPackages(epkgs: toml-mode uuidgen web-mode + websocket yaml-mode ]) ++ -- cgit 1.4.1 From 8ac9fac175e83c1651275bdd92cdd87ba9437d36 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 7 Jun 2018 23:23:34 +0200 Subject: feat(mail): Tag development mailing list --- mail.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mail.nix b/mail.nix index 4a83ee5482..296f63fb91 100644 --- a/mail.nix +++ b/mail.nix @@ -27,6 +27,9 @@ tagConfig = pkgs.writeText "notmuch-tags" '' # Tag my own mail (from other devices) as sent: -inbox +sent -- folder:"aprila/Sende element" OR from:vincent@aprila.no OR from:mail@tazj.in + + # Tag development list + -inbox +aprila-dev -- to:dev@aprila.no OR cc:dev@aprila.no ''; notmuchIndex = pkgs.writeShellScriptBin "notmuch-index" '' -- cgit 1.4.1 From b80a567cdb62b9452abb784929ae92e291fb1044 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 8 Jun 2018 00:13:27 +0200 Subject: feat(emacs): Install jq-mode --- emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.nix b/emacs.nix index 6c7d4dd8ea..a3e89d37fc 100644 --- a/emacs.nix +++ b/emacs.nix @@ -103,6 +103,7 @@ in emacsWithPackages(epkgs: haskell-mode ht idle-highlight-mode + jq-mode kotlin-mode magit multi-term -- cgit 1.4.1 From e3b4a370a2718c13095c733557ce733a3d5095aa Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 8 Jun 2018 14:59:40 +0200 Subject: chore(notmuch-config): Set work email as default Office365 groups don't add required metadata to automatically determine which sender should be used when replying to a mail. --- dotfiles/notmuch-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dotfiles/notmuch-config b/dotfiles/notmuch-config index 083be6d8ca..41a902bfe2 100644 --- a/dotfiles/notmuch-config +++ b/dotfiles/notmuch-config @@ -7,8 +7,8 @@ path=/home/vincent/mail [user] name=Vincent Ambo -primary_email=mail@tazj.in -other_email=vincent@aprila.no;tazjin@gmail.com; +primary_email=vincent@aprila.no +other_email=mail@tazj.in;tazjin@gmail.com; [new] tags=unread;inbox; -- cgit 1.4.1 From 761e3794ed4024a9b86142341f38902194734207 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 8 Jun 2018 15:21:00 +0200 Subject: fix(mail): Exclude drafts from search results --- dotfiles/notmuch-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/notmuch-config b/dotfiles/notmuch-config index 41a902bfe2..eb8b2c79bb 100644 --- a/dotfiles/notmuch-config +++ b/dotfiles/notmuch-config @@ -15,7 +15,7 @@ tags=unread;inbox; ignore= [search] -exclude_tags=deleted;spam; +exclude_tags=deleted;spam;draft; [maildir] synchronize_flags=true -- cgit 1.4.1 From cd9499407311020c9d3fce59247f00edb1165d3e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 10 Jun 2018 15:50:21 +0200 Subject: fix(mail): Always mark drafts as read --- mail.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mail.nix b/mail.nix index 296f63fb91..b54cadebe4 100644 --- a/mail.nix +++ b/mail.nix @@ -28,6 +28,9 @@ tagConfig = pkgs.writeText "notmuch-tags" '' # Tag my own mail (from other devices) as sent: -inbox +sent -- folder:"aprila/Sende element" OR from:vincent@aprila.no OR from:mail@tazj.in + # Drafts are always read, duh. + -unread -- tag:draft + # Tag development list -inbox +aprila-dev -- to:dev@aprila.no OR cc:dev@aprila.no ''; -- cgit 1.4.1 From ad5fff55a28686764f5040c67fd016f2444375f6 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 10 Jun 2018 21:45:27 +0200 Subject: feat(mail): Tag nix-devel mailing list --- mail.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mail.nix b/mail.nix index b54cadebe4..3a334e2e80 100644 --- a/mail.nix +++ b/mail.nix @@ -22,6 +22,9 @@ tagConfig = pkgs.writeText "notmuch-tags" '' # Tag emacs-devel mailing list: -inbox +emacs-devel -- to:emacs-devel@gnu.org OR cc:emacs-devel@gnu.org + # Tag nix-devel mailing list: + -inbox +nix-devel -- to:nix-devel@googlegroups.com + # Filter out Gitlab mails: -inbox +gitlab -- from:gitlab@aprila.no -- cgit 1.4.1 From fc6126f5798f87c81ee590fe0b24219e93d86e43 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 13 Jun 2018 00:08:23 +0200 Subject: feat(emacs): Install prescient & ivy-prescient These packages are not in nixpkgs yet (will most likely be added after the next MELPA import), so they're added here manually. As both originate from the same source they're added to the same derivation here by using a custom recipe. --- emacs.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index a3e89d37fc..4507ea1646 100644 --- a/emacs.nix +++ b/emacs.nix @@ -71,6 +71,23 @@ eglot = with pkgs; emacsPackagesNg.melpaBuild rec { }; }; +# prescient & prescient-ivy provide better filtering in ivy/counsel +prescient = with pkgs; emacsPackagesNg.melpaBuild { + pname = "prescient"; + version = "20180611"; + + src = fetchFromGitHub { + owner = "raxod502"; + repo = "prescient.el"; + rev = "19a2c6b392ca6130dbbcf70cba57ee34d64fe50c"; + sha256 = "136q785lyhpgyaiysyq4pw11l83sa9h3q57v6papx813gf7rb7v7"; + }; + + recipeFile = writeText "prescient-recipe" '' + (prescient :files ("prescient.el" "ivy-prescient.el")) + ''; +}; + in emacsWithPackages(epkgs: # Pinned packages (from unstable): (with pkgs; with lib; attrValues pinnedEmacs) ++ @@ -129,5 +146,5 @@ in emacsWithPackages(epkgs: ]) ++ # Custom packaged Emacs packages: - [ sly sly-company nix-mode eglot pkgs.notmuch ] + [ sly sly-company nix-mode eglot prescient pkgs.notmuch ] ) -- cgit 1.4.1 From 608cd6226ae2050e2152845f67bcad2abcb69c7b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 15 Jun 2018 00:12:06 +0200 Subject: feat(emacs): Replace smart-mode-line with telephone-line --- emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 4507ea1646..bcf6d6318e 100644 --- a/emacs.nix +++ b/emacs.nix @@ -134,10 +134,10 @@ in emacsWithPackages(epkgs: restclient rust-mode s - smart-mode-line smartparens string-edit terraform-mode + telephone-line toml-mode uuidgen web-mode -- cgit 1.4.1 From 2bc9d09eb783fd4d93502a4b87b8f51bac924c11 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 15 Jun 2018 13:54:51 +0200 Subject: chore(packages): Bump channel versions emacs 26 is now included in unstable, so the extra pin has been removed. --- packages.nix | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages.nix b/packages.nix index a9aaa3ae93..8a70b6ec04 100644 --- a/packages.nix +++ b/packages.nix @@ -10,28 +10,22 @@ let url = "https://github.com/NixOS/nixpkgs-channels/archive/${rev}.tar.gz"; }) { config.allowUnfree = true; }; - # Channels last updated: 2014-05-26 + # Channels last updated: 2018-06-15 # Instead of relying on Nix channels and ending up with out-of-sync # situations between machines, the commit for the stable Nix channel # is pinned here. stable = fetchChannel { - rev = "2f6440eb09b7e6e3322720ac91ce7e2cdeb413f9"; - sha256 = "0vb7ikjscrp2rw0dfw6pilxqpjm50l5qg2x2mn1vfh93dkl2aan7"; + rev = "08d245eb31a3de0ad73719372190ce84c1bf3aee"; + sha256 = "1g22f8r3l03753s67faja1r0dq0w88723kkfagskzg9xy3qs8yw8"; }; # Certain packages from unstable are hand-picked into the package # set. unstable = fetchChannel { - rev = "5da85431fb1df4fb3ac36730b2591ccc9bdf5c21"; - sha256 = "0pc15wh5al9dmhcj29gwqir3wzpyk2nrplibr5xjk2bdvw6sv6c1"; + rev = "4b649a99d8461c980e7028a693387dc48033c1f7"; + sha256 = "0iy2gllj457052wkp20baigb2bnal9nhyai0z9hvjr3x25ngck4y"; }; - - # Temporarily import a commit from master directly to pick emacs26. - # Should be removed once that update is in nixos-unstable. - master = import (fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/288ce0cb845c03fafa1f3c673440e9922f22131a.tar.gz"; - }) {}; in { # Configure the Nix package manager nixpkgs = { @@ -44,7 +38,6 @@ in { kontemplate = unstable.kontemplate; mq-cli = unstable.mq-cli; - emacs = master.emacs; # Override various Emacs packages from unstable: pinnedEmacs = with unstable.emacsPackagesNg; { @@ -60,6 +53,7 @@ in { markdown-toc swiper; }; + emacs = unstable.emacs; # emacs 26.1 }; }; -- cgit 1.4.1 From 24314a61d6ec0dd138154e789d53c9ce402a4426 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 15 Jun 2018 13:55:27 +0200 Subject: chore(packages): Remove unused Haskell packages --- packages.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages.nix b/packages.nix index 8a70b6ec04..ea76f3183f 100644 --- a/packages.nix +++ b/packages.nix @@ -138,8 +138,6 @@ in { hlint stack stack2nix - haskellPackages.intero haskellPackages.stylish-haskell - haskellPackages.yesod-bin ]; } -- cgit 1.4.1 From b1d45f5b7623f6c67bcb056063e7272c7a58ccaf Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 15 Jun 2018 13:56:47 +0200 Subject: refactor(emacs): Use unstable channel directly in emacs module Stores the unstable channel in the global package set to make it available in the emacs module. All emacs-related packages are now taken from the unstable channel. Related changes: * prescient is now built directly from git * sly has been (temporarily) removed because the MELPA recipe is failing Unfortunately the version bumps to prescient and ivy (& its related packages) don't seem to help with raxod502/prescient.el#10 --- emacs.nix | 99 +++++++++++++++++++++++++----------------------------------- packages.nix | 19 +++--------- 2 files changed, 45 insertions(+), 73 deletions(-) diff --git a/emacs.nix b/emacs.nix index bcf6d6318e..3f391fc1d7 100644 --- a/emacs.nix +++ b/emacs.nix @@ -1,46 +1,14 @@ -# Derivation for Emacs configured with the packages that I need: +# Derivation for Emacs pre-configured with packages that I need. +# +# * TODO 2018-06-15: sly removed due to build error in unstable { pkgs }: -let emacsWithPackages = with pkgs; (emacsPackagesNgGen emacs).emacsWithPackages; -sly = with pkgs; emacsPackagesNg.melpaBuild { - pname = "sly"; - version = "20180221.1414"; - - src = fetchFromGitHub { - owner = "joaotavora"; - repo = "sly"; - rev = "486bfbe95612bcdc0960c490207970a188e0fbb9"; - sha256 = "0ib4q4k3h3qn88pymyjjmlmnpizdn1mfg5gpk5a715nqsgxlg09l"; - }; - - recipeFile = fetchurl { - url = "https://raw.githubusercontent.com/melpa/melpa/23b9e64887a290fca7c7ab2718f627f8d728575f/recipes/sly"; - sha256 = "1pmyqjk8fdlzwvrlx8h6fq0savksfny78fhmr8r7b07pi20y6n9l"; - name = "sly"; - }; -}; - -# Building sly-company requires quite some dancing because -# company-mode is required at build time. -trivialBuildWithCompany = with pkgs; callPackage { - emacs = with pkgs; emacsWithPackages(epkgs: [ epkgs.elpaPackages.company ]); -}; - -sly-company = with pkgs; trivialBuildWithCompany { - pname = "sly-company"; - version = "master"; - - src = fetchFromGitHub { - owner = "joaotavora"; - repo = "sly-company"; - rev = "dfe18218e4b2ee9874394b50f82f5172f41c462c"; - sha256 = "1bj8w2wfq944cnhsk5xx41mfrjv89scrg4w98kqgda5drkpdf8a7"; - }; -}; +with pkgs.unstable; with emacsPackagesNg; +let emacsWithPackages = (emacsPackagesNgGen emacs).emacsWithPackages; # The nix-mode in the official repositories is old and annoying to # work with, pin it to something newer instead: -nix-mode = with pkgs; emacsPackagesNg.melpaBuild { +nix-mode = emacsPackagesNg.melpaBuild { pname = "nix-mode"; version = "20180306"; @@ -59,7 +27,7 @@ nix-mode = with pkgs; emacsPackagesNg.melpaBuild { # The default Rust language server mode is not really usable, install # `eglot` instead and hope for the best. -eglot = with pkgs; emacsPackagesNg.melpaBuild rec { +eglot = emacsPackagesNg.melpaBuild rec { pname = "eglot"; version = "0.8"; @@ -71,27 +39,37 @@ eglot = with pkgs; emacsPackagesNg.melpaBuild rec { }; }; -# prescient & prescient-ivy provide better filtering in ivy/counsel -prescient = with pkgs; emacsPackagesNg.melpaBuild { - pname = "prescient"; - version = "20180611"; +# prescient & ivy-prescient provide better filtering in ivy/counsel, +# but they are not in nixpkgs yet: +prescientSource = fetchFromGitHub { + owner = "raxod502"; + repo = "prescient.el"; + rev = "27c94636489d5b062970a0f7e9041ca186b6b659"; + sha256 = "05jk8cms48dhpbaimmx3akmnq32fgbc0q4dja7lvpvssmq398cn7"; +}; - src = fetchFromGitHub { - owner = "raxod502"; - repo = "prescient.el"; - rev = "19a2c6b392ca6130dbbcf70cba57ee34d64fe50c"; - sha256 = "136q785lyhpgyaiysyq4pw11l83sa9h3q57v6papx813gf7rb7v7"; - }; +prescient = emacsPackagesNg.melpaBuild { + pname = "prescient"; + version = "1.0"; + src = prescientSource; recipeFile = writeText "prescient-recipe" '' - (prescient :files ("prescient.el" "ivy-prescient.el")) + (prescient :files ("prescient.el")) ''; }; -in emacsWithPackages(epkgs: - # Pinned packages (from unstable): - (with pkgs; with lib; attrValues pinnedEmacs) ++ +ivy-prescient = emacsPackagesNg.melpaBuild { + pname = "ivy-prescient"; + version = "1.0"; + src = prescientSource; + packageRequires = [ prescient ivy ]; + recipeFile = writeText "ivy-prescient-recipe" '' + (ivy-prescient :files ("ivy-prescient.el")) + ''; +}; + +in emacsWithPackages(epkgs: # Actual ELPA packages (the enlightened!) (with epkgs.elpaPackages; [ ace-window @@ -108,36 +86,41 @@ in emacsWithPackages(epkgs: (with epkgs.melpaPackages; [ browse-kill-ring cargo + counsel + counsel-tramp dash dash-functional dockerfile-mode edit-server - elm-mode erlang - flx + exwm go-mode gruber-darker-theme haskell-mode ht idle-highlight-mode + ivy + ivy-pass jq-mode kotlin-mode magit + markdown-mode + markdown-toc multi-term multiple-cursors nginx-mode paredit password-store pg - racket-mode rainbow-delimiters restclient rust-mode s smartparens string-edit - terraform-mode + swiper telephone-line + terraform-mode toml-mode uuidgen web-mode @@ -146,5 +129,5 @@ in emacsWithPackages(epkgs: ]) ++ # Custom packaged Emacs packages: - [ sly sly-company nix-mode eglot prescient pkgs.notmuch ] + [ nix-mode eglot prescient ivy-prescient pkgs.notmuch ] ) diff --git a/packages.nix b/packages.nix index ea76f3183f..4804aa8ad8 100644 --- a/packages.nix +++ b/packages.nix @@ -33,26 +33,15 @@ in { # To use the pinned channel, the original package set is thrown # away in the overrides: config.packageOverrides = oldPkgs: stable // { + # Store whole unstable channel in case that other modules need + # it (see emacs.nix for example): + inherit unstable; + wallpapers = import ./pkgs/wallpapers.nix; pulseaudio-ctl = import pkgs/pulseaudio-ctl.nix; kontemplate = unstable.kontemplate; mq-cli = unstable.mq-cli; - - # Override various Emacs packages from unstable: - pinnedEmacs = with unstable.emacsPackagesNg; { - inherit - counsel - counsel-tramp - exwm - ivy - ivy-gitlab - ivy-hydra - ivy-pass - markdown-mode - markdown-toc - swiper; - }; emacs = unstable.emacs; # emacs 26.1 }; }; -- cgit 1.4.1 From 8cc7d8da79b99531696802462474fe400eb04386 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 16 Jun 2018 11:48:18 +0200 Subject: feat(packages): Pick VLC 3 from unstable Finally! --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 4804aa8ad8..2e0b01b9bc 100644 --- a/packages.nix +++ b/packages.nix @@ -43,6 +43,7 @@ in { kontemplate = unstable.kontemplate; mq-cli = unstable.mq-cli; emacs = unstable.emacs; # emacs 26.1 + vlc = unstable.vlc; # VLC 3.0! }; }; -- cgit 1.4.1 From 2e2e8379e93ecfae045e9746fd8f0b839133cb15 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 16 Jun 2018 16:37:17 +0200 Subject: fix(emacs): Fix ivy & prescient integration by manually pinning ivy In the previous configuration the dependency on `ivy-pass` added a second version of ivy to the load-path. It is fixed by manually pinning ivy and its related packages and using those to build ivy-pass. This configuration should be temporary until the next time the MELPA package set is updated in nixpkgs. This caused the symptoms in raxod502/prescient.el#10 --- emacs.nix | 50 ++++++++++++++++++++++++++++++++++++++++++++------ packages.nix | 1 - 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/emacs.nix b/emacs.nix index 3f391fc1d7..96af4a9f29 100644 --- a/emacs.nix +++ b/emacs.nix @@ -39,6 +39,46 @@ eglot = emacsPackagesNg.melpaBuild rec { }; }; +# ivy has not been updated in unstable for a while: +ivySource = fetchFromGitHub { + owner = "abo-abo"; + repo = "swiper"; + rev = "6f2939485d33e9b28022d3b6912a50669dcdd596"; + sha256 = "1f2i6hkcbiqdw7fr9vabsm32a0gy647llzki6b97yv8vwa0klh2q"; +}; + +withIvySources = pname: recipe: emacsPackagesNg.melpaBuild { + inherit pname; + version = "20180616"; + recipeFile = builtins.toFile "${pname}-recipe" recipe; + src = ivySource; +}; + +newIvy.ivy = withIvySources "ivy" '' +(ivy :files (:defaults + (:exclude "swiper.el" "counsel.el" "ivy-hydra.el") + "doc/ivy-help.org")) +''; + +newIvy.counsel = withIvySources "counsel" '' +(counsel :files ("counsel.el")) +''; + +newIvy.swiper = withIvySources "swiper" '' +(swiper :files ("swiper.el")) +''; + +newIvy.ivy-pass = melpaBuild { + pname = "ivy-pass"; + version = "20170812"; + src = fetchFromGitHub { + owner = "ecraven"; + repo = "ivy-pass"; + rev = "5b523de1151f2109fdd6a8114d0af12eef83d3c5"; + sha256 = "18crb4zh2pjf0cmv3b913m9vfng27girjwfqc3mk7vqd1r5a49yk"; + }; +}; + # prescient & ivy-prescient provide better filtering in ivy/counsel, # but they are not in nixpkgs yet: prescientSource = fetchFromGitHub { @@ -62,7 +102,7 @@ ivy-prescient = emacsPackagesNg.melpaBuild { pname = "ivy-prescient"; version = "1.0"; src = prescientSource; - packageRequires = [ prescient ivy ]; + packageRequires = [ prescient newIvy.ivy ]; recipeFile = writeText "ivy-prescient-recipe" '' (ivy-prescient :files ("ivy-prescient.el")) @@ -86,8 +126,6 @@ in emacsWithPackages(epkgs: (with epkgs.melpaPackages; [ browse-kill-ring cargo - counsel - counsel-tramp dash dash-functional dockerfile-mode @@ -99,8 +137,6 @@ in emacsWithPackages(epkgs: haskell-mode ht idle-highlight-mode - ivy - ivy-pass jq-mode kotlin-mode magit @@ -118,7 +154,6 @@ in emacsWithPackages(epkgs: s smartparens string-edit - swiper telephone-line terraform-mode toml-mode @@ -128,6 +163,9 @@ in emacsWithPackages(epkgs: yaml-mode ]) ++ + # Use custom updated ivy packages + (lib.attrValues newIvy) ++ + # Custom packaged Emacs packages: [ nix-mode eglot prescient ivy-prescient pkgs.notmuch ] ) diff --git a/packages.nix b/packages.nix index 2e0b01b9bc..1ab5eef957 100644 --- a/packages.nix +++ b/packages.nix @@ -42,7 +42,6 @@ in { kontemplate = unstable.kontemplate; mq-cli = unstable.mq-cli; - emacs = unstable.emacs; # emacs 26.1 vlc = unstable.vlc; # VLC 3.0! }; }; -- cgit 1.4.1 From c2507d91f88fec79ca72b2afb647d5846c8180b5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 Jun 2018 15:21:34 +0200 Subject: feat(emacs): Install hydra --- emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.nix b/emacs.nix index 96af4a9f29..753ed1266a 100644 --- a/emacs.nix +++ b/emacs.nix @@ -136,6 +136,7 @@ in emacsWithPackages(epkgs: gruber-darker-theme haskell-mode ht + hydra idle-highlight-mode jq-mode kotlin-mode -- cgit 1.4.1 From 356e9fca06643840cb4aa1c0c5674bdb53964ed6 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 22 Jun 2018 10:32:01 +0200 Subject: feat(emacs): Install use-package --- emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.nix b/emacs.nix index 753ed1266a..242b5960ba 100644 --- a/emacs.nix +++ b/emacs.nix @@ -158,6 +158,7 @@ in emacsWithPackages(epkgs: telephone-line terraform-mode toml-mode + use-package uuidgen web-mode websocket -- cgit 1.4.1 From 328b692ae9329f375c2cdd8446984e39d12a3425 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 25 Jun 2018 18:56:10 +0200 Subject: feat(adho): Add Postkontoret & MAGNAT wifi --- adho-configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index ac91f16ff7..7a4efc1499 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -40,6 +40,10 @@ psk = "wurst2015"; }; + "postkontoret" = { + psk = "postkontoret"; + }; + # Eugene's apartment: "GET_5G_4FD250" = { psk = "62636342"; @@ -64,6 +68,10 @@ psk = "Guinness"; }; + "MAGNAT Guest" = { + psk = "elmolino021"; + }; + # Sync Compound "RWDS" = { psk = "radicalagenda"; -- cgit 1.4.1 From d14bc8e2931d5fae6ac5be3513bd091211ebae26 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 28 Jun 2018 11:01:30 +0200 Subject: feat(emacs): Add a newer version of sly from git --- emacs.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 242b5960ba..5ff20d75a4 100644 --- a/emacs.nix +++ b/emacs.nix @@ -109,6 +109,25 @@ ivy-prescient = emacsPackagesNg.melpaBuild { ''; }; +sly = emacsPackagesNg.melpaBuild { + pname = "sly"; + version = "20180613"; + packageRequires = [ elpaPackages.company ]; + + src = fetchFromGitHub { + owner = "joaotavora"; + repo = "sly"; + rev = "a05b45f1564a86a9d49707c9c570da6c3a56b6e5"; + sha256 = "1c9xzppxlnak1px0dv0ljpp4izfj4377lncvrcb1jaiyh8z8ry48"; + }; + + recipeFile = writeText "sly-recipe" '' + (sly :files ("*.el" + ("lib" "lib/*") + ("contrib" "contrib/*"))) + ''; +}; + in emacsWithPackages(epkgs: # Actual ELPA packages (the enlightened!) (with epkgs.elpaPackages; [ @@ -169,5 +188,5 @@ in emacsWithPackages(epkgs: (lib.attrValues newIvy) ++ # Custom packaged Emacs packages: - [ nix-mode eglot prescient ivy-prescient pkgs.notmuch ] + [ nix-mode eglot prescient ivy-prescient pkgs.notmuch sly ] ) -- cgit 1.4.1 From 40f78045768b51b8dfed649ca58e26c1803e0b63 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 29 Jun 2018 13:06:52 +0200 Subject: feat(emacs): Install counsel-notmuch --- emacs.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 5ff20d75a4..a60cfed4cc 100644 --- a/emacs.nix +++ b/emacs.nix @@ -79,6 +79,23 @@ newIvy.ivy-pass = melpaBuild { }; }; +counsel-notmuch = melpaBuild { + pname = "counsel-notmuch"; + version = "20171223"; + + packageRequires = [ + newIvy.ivy + pkgs.notmuch + ]; + + src = fetchFromGitHub { + owner = "fuxialexander"; + repo = "counsel-notmuch"; + rev = "ac1aaead81c6860d7b8324cc1c00bcd52de5e9ca"; + sha256 = "19frcrz6bx7d7v1hkg0xv7zmbk2sydlsdzn1s96cqzjk1illchkz"; + }; +}; + # prescient & ivy-prescient provide better filtering in ivy/counsel, # but they are not in nixpkgs yet: prescientSource = fetchFromGitHub { @@ -188,5 +205,5 @@ in emacsWithPackages(epkgs: (lib.attrValues newIvy) ++ # Custom packaged Emacs packages: - [ nix-mode eglot prescient ivy-prescient pkgs.notmuch sly ] + [ nix-mode eglot prescient ivy-prescient counsel-notmuch pkgs.notmuch sly ] ) -- cgit 1.4.1 From b08abbd81e4d0dbe867bc29edde3c8bfc280b83b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 2 Jul 2018 20:35:06 +0200 Subject: chore(pkgs): Remove unused packages --- packages.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages.nix b/packages.nix index 1ab5eef957..9f5d13fb5b 100644 --- a/packages.nix +++ b/packages.nix @@ -63,8 +63,6 @@ in { fish gcc git - gnome3.dconf - gnome3.glib_networking gnumake gnupg google-cloud-sdk @@ -84,7 +82,6 @@ in { msmtp mq-cli ngrok - nixops notmuch numix-cursor-theme numix-gtk-theme @@ -98,7 +95,6 @@ in { pkgconfig pulseaudio-ctl pwgen - qjackctl ripgrep rustup sbcl @@ -109,7 +105,6 @@ in { systemd.dev tdesktop terraform - thinkfan tig tmux tokei -- cgit 1.4.1 From 3b3bae22f7c890b1c49be14b2307667f2a54c28e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 2 Jul 2018 20:35:23 +0200 Subject: feat(pkgs): Install Haskell IDE Engine --- packages.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages.nix b/packages.nix index 9f5d13fb5b..4b1e6f57da 100644 --- a/packages.nix +++ b/packages.nix @@ -26,6 +26,13 @@ let rev = "4b649a99d8461c980e7028a693387dc48033c1f7"; sha256 = "0iy2gllj457052wkp20baigb2bnal9nhyai0z9hvjr3x25ngck4y"; }; + + # Haskell IDE engine: + hieCommit = "8f04568aa8c3215f543250eb7a1acfa0cf2d24ed"; + hie = import (fetchTarball { + url = "https://github.com/domenkozar/hie-nix/archive/${hieCommit}.tar.gz"; + sha256 = "06ygnywfnp6da0mcy4hq0xcvaaap1w3di2midv1w9b9miam8hdrn"; + }) {}; in { # Configure the Nix package manager nixpkgs = { @@ -119,9 +126,11 @@ in { # Haskell packages: cabal-install ghc + hie.hie82 hlint stack stack2nix haskellPackages.stylish-haskell + haskellPackages.yesod-bin ]; } -- cgit 1.4.1 From a3bd254d01fa5152809a5a4bdb610e26d6544bb2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 3 Jul 2018 18:58:22 +0200 Subject: feat(emacs): Install alchemist --- emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.nix b/emacs.nix index a60cfed4cc..dea49e2113 100644 --- a/emacs.nix +++ b/emacs.nix @@ -160,6 +160,7 @@ in emacsWithPackages(epkgs: # MELPA packages: (with epkgs.melpaPackages; [ + alchemist browse-kill-ring cargo dash -- cgit 1.4.1 From 4976c6d2b96f56527814c22cd91a2e1defee7207 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 13 Jul 2018 00:11:52 +0200 Subject: fix(mail): Filter NixOS Discourse into nix-devel tag --- mail.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mail.nix b/mail.nix index 3a334e2e80..a9375a1eea 100644 --- a/mail.nix +++ b/mail.nix @@ -22,8 +22,8 @@ tagConfig = pkgs.writeText "notmuch-tags" '' # Tag emacs-devel mailing list: -inbox +emacs-devel -- to:emacs-devel@gnu.org OR cc:emacs-devel@gnu.org - # Tag nix-devel mailing list: - -inbox +nix-devel -- to:nix-devel@googlegroups.com + # Tag nix-devel mailing list & discourse: + -inbox +nix-devel -- to:nix-devel@googlegroups.com OR from:nixos1@discoursemail.com # Filter out Gitlab mails: -inbox +gitlab -- from:gitlab@aprila.no -- cgit 1.4.1 From b41d1cecc104e7f9c3c20040973a048d1bef689c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 14 Jul 2018 16:18:13 +0200 Subject: feat(pkgs): Install fallback icon theme --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 4b1e6f57da..a2193fbfd1 100644 --- a/packages.nix +++ b/packages.nix @@ -75,6 +75,7 @@ in { google-cloud-sdk gopass htop + hicolor-icon-theme i3lock iftop # Upstream link is down: -- cgit 1.4.1 From e77fd237bd9239a67081654627b42a04c0f8c836 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 14 Jul 2018 16:18:21 +0200 Subject: feat(emacs): Install elixir-mode --- emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.nix b/emacs.nix index dea49e2113..84408b6366 100644 --- a/emacs.nix +++ b/emacs.nix @@ -167,6 +167,7 @@ in emacsWithPackages(epkgs: dash-functional dockerfile-mode edit-server + elixir-mode erlang exwm go-mode -- cgit 1.4.1 From 117f3f6d58e7d0f42e41b646a9cb22362c5494f1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Jul 2018 12:29:49 +0200 Subject: feat(config): Enable Redis service --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index e4a9574292..7295d80933 100644 --- a/configuration.nix +++ b/configuration.nix @@ -79,6 +79,7 @@ }; services.postgresql.enable = true; + services.redis.enable = true; # Configure user account users.defaultUserShell = pkgs.fish; -- cgit 1.4.1 From 503eff9a1fd93796494d29ca7a782c0e289841f5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 22 Jul 2018 15:22:41 +0200 Subject: feat(desktop): Install corefonts --- desktop.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop.nix b/desktop.nix index 277134898f..5f9746bf7c 100644 --- a/desktop.nix +++ b/desktop.nix @@ -44,6 +44,7 @@ in { # Configure fonts fonts = { fonts = with pkgs; [ + corefonts font-awesome-ttf input-fonts noto-fonts-cjk -- cgit 1.4.1 From aa048203b7b6bc3e75053a48f89f433887d7823d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 29 Jul 2018 16:46:45 +0200 Subject: chore(emacs): Update eglot version to 1.1 --- emacs.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs.nix b/emacs.nix index 84408b6366..7a16897126 100644 --- a/emacs.nix +++ b/emacs.nix @@ -29,13 +29,13 @@ nix-mode = emacsPackagesNg.melpaBuild { # `eglot` instead and hope for the best. eglot = emacsPackagesNg.melpaBuild rec { pname = "eglot"; - version = "0.8"; + version = "1.1"; src = fetchFromGitHub { owner = "joaotavora"; repo = "eglot"; rev = version; - sha256 = "1avsry84sp3s2vr2iz9dphm579xgw8pqlwffl75gn5akykgazwdx"; + sha256 = "0p3fry60xvh7za0p8pyz4h21nzj6df1cbl9lxdzd19rwfd35fzpp"; }; }; -- cgit 1.4.1 From b805265c7dd5e52de690c294f8b7008431be9785 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 29 Jul 2018 16:46:55 +0200 Subject: feat(pkgs): Enable hie-nix Cachix cache --- packages.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages.nix b/packages.nix index a2193fbfd1..3129b9fcae 100644 --- a/packages.nix +++ b/packages.nix @@ -53,6 +53,20 @@ in { }; }; + # Configure additional binary caches (via Cachix) + nix = { + binaryCaches = [ + # hie-nix contains the Haskell IDE Engine packaged for NixOS + "https://hie-nix.cachix.org" + ]; + + binaryCachePublicKeys = [ + "hie-nix.cachix.org-1:EjBSHzF6VmDnzqlldGXbi0RM3HdjfTU3yDRi9Pd0jTY=" + ]; + + trustedUsers = [ "root" "vincent" ]; + }; + # ... and declare packages to be installed. environment.systemPackages = with pkgs; [ # Default nixos.* packages: -- cgit 1.4.1 From a25485fad44228e0815f8361319a7c092f11d811 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 29 Jul 2018 16:56:11 +0200 Subject: refactor(emacs): Install eglot & jsonrpc from ELPA instead of Github trust++; --- emacs.nix | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/emacs.nix b/emacs.nix index 7a16897126..cef6624037 100644 --- a/emacs.nix +++ b/emacs.nix @@ -25,18 +25,26 @@ nix-mode = emacsPackagesNg.melpaBuild { ''; }; -# The default Rust language server mode is not really usable, install -# `eglot` instead and hope for the best. +jsonrpc = emacsPackagesNg.elpaBuild rec { + pname = "jsonrpc"; + version = "1.0.0"; + + src = fetchurl { + url = "https://elpa.gnu.org/packages/jsonrpc-${version}.el"; + sha256 = "06lmmn7j2ilkvwibbpgnd8p6d63fjjnxd2ma8f4jw6vrz1f7lwvs"; + }; +}; + eglot = emacsPackagesNg.melpaBuild rec { pname = "eglot"; version = "1.1"; - src = fetchFromGitHub { - owner = "joaotavora"; - repo = "eglot"; - rev = version; - sha256 = "0p3fry60xvh7za0p8pyz4h21nzj6df1cbl9lxdzd19rwfd35fzpp"; + src = fetchurl { + url = "https://elpa.gnu.org/packages/eglot-${version}.tar"; + sha256 = "01h4wh87lrd9l50y20gjjkgg760v8ixvbcb3q8jykl29989zw62y"; }; + + packageRequires = [ jsonrpc ]; }; # ivy has not been updated in unstable for a while: -- cgit 1.4.1 From a38fbb6b82b15ea0baa36b2868e7b8c4a38cae4a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 30 Jul 2018 10:04:26 +0200 Subject: chore(packages): Bump channels --- packages.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages.nix b/packages.nix index 3129b9fcae..8a5b276b97 100644 --- a/packages.nix +++ b/packages.nix @@ -10,21 +10,21 @@ let url = "https://github.com/NixOS/nixpkgs-channels/archive/${rev}.tar.gz"; }) { config.allowUnfree = true; }; - # Channels last updated: 2018-06-15 + # Channels last updated: 2018-07-29 # Instead of relying on Nix channels and ending up with out-of-sync # situations between machines, the commit for the stable Nix channel # is pinned here. stable = fetchChannel { - rev = "08d245eb31a3de0ad73719372190ce84c1bf3aee"; - sha256 = "1g22f8r3l03753s67faja1r0dq0w88723kkfagskzg9xy3qs8yw8"; + rev = "d6c6c7fcec6dbd2b8ab14f0b35d56c7733872baa"; + sha256 = "1bq59575b58lmh5w8bh7pwp17c3p2nm651bz1i3q224c4zsj9294"; }; # Certain packages from unstable are hand-picked into the package # set. unstable = fetchChannel { - rev = "4b649a99d8461c980e7028a693387dc48033c1f7"; - sha256 = "0iy2gllj457052wkp20baigb2bnal9nhyai0z9hvjr3x25ngck4y"; + rev = "dae9cf6106da19f79a39714f183ed253c62b32c5"; + sha256 = "0r3c00m96ldb9z81ay7vj8gnpk4bf8gjcdiad7mgxvwxr9ndskjx"; }; # Haskell IDE engine: -- cgit 1.4.1 From e2bafd0520afabf932aa7a3191277e0579c5c068 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 30 Jul 2018 10:05:00 +0200 Subject: feat(packages): Install extremetuxracer Why not? --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 8a5b276b97..e358b201dc 100644 --- a/packages.nix +++ b/packages.nix @@ -137,6 +137,7 @@ in { vlc xclip xfce.xfce4-screenshooter + extremetuxracer # Haskell packages: cabal-install -- cgit 1.4.1 From 43876c81dae336c6938b0c2004ebd3b592c1ac59 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 30 Jul 2018 10:05:12 +0200 Subject: feat(stallo): Enable 32-bit compatibility for audio & video --- stallo-configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stallo-configuration.nix b/stallo-configuration.nix index a9a6eb6100..e087b33898 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -7,6 +7,10 @@ # Use proprietary nvidia driver services.xserver.videoDrivers = [ "nvidia" ]; + # Enable 32-bit compatibility for Steam: + hardware.opengl.driSupport32Bit = true; + hardware.pulseaudio.support32Bit = true; + networking = { hostName = "stallo"; wireless.enable = true; -- cgit 1.4.1 From aa9d8b2618e4cca6e7b16609ccd0c6c5716c8d59 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 30 Jul 2018 10:05:33 +0200 Subject: fix(packages): Remove Cachix cache for hie-nix --- packages.nix | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/packages.nix b/packages.nix index e358b201dc..8987379a34 100644 --- a/packages.nix +++ b/packages.nix @@ -53,20 +53,6 @@ in { }; }; - # Configure additional binary caches (via Cachix) - nix = { - binaryCaches = [ - # hie-nix contains the Haskell IDE Engine packaged for NixOS - "https://hie-nix.cachix.org" - ]; - - binaryCachePublicKeys = [ - "hie-nix.cachix.org-1:EjBSHzF6VmDnzqlldGXbi0RM3HdjfTU3yDRi9Pd0jTY=" - ]; - - trustedUsers = [ "root" "vincent" ]; - }; - # ... and declare packages to be installed. environment.systemPackages = with pkgs; [ # Default nixos.* packages: -- cgit 1.4.1 From 04ccc713e430def0997168c7042dfd05cdf1fe47 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 5 Aug 2018 16:05:43 +0200 Subject: feat(stallo): Install wine-staging & winetricks --- stallo-configuration.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stallo-configuration.nix b/stallo-configuration.nix index e087b33898..bbcfc140d3 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -1,5 +1,5 @@ # Local configuration for 'stallo' (Home desktop PC) -{ config, ...}: +{ config, pkgs, ...}: { boot.initrd.luks.devices.stallo-luks.device = "/dev/disk/by-uuid/b484cf1e-a27b-4785-8bd6-fa85a004b073"; @@ -11,6 +11,9 @@ hardware.opengl.driSupport32Bit = true; hardware.pulseaudio.support32Bit = true; + # Wine for Blizzard stuff + environment.systemPackages = with pkgs.unstable; [ wineStaging winetricks ]; + networking = { hostName = "stallo"; wireless.enable = true; -- cgit 1.4.1 From 178558cea0eb6f7d0648d44fabdda6a540d4ea05 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 5 Aug 2018 16:06:14 +0200 Subject: chore(packages): Remove 'hie' for now --- packages.nix | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages.nix b/packages.nix index 8987379a34..85733bd49b 100644 --- a/packages.nix +++ b/packages.nix @@ -26,13 +26,6 @@ let rev = "dae9cf6106da19f79a39714f183ed253c62b32c5"; sha256 = "0r3c00m96ldb9z81ay7vj8gnpk4bf8gjcdiad7mgxvwxr9ndskjx"; }; - - # Haskell IDE engine: - hieCommit = "8f04568aa8c3215f543250eb7a1acfa0cf2d24ed"; - hie = import (fetchTarball { - url = "https://github.com/domenkozar/hie-nix/archive/${hieCommit}.tar.gz"; - sha256 = "06ygnywfnp6da0mcy4hq0xcvaaap1w3di2midv1w9b9miam8hdrn"; - }) {}; in { # Configure the Nix package manager nixpkgs = { @@ -80,6 +73,7 @@ in { iftop # Upstream link is down: # jetbrains.idea-ultimate + extremetuxracer jq kontemplate kubernetes @@ -87,8 +81,8 @@ in { lxappearance-gtk3 manpages maven - msmtp mq-cli + msmtp ngrok notmuch numix-cursor-theme @@ -123,12 +117,10 @@ in { vlc xclip xfce.xfce4-screenshooter - extremetuxracer # Haskell packages: cabal-install ghc - hie.hie82 hlint stack stack2nix -- cgit 1.4.1 From 1f3835d60cdea042094404cac5f299152f681da2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 5 Aug 2018 16:13:22 +0200 Subject: chore(emacs): Override EXWM version with potential bug fix Overrides the EXWM version from the latest released one to a current commit in master that may constitute a fix for ch11ng/exwm#425 --- emacs.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/emacs.nix b/emacs.nix index cef6624037..365bfc707a 100644 --- a/emacs.nix +++ b/emacs.nix @@ -153,6 +153,19 @@ sly = emacsPackagesNg.melpaBuild { ''; }; +# EXWM pinned to a newer version than what is released due to a +# potential fix for ch11ng/exwm#425. +exwm = emacsPackagesNg.exwm.overrideAttrs(_: { + version = "master"; + + src = fetchFromGitHub { + owner = "ch11ng"; + repo = "exwm"; + rev = "aebcb0344f18b1aa284a432811175fde2d2feae5"; + sha256 = "0niwbzim029lg71y5rrg607zfiw1zmhk7zcyk5874gbrkfmyr52b"; + }; +}); + in emacsWithPackages(epkgs: # Actual ELPA packages (the enlightened!) (with epkgs.elpaPackages; [ @@ -177,7 +190,6 @@ in emacsWithPackages(epkgs: edit-server elixir-mode erlang - exwm go-mode gruber-darker-theme haskell-mode @@ -215,5 +227,5 @@ in emacsWithPackages(epkgs: (lib.attrValues newIvy) ++ # Custom packaged Emacs packages: - [ nix-mode eglot prescient ivy-prescient counsel-notmuch pkgs.notmuch sly ] + [ nix-mode eglot prescient ivy-prescient counsel-notmuch pkgs.notmuch sly exwm ] ) -- cgit 1.4.1 From a7e9c48d11ecfeaba97f9732e788834e3acbba24 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 10 Aug 2018 22:16:34 +0200 Subject: feat(emacs): Install intero again --- emacs.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/emacs.nix b/emacs.nix index 365bfc707a..310b61078b 100644 --- a/emacs.nix +++ b/emacs.nix @@ -1,6 +1,5 @@ # Derivation for Emacs pre-configured with packages that I need. -# -# * TODO 2018-06-15: sly removed due to build error in unstable + { pkgs }: with pkgs.unstable; with emacsPackagesNg; @@ -223,6 +222,11 @@ in emacsWithPackages(epkgs: yaml-mode ]) ++ + # Stable packages + (with epkgs.melpaStablePackages; [ + intero + ]) ++ + # Use custom updated ivy packages (lib.attrValues newIvy) ++ -- cgit 1.4.1 From ac88fee3705687ba9c84ef2ee8d4e891b2192e0f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 10 Aug 2018 22:16:46 +0200 Subject: chore(desktop): Remove unused keyboard layout --- desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop.nix b/desktop.nix index 5f9746bf7c..56027e4397 100644 --- a/desktop.nix +++ b/desktop.nix @@ -10,7 +10,7 @@ in { # Configure basic X-server stuff: services.xserver = { enable = true; - layout = "us,no,ru"; + layout = "us,no"; xkbOptions = "caps:super, grp:shifts_toggle, parens:swap_brackets"; exportConfiguration = true; -- cgit 1.4.1 From 45e3207658645926aaf1811cae583bd0568f8dea Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 10 Aug 2018 22:16:57 +0200 Subject: feat(adho): Add Yubikey PIV related tools --- adho-configuration.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 7a4efc1499..12b858086f 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -13,6 +13,15 @@ services.avahi.enable = true; services.avahi.nssmdns = true; + # Yubikey related: + services.pcscd.enable = true; + environment.systemPackages = with pkgs; [ + cfssl + libp11 + opensc + yubico-piv-tool + ]; + networking = { hostName = "adho"; wireless.enable = true; -- cgit 1.4.1 From c32445da81141f611e568d82d908c62ef2d940cc Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 10 Aug 2018 00:02:45 +0200 Subject: chore(stallo): Use wine with 64-bit support --- stallo-configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stallo-configuration.nix b/stallo-configuration.nix index bbcfc140d3..21f89fb180 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -12,7 +12,7 @@ hardware.pulseaudio.support32Bit = true; # Wine for Blizzard stuff - environment.systemPackages = with pkgs.unstable; [ wineStaging winetricks ]; + environment.systemPackages = with pkgs.unstable; [ wineWowPackages.staging winetricks ]; networking = { hostName = "stallo"; -- cgit 1.4.1 From b64dd00fe3cc80ecca57fa19359a23cb5a960391 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 17 Aug 2018 10:20:45 +0200 Subject: chore(emacs): Add another potential fix for EXWM issue Pulls in the changes from @medranocalvo's ch11ng/exwm#469 pull request, which could be a potential fix for ch11ng/exwm#425. --- emacs.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/emacs.nix b/emacs.nix index 310b61078b..6146c2775c 100644 --- a/emacs.nix +++ b/emacs.nix @@ -157,11 +157,13 @@ sly = emacsPackagesNg.melpaBuild { exwm = emacsPackagesNg.exwm.overrideAttrs(_: { version = "master"; + # This is not the original upstream repo, see PR: + # https://github.com/ch11ng/exwm/pull/469/ src = fetchFromGitHub { - owner = "ch11ng"; + owner = "medranocalvo"; repo = "exwm"; - rev = "aebcb0344f18b1aa284a432811175fde2d2feae5"; - sha256 = "0niwbzim029lg71y5rrg607zfiw1zmhk7zcyk5874gbrkfmyr52b"; + rev = "4c67a459c9f3d929e04a6b6ade452b203171e35b"; + sha256 = "0ia977m3wjkiccslbb3xf0m0bjmhys4c37j1prldi0rizrsf18r9"; }; }); -- cgit 1.4.1 From 2c9a4b8816da9732be04f2e804ac5a36f9ed193f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 26 Aug 2018 22:30:10 +0200 Subject: chore(stallo): Add 2.4Ghz network as fallback Apparently the wifi card likes to act up occasionally (this is new?) and can't see the 5Ghz network anymore. This adds the 2.4Ghz network as a fallback in those cases. --- stallo-configuration.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stallo-configuration.nix b/stallo-configuration.nix index 21f89fb180..4af4a5fd4c 100644 --- a/stallo-configuration.nix +++ b/stallo-configuration.nix @@ -18,8 +18,15 @@ hostName = "stallo"; wireless.enable = true; wireless.networks = { + # Welcome to roast club! + "How do I computer fast?" = { - # Welcome to roast club! + psk = "washyourface"; + # Prefer 5Ghz unless the card is acting up. + priority = 10; + }; + + "How do I computer?" = { psk = "washyourface"; }; }; -- cgit 1.4.1 From 614375c7b10f55b095080d005bec40ef317f6d9a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 2 Sep 2018 15:13:27 +0200 Subject: feat(adho): Run haveged daemon --- adho-configuration.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 12b858086f..0a26212cf0 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -13,6 +13,9 @@ services.avahi.enable = true; services.avahi.nssmdns = true; + # Give me more entropy: + services.haveged.enable = true; + # Yubikey related: services.pcscd.enable = true; environment.systemPackages = with pkgs; [ -- cgit 1.4.1 From 1515020dd4e1485d088ad00b676762889ea78e2d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 2 Sep 2018 15:13:43 +0200 Subject: feat(adho): Add additional wifi networks --- adho-configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 0a26212cf0..9871732603 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -131,6 +131,10 @@ "WIFIonICE" = {}; "Lorry Gjest" = {}; "Amundsengjest" = {}; + "Beer Palace Gjest" = {}; + "KabelBox-2FD0" = { + psk = "92433048597489095671"; + }; }; }; -- cgit 1.4.1 From 63c08b923fd6d3ce9e65265a843a663a3ff91ada Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 2 Sep 2018 15:21:23 +0200 Subject: chore(emacs): Bump EXWM version Includes changes from ch11ng/exwm#477 which may resolve issues with ch11ng/exwm#425. --- emacs.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/emacs.nix b/emacs.nix index 6146c2775c..4d99949234 100644 --- a/emacs.nix +++ b/emacs.nix @@ -157,13 +157,11 @@ sly = emacsPackagesNg.melpaBuild { exwm = emacsPackagesNg.exwm.overrideAttrs(_: { version = "master"; - # This is not the original upstream repo, see PR: - # https://github.com/ch11ng/exwm/pull/469/ src = fetchFromGitHub { - owner = "medranocalvo"; + owner = "ch11ng"; repo = "exwm"; - rev = "4c67a459c9f3d929e04a6b6ade452b203171e35b"; - sha256 = "0ia977m3wjkiccslbb3xf0m0bjmhys4c37j1prldi0rizrsf18r9"; + rev = "dd57c5eebb213c29c3b250634e316abf4917a19b"; + sha256 = "0y2fb87pcj3rb56i8pmlz0422pl1d6prx25p707v0ihkjvhnr6y0"; }; }); -- cgit 1.4.1 From 754b487ee4dfa0cbf3cb3c9a680d4b0675692d4e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 16 Sep 2018 16:51:20 +0200 Subject: feat(adho): Add Dublin wifi networks --- adho-configuration.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 9871732603..c0bf2f6258 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -98,6 +98,11 @@ psk = "DQDxzrzIvy0YtDwH"; }; + # Loke's + "VMC28F76E" = { + psk = "d2ftQnr6xppw"; + }; + "SafetyWiFi - Teknologihuset" = { psk = "tech4ever"; }; @@ -120,6 +125,10 @@ psk = "r0verstaden2018"; }; + "The Brew Dock" = { + psk = "realbeer"; + }; + "Norwegian Internet Access" = {}; "NSB_INTERAKTIV" = {}; "The Thief" = {}; -- cgit 1.4.1 From 8d918e48eb1975a7fb477bac7ec7d4a06df6d3c9 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 16 Sep 2018 16:52:16 +0200 Subject: refactor(desktop): Don't launch EXWM via Emacs client Launch EXWM directly in Emacs, instead of first launching an Emacs server and connecting a client. In cases where Emacs does not start correctly due to initialisation errors the error message would never become visible without this change. --- desktop.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/desktop.nix b/desktop.nix index 56027e4397..61d2482c44 100644 --- a/desktop.nix +++ b/desktop.nix @@ -29,8 +29,7 @@ in { services.xserver.windowManager.session = lib.singleton { name = "exwm"; start = '' - ${emacs}/bin/emacs --daemon -f exwm-enable - ${emacs}/bin/emacsclient -c + ${emacs}/bin/emacs --eval '(progn (server-start) (exwm-enable))' ''; }; -- cgit 1.4.1 From b19b1590e5cf19cae1f3d0511eb24344a1313d09 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 19 Sep 2018 22:59:42 +0200 Subject: chore(emacs): Bump EXWM & XELB to most recent development versions --- emacs.nix | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/emacs.nix b/emacs.nix index 4d99949234..3dad08b24d 100644 --- a/emacs.nix +++ b/emacs.nix @@ -152,18 +152,39 @@ sly = emacsPackagesNg.melpaBuild { ''; }; +# As the EXWM-README points out, XELB should be built from source if +# EXWM is. +xelb = melpaBuild { + pname = "xelb"; + ename = "xelb"; + version = "0.15"; + + packageRequires = [ cl-generic emacs ]; + + src = fetchFromGitHub { + owner = "ch11ng"; + repo = "xelb"; + rev = "b8f168b401977098fe2b30f4ca32629c0ab6eb83"; + sha256 = "1ack1h68x8ia0ji6wbhmayrakq35p5sgrrl6qvha3ns3pswc0pl9"; + }; +}; + # EXWM pinned to a newer version than what is released due to a # potential fix for ch11ng/exwm#425. -exwm = emacsPackagesNg.exwm.overrideAttrs(_: { - version = "master"; +exwm = melpaBuild { + pname = "exwm"; + ename = "exwm"; + version = "0.19"; + + packageRequires = [ xelb ]; src = fetchFromGitHub { owner = "ch11ng"; repo = "exwm"; - rev = "dd57c5eebb213c29c3b250634e316abf4917a19b"; - sha256 = "0y2fb87pcj3rb56i8pmlz0422pl1d6prx25p707v0ihkjvhnr6y0"; + rev = "472f7cb82b67b98843f10c12e6bda9b8ae7262bc"; + sha256 = "19gflsrb19aijf2xcw7j2m658qad21nbwziw38s1h2jw66vhk8dj"; }; -}); +}; in emacsWithPackages(epkgs: # Actual ELPA packages (the enlightened!) -- cgit 1.4.1 From 67d016029cb5ceed8671c1d1f13dd84209256bb0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Oct 2018 11:19:54 +0200 Subject: chore: Disable Redis service on all machines --- configuration.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 7295d80933..e4a9574292 100644 --- a/configuration.nix +++ b/configuration.nix @@ -79,7 +79,6 @@ }; services.postgresql.enable = true; - services.redis.enable = true; # Configure user account users.defaultUserShell = pkgs.fish; -- cgit 1.4.1 From dc1674f2a12d3d5faba4a45b6fb605bf33fa0948 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Oct 2018 11:20:07 +0200 Subject: feat(adho): Add Homan Bistro wifi --- adho-configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index c0bf2f6258..499dd07f9c 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -120,6 +120,10 @@ psk = "guest7890"; }; + "Homan-Gjest" = { + psk = "haveaniceday"; + }; + # Røverstaden "Roverstaden" = { psk = "r0verstaden2018"; -- cgit 1.4.1 From 78ae29aac4a55d3ac6cf8e200035ce9ba4347985 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Oct 2018 11:20:22 +0200 Subject: feat(pkgs): Bump channels to latest This moves to NixOS 18.09. --- packages.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages.nix b/packages.nix index 85733bd49b..191ceb8361 100644 --- a/packages.nix +++ b/packages.nix @@ -10,21 +10,21 @@ let url = "https://github.com/NixOS/nixpkgs-channels/archive/${rev}.tar.gz"; }) { config.allowUnfree = true; }; - # Channels last updated: 2018-07-29 - + # Channels last updated: 2018-10-10 + # # Instead of relying on Nix channels and ending up with out-of-sync # situations between machines, the commit for the stable Nix channel # is pinned here. stable = fetchChannel { - rev = "d6c6c7fcec6dbd2b8ab14f0b35d56c7733872baa"; - sha256 = "1bq59575b58lmh5w8bh7pwp17c3p2nm651bz1i3q224c4zsj9294"; + rev = "59fe4c7f17a8efd9fe182bb23f47554d4b1d98c2"; + sha256 = "1g72vxax29s0yyknficbwwwrk4h7z8cm6vaxyh5524cljhcdq246"; }; # Certain packages from unstable are hand-picked into the package # set. unstable = fetchChannel { - rev = "dae9cf6106da19f79a39714f183ed253c62b32c5"; - sha256 = "0r3c00m96ldb9z81ay7vj8gnpk4bf8gjcdiad7mgxvwxr9ndskjx"; + rev = "0a7e258012b60cbe530a756f09a4f2516786d370"; + sha256 = "1g72vxax29s0yyknficbwwwrk4h7z8cm6vaxyh5524cljhcdq246"; }; in { # Configure the Nix package manager @@ -39,10 +39,6 @@ in { wallpapers = import ./pkgs/wallpapers.nix; pulseaudio-ctl = import pkgs/pulseaudio-ctl.nix; - - kontemplate = unstable.kontemplate; - mq-cli = unstable.mq-cli; - vlc = unstable.vlc; # VLC 3.0! }; }; -- cgit 1.4.1 From d3058c0d0bcacc60a70b0af544e04961f7643ed2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Oct 2018 11:20:40 +0200 Subject: fix(pkgs): Remove manually installed cargo This conflicts with the rustup binary otherwise. --- packages.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/packages.nix b/packages.nix index 191ceb8361..6a0d99edc5 100644 --- a/packages.nix +++ b/packages.nix @@ -47,7 +47,6 @@ in { # Default nixos.* packages: alacritty binutils-unwrapped - cargo curl direnv dnsutils -- cgit 1.4.1 From c7e60c1de482f62712789ba26a08b668a4562c3a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Oct 2018 11:21:15 +0200 Subject: chore(emacs): Remove manually upgraded packages that are in 18.09 Removes a whole bunch of manually pinned packages that were moved into stable in 18.09. However, it should be noted that `sly` is again broken in stable. --- emacs.nix | 183 +++++++++----------------------------------------------------- 1 file changed, 25 insertions(+), 158 deletions(-) diff --git a/emacs.nix b/emacs.nix index 3dad08b24d..913f8de7ed 100644 --- a/emacs.nix +++ b/emacs.nix @@ -1,163 +1,22 @@ # Derivation for Emacs pre-configured with packages that I need. +# +# TODO: Fix sly (again) { pkgs }: -with pkgs.unstable; with emacsPackagesNg; +with pkgs; with emacsPackagesNg; let emacsWithPackages = (emacsPackagesNgGen emacs).emacsWithPackages; -# The nix-mode in the official repositories is old and annoying to -# work with, pin it to something newer instead: -nix-mode = emacsPackagesNg.melpaBuild { - pname = "nix-mode"; - version = "20180306"; - - src = fetchFromGitHub { - owner = "NixOS"; - repo = "nix-mode"; - rev = "0ac0271f6c8acdbfddfdbb1211a1972ae562ec17"; - sha256 = "157vy4xkvaqd76km47sh41wykbjmfrzvg40jxgppnalq9pjxfinp"; - }; - - recipeFile = writeText "nix-mode-recipe" '' - (nix-mode :repo "NixOS/nix-mode" :fetcher github - :files (:defaults (:exclude "nix-mode-mmm.el"))) - ''; -}; - -jsonrpc = emacsPackagesNg.elpaBuild rec { - pname = "jsonrpc"; - version = "1.0.0"; - - src = fetchurl { - url = "https://elpa.gnu.org/packages/jsonrpc-${version}.el"; - sha256 = "06lmmn7j2ilkvwibbpgnd8p6d63fjjnxd2ma8f4jw6vrz1f7lwvs"; - }; -}; - -eglot = emacsPackagesNg.melpaBuild rec { - pname = "eglot"; - version = "1.1"; - - src = fetchurl { - url = "https://elpa.gnu.org/packages/eglot-${version}.tar"; - sha256 = "01h4wh87lrd9l50y20gjjkgg760v8ixvbcb3q8jykl29989zw62y"; - }; - - packageRequires = [ jsonrpc ]; -}; - -# ivy has not been updated in unstable for a while: -ivySource = fetchFromGitHub { - owner = "abo-abo"; - repo = "swiper"; - rev = "6f2939485d33e9b28022d3b6912a50669dcdd596"; - sha256 = "1f2i6hkcbiqdw7fr9vabsm32a0gy647llzki6b97yv8vwa0klh2q"; -}; - -withIvySources = pname: recipe: emacsPackagesNg.melpaBuild { - inherit pname; - version = "20180616"; - recipeFile = builtins.toFile "${pname}-recipe" recipe; - src = ivySource; -}; - -newIvy.ivy = withIvySources "ivy" '' -(ivy :files (:defaults - (:exclude "swiper.el" "counsel.el" "ivy-hydra.el") - "doc/ivy-help.org")) -''; - -newIvy.counsel = withIvySources "counsel" '' -(counsel :files ("counsel.el")) -''; - -newIvy.swiper = withIvySources "swiper" '' -(swiper :files ("swiper.el")) -''; - -newIvy.ivy-pass = melpaBuild { - pname = "ivy-pass"; - version = "20170812"; - src = fetchFromGitHub { - owner = "ecraven"; - repo = "ivy-pass"; - rev = "5b523de1151f2109fdd6a8114d0af12eef83d3c5"; - sha256 = "18crb4zh2pjf0cmv3b913m9vfng27girjwfqc3mk7vqd1r5a49yk"; - }; -}; - -counsel-notmuch = melpaBuild { - pname = "counsel-notmuch"; - version = "20171223"; - - packageRequires = [ - newIvy.ivy - pkgs.notmuch - ]; - - src = fetchFromGitHub { - owner = "fuxialexander"; - repo = "counsel-notmuch"; - rev = "ac1aaead81c6860d7b8324cc1c00bcd52de5e9ca"; - sha256 = "19frcrz6bx7d7v1hkg0xv7zmbk2sydlsdzn1s96cqzjk1illchkz"; - }; -}; - -# prescient & ivy-prescient provide better filtering in ivy/counsel, -# but they are not in nixpkgs yet: -prescientSource = fetchFromGitHub { - owner = "raxod502"; - repo = "prescient.el"; - rev = "27c94636489d5b062970a0f7e9041ca186b6b659"; - sha256 = "05jk8cms48dhpbaimmx3akmnq32fgbc0q4dja7lvpvssmq398cn7"; -}; - -prescient = emacsPackagesNg.melpaBuild { - pname = "prescient"; - version = "1.0"; - src = prescientSource; - - recipeFile = writeText "prescient-recipe" '' - (prescient :files ("prescient.el")) - ''; -}; - -ivy-prescient = emacsPackagesNg.melpaBuild { - pname = "ivy-prescient"; - version = "1.0"; - src = prescientSource; - packageRequires = [ prescient newIvy.ivy ]; - - recipeFile = writeText "ivy-prescient-recipe" '' - (ivy-prescient :files ("ivy-prescient.el")) - ''; -}; - -sly = emacsPackagesNg.melpaBuild { - pname = "sly"; - version = "20180613"; - packageRequires = [ elpaPackages.company ]; - - src = fetchFromGitHub { - owner = "joaotavora"; - repo = "sly"; - rev = "a05b45f1564a86a9d49707c9c570da6c3a56b6e5"; - sha256 = "1c9xzppxlnak1px0dv0ljpp4izfj4377lncvrcb1jaiyh8z8ry48"; - }; - - recipeFile = writeText "sly-recipe" '' - (sly :files ("*.el" - ("lib" "lib/*") - ("contrib" "contrib/*"))) - ''; -}; - # As the EXWM-README points out, XELB should be built from source if # EXWM is. xelb = melpaBuild { pname = "xelb"; ename = "xelb"; version = "0.15"; + recipe = builtins.toFile "recipe" '' + (xelb :fetcher github + :repo "ch11ng/xelb") + ''; packageRequires = [ cl-generic emacs ]; @@ -175,6 +34,10 @@ exwm = melpaBuild { pname = "exwm"; ename = "exwm"; version = "0.19"; + recipe = builtins.toFile "recipe" '' + (exwm :fetcher github + :repo "ch11ng/exwm") + ''; packageRequires = [ xelb ]; @@ -201,21 +64,28 @@ in emacsWithPackages(epkgs: # MELPA packages: (with epkgs.melpaPackages; [ - alchemist browse-kill-ring cargo + counsel + counsel-notmuch dash dash-functional dockerfile-mode edit-server + eglot elixir-mode erlang + exwm go-mode gruber-darker-theme haskell-mode ht hydra idle-highlight-mode + intero + ivy + ivy-pass + ivy-prescient jq-mode kotlin-mode magit @@ -224,15 +94,20 @@ in emacsWithPackages(epkgs: multi-term multiple-cursors nginx-mode + nix-mode paredit password-store pg + pkgs.notmuch + prescient rainbow-delimiters restclient rust-mode s + # sly smartparens string-edit + swiper telephone-line terraform-mode toml-mode @@ -243,14 +118,6 @@ in emacsWithPackages(epkgs: yaml-mode ]) ++ - # Stable packages - (with epkgs.melpaStablePackages; [ - intero - ]) ++ - - # Use custom updated ivy packages - (lib.attrValues newIvy) ++ - # Custom packaged Emacs packages: - [ nix-mode eglot prescient ivy-prescient counsel-notmuch pkgs.notmuch sly exwm ] + [ xelb exwm ] ) -- cgit 1.4.1 From 12ce5085087c16e9c64ab9cb8e3b1bb3f6c7bc35 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Oct 2018 12:54:59 +0200 Subject: chore(adho): Enable kvm-intel kernel module Suggested by nixos-generate-config. --- adho-configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 499dd07f9c..ca3ea6dd43 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -3,6 +3,8 @@ { boot.initrd.luks.devices.adho.device = "/dev/disk/by-uuid/722006b0-9654-4ea1-8703-e0cf9ac1905e"; + boot.kernelModules = [ "kvm-intel" ]; + services.xserver.libinput.enable = true; services.xserver.videoDrivers = [ "intel" ]; programs.light.enable = true; -- cgit 1.4.1 From cd10aa4754a7fb00bd9be39684da84a487eba06c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Oct 2018 12:55:12 +0200 Subject: feat(pkgs): Install chromium --- packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.nix b/packages.nix index 6a0d99edc5..c6e28492fa 100644 --- a/packages.nix +++ b/packages.nix @@ -47,6 +47,7 @@ in { # Default nixos.* packages: alacritty binutils-unwrapped + chromium curl direnv dnsutils -- cgit 1.4.1 From ff1f5271f4e16a51ec8cd7d66c57bc096fc3d214 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Oct 2018 12:55:28 +0200 Subject: chore(dotfiles): Update Alacritty configuration for new version --- dotfiles/alacritty.yml | 89 +++++++------------------------------------------- 1 file changed, 12 insertions(+), 77 deletions(-) diff --git a/dotfiles/alacritty.yml b/dotfiles/alacritty.yml index 3135bf55ad..eac401a59d 100644 --- a/dotfiles/alacritty.yml +++ b/dotfiles/alacritty.yml @@ -1,37 +1,20 @@ # Configuration for Alacritty, the GPU enhanced terminal emulator - # Any items in the `env` entry below will be added as # environment variables. Some entries may override variables # set by alacritty it self. env: - # TERM env customization. - # - # If this property is not set, alacritty will set it to xterm-256color. - # - # Note that some xterm terminfo databases don't declare support for italics. - # You can verify this by checking for the presence of `smso` and `sitm` in - # `infocmp xterm-256color`. TERM: xterm-256color -# Window dimensions in character columns and lines -# (changes require restart) -dimensions: - columns: 80 - lines: 24 - -# Adds this many blank pixels of padding around the window -# Units are physical pixels; this is not DPI aware. -# (change requires restart) -padding: - x: 2 - y: 2 +window: + # TODO + decorations: full -# The FreeType rasterizer needs to know the device DPI for best results -# (changes require restart) -dpi: - x: 96.0 - y: 96.0 +scrolling: + history: 10000 + multiplier: 3 + faux_multiplier: 3 + auto_scroll: true # TODO # Display tabs using this many cells (changes require restart) tabspaces: 4 @@ -52,32 +35,14 @@ font: # Point size of the font size: 12.0 - # Offset is the extra space around each character. offset.y can be thought of - # as modifying the linespacing, and offset.x as modifying the letter spacing. - offset: - x: 0.0 - y: 0.0 - - # Glyph offset determines the locations of the glyphs within their cells with - # the default being at the bottom. Increase the x offset to move the glyph to - # the right, increase the y offset to move the glyph upward. - glyph_offset: - x: 0.0 - y: 0.0 - - # OS X only: use thin stroke font rendering. Thin strokes are suitable - # for retina displays, but for non-retina you probably want this set to - # false. - use_thin_strokes: true - -# Should display the render timer -render_timer: false + # Scale the font size based on the monitor's DPI. + scale_with_dpi: false # Use custom cursor colors. If true, display the cursor in the cursor.foreground # and cursor.background colors, otherwise invert the colors of the cursor. custom_cursor_colors: false -# Colors (Tomorrow Night Bright) +# Colors (Gruber Darker) colors: # Default colors primary: @@ -111,35 +76,7 @@ colors: cyan: '0x1fad83' white: '0xffffff' -# Visual Bell -# -# Any time the BEL code is received, Alacritty "rings" the visual bell. Once -# rung, the terminal background will be set to white and transition back to the -# default background color. You can control the rate of this transition by -# setting the `duration` property (represented in milliseconds). You can also -# configure the transition function by setting the `animation` property. -# -# Possible values for `animation` -# `Ease` -# `EaseOut` -# `EaseOutSine` -# `EaseOutQuad` -# `EaseOutCubic` -# `EaseOutQuart` -# `EaseOutQuint` -# `EaseOutExpo` -# `EaseOutCirc` -# `Linear` -# -# To completely disable the visual bell, set its duration to 0. -# -visual_bell: - animation: EaseOutExpo - duration: 0 - # Background opacity -background_opacity: 0.95 - # Key bindings # # Each binding is defined as an object with some properties. Most of the @@ -254,11 +191,9 @@ mouse: selection: semantic_escape_chars: ",│`|:\"' ()[]{}<>" +background_opacity: 1.0 hide_cursor_when_typing: false # Live config reload (changes require restart) live_config_reload: true - -shell: - program: tmux -- cgit 1.4.1 From ab65fb2371a1140dd6bde542148c8556be37913c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Oct 2018 13:34:07 +0200 Subject: fix(adho): Disable Nix sandbox on adho Sandboxing was enabled by default in NixOS 18.09, but it breaks some of the less-than-clean work build setups. --- adho-configuration.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index ca3ea6dd43..5b9290a179 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -18,6 +18,9 @@ # Give me more entropy: services.haveged.enable = true; + # Disable sandbox to let work-builds function: + nix.useSandbox = false; + # Yubikey related: services.pcscd.enable = true; environment.systemPackages = with pkgs; [ -- cgit 1.4.1 From 0dd84abd4479f04961105d5cc8309e70109be3d2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 14 Oct 2018 15:47:43 +0200 Subject: fix(dotfiles): Disable Alacritty's visual bell It's v e r y annoying. --- dotfiles/alacritty.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dotfiles/alacritty.yml b/dotfiles/alacritty.yml index eac401a59d..d229fbdde6 100644 --- a/dotfiles/alacritty.yml +++ b/dotfiles/alacritty.yml @@ -197,3 +197,7 @@ hide_cursor_when_typing: false # Live config reload (changes require restart) live_config_reload: true + +# Disable visual bell +visual_bell: + duration: 0 -- cgit 1.4.1 From c423b264ea016946c62530064d60cde4b75cd193 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 14 Oct 2018 16:20:07 +0200 Subject: chore(pkgs): Bump channel versions --- packages.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages.nix b/packages.nix index c6e28492fa..e0c3e57677 100644 --- a/packages.nix +++ b/packages.nix @@ -16,15 +16,15 @@ let # situations between machines, the commit for the stable Nix channel # is pinned here. stable = fetchChannel { - rev = "59fe4c7f17a8efd9fe182bb23f47554d4b1d98c2"; - sha256 = "1g72vxax29s0yyknficbwwwrk4h7z8cm6vaxyh5524cljhcdq246"; + rev = "d96c7a356383302db4426a0d5a8383af921d964f"; + sha256 = "0hlhczh3m077rwrhp4smf3zd2sfj38h2c126bycv66m0aff0gycn"; }; # Certain packages from unstable are hand-picked into the package # set. unstable = fetchChannel { - rev = "0a7e258012b60cbe530a756f09a4f2516786d370"; - sha256 = "1g72vxax29s0yyknficbwwwrk4h7z8cm6vaxyh5524cljhcdq246"; + rev = "32bcd72bf28a971c9063a9cdcc32effe49f49331"; + sha256 = "1f74m18r6xl9s55jbkj9bjhdxg2489kwjam4d96pf9rzq0i1f8li"; }; in { # Configure the Nix package manager -- cgit 1.4.1 From 68e8692f03a1b2e60958e982d33452964179f5ef Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 14 Oct 2018 16:20:15 +0200 Subject: fix(pkgs): Backport exa from unstable channel --- packages.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages.nix b/packages.nix index e0c3e57677..d25e563121 100644 --- a/packages.nix +++ b/packages.nix @@ -37,6 +37,12 @@ in { # it (see emacs.nix for example): inherit unstable; + # Backport Exa from unstable until a fix for the Rust builder is + # backported. + # + # https://github.com/NixOS/nixpkgs/pull/48020 + exa = unstable.exa; + wallpapers = import ./pkgs/wallpapers.nix; pulseaudio-ctl = import pkgs/pulseaudio-ctl.nix; }; @@ -53,6 +59,7 @@ in { dnsutils evince exa + extremetuxracer fd file firefox-unwrapped @@ -63,13 +70,10 @@ in { gnupg google-cloud-sdk gopass - htop hicolor-icon-theme + htop i3lock iftop - # Upstream link is down: - # jetbrains.idea-ultimate - extremetuxracer jq kontemplate kubernetes -- cgit 1.4.1 From 3ec17661bd0824daa56beb4057bcf704c05b7751 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 14 Oct 2018 16:20:28 +0200 Subject: feat(emacs): Install meghanada-mode --- emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.nix b/emacs.nix index 913f8de7ed..fdb82be318 100644 --- a/emacs.nix +++ b/emacs.nix @@ -91,6 +91,7 @@ in emacsWithPackages(epkgs: magit markdown-mode markdown-toc + meghanada multi-term multiple-cursors nginx-mode -- cgit 1.4.1 From 0e8f4832edfd8c7497e150b23f5679bdf9834da1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 25 Oct 2018 11:25:09 +0200 Subject: feat(adho): Add various wifi networks (NixCon etc.) --- adho-configuration.nix | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index 5b9290a179..56fd1753ed 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -89,11 +89,6 @@ psk = "elmolino021"; }; - # Sync Compound - "RWDS" = { - psk = "radicalagenda"; - }; - "BrewDog" = { psk = "welovebeer"; }; @@ -138,6 +133,20 @@ psk = "realbeer"; }; + "econ-guest" = { + psk = "Finance2010"; + }; + + "KabelBox-2FD0" = { + psk = "92433048597489095671"; + }; + + # NixCon 2018 + "Coin Street Community Builders " = { + psk = "3vents2016"; + }; + + "mycloud" = {}; "Norwegian Internet Access" = {}; "NSB_INTERAKTIV" = {}; "The Thief" = {}; @@ -150,9 +159,7 @@ "Lorry Gjest" = {}; "Amundsengjest" = {}; "Beer Palace Gjest" = {}; - "KabelBox-2FD0" = { - psk = "92433048597489095671"; - }; + "ibis" = {}; }; }; -- cgit 1.4.1 From 909c7bdf219609849c348deb1e55220125d1daf7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 25 Oct 2018 11:25:29 +0200 Subject: feat(pkgs): Install omnisharp and friends --- emacs.nix | 1 + packages.nix | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/emacs.nix b/emacs.nix index fdb82be318..307aeb46f2 100644 --- a/emacs.nix +++ b/emacs.nix @@ -96,6 +96,7 @@ in emacsWithPackages(epkgs: multiple-cursors nginx-mode nix-mode + omnisharp paredit password-store pg diff --git a/packages.nix b/packages.nix index d25e563121..d2e4bab888 100644 --- a/packages.nix +++ b/packages.nix @@ -57,6 +57,7 @@ in { curl direnv dnsutils + dotnet-sdk evince exa extremetuxracer @@ -81,6 +82,7 @@ in { lxappearance-gtk3 manpages maven + mono mq-cli msmtp ngrok @@ -115,6 +117,8 @@ in { units unzip vlc + wine + winetricks xclip xfce.xfce4-screenshooter -- cgit 1.4.1 From 32fa661a27d5162021289bb14c7f5a8e1f387517 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 28 Oct 2018 23:40:20 +0100 Subject: feat(adho): Add Gatwick wifi network --- adho-configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 56fd1753ed..006e9cacd3 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -146,6 +146,7 @@ psk = "3vents2016"; }; + "Gatwick FREE Wi-Fi" = {}; "mycloud" = {}; "Norwegian Internet Access" = {}; "NSB_INTERAKTIV" = {}; -- cgit 1.4.1 From 53d3cd62a81188a9e7399c7f0a991a1af37fca77 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 3 Nov 2018 17:35:31 +0100 Subject: fix(desktop): Revert to slim as the display manager NixOS 18.09 switches from slim to something else (lightdm?) as the default display manager, however DBUS is broken in that manager if the session is ever restarted. This reverts back to slim, which may not look as fancy by default but it actually works. --- desktop.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/desktop.nix b/desktop.nix index 61d2482c44..07a6274a56 100644 --- a/desktop.nix +++ b/desktop.nix @@ -16,6 +16,9 @@ in { # Give EXWM permission to control the session. displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER"; + + # Use the pre 18.09 default display manager (slim) + displayManager.slim.enable = true; }; # Add a shell script with random screen lock wallpaper selection -- cgit 1.4.1 From 93e61464041fa8cad849d0c0045c013ccbd39123 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 7 Nov 2018 00:13:03 +0100 Subject: chore(pkgs): wine -> wineStaging 64-bit --- packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.nix b/packages.nix index d2e4bab888..b662435f85 100644 --- a/packages.nix +++ b/packages.nix @@ -117,7 +117,7 @@ in { units unzip vlc - wine + (wineStaging.override { wineBuild = "wine64"; }) winetricks xclip xfce.xfce4-screenshooter -- cgit 1.4.1 From 40027f008f2a1ad94b4d48133a4d82158014aaa1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 9 Dec 2018 13:26:30 +0100 Subject: fix(emacs): Fix sly package (again) --- emacs.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 307aeb46f2..1d5c1d4393 100644 --- a/emacs.nix +++ b/emacs.nix @@ -49,6 +49,19 @@ exwm = melpaBuild { }; }; +slyFixed = sly.overrideAttrs(_: { + recipe = builtins.toFile "recipe" '' +(sly :repo "joaotavora/sly" + :fetcher github + :files ("*.el" + ("lib" "lib/*") + ("contrib" "contrib/*") + "doc/*.texi" + "doc/*.info" + "doc/dir")) +''; +}); + in emacsWithPackages(epkgs: # Actual ELPA packages (the enlightened!) (with epkgs.elpaPackages; [ @@ -106,7 +119,7 @@ in emacsWithPackages(epkgs: restclient rust-mode s - # sly + slyFixed smartparens string-edit swiper -- cgit 1.4.1 From 52d9ae8944c50616546aaee860fcda6975961ffd Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 26 Dec 2018 00:59:47 +0100 Subject: chore(adho): Switch to 2.4Ghz home network --- adho-configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index 006e9cacd3..5206431c31 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -37,7 +37,7 @@ wireless.networks = { # Welcome to roast club! - "How do I computer fast?" = { + "How do I computer?" = { psk = "washyourface"; }; -- cgit 1.4.1 From 54d56a39a6a2cd2f52723c02b4ccadda29cc82ea Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 26 Dec 2018 00:59:59 +0100 Subject: feat(adho): Add The Kasbah & Google Oslo networks --- adho-configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 5206431c31..9134818d3a 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -141,6 +141,10 @@ psk = "92433048597489095671"; }; + "TheKasbah" = { + psk = "couscous"; + }; + # NixCon 2018 "Coin Street Community Builders " = { psk = "3vents2016"; @@ -161,6 +165,7 @@ "Amundsengjest" = {}; "Beer Palace Gjest" = {}; "ibis" = {}; + "GoogleGuest" = {}; }; }; -- cgit 1.4.1 From a06aae723630fe14e0af6a6b9c128d67aca72129 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 26 Dec 2018 01:00:34 +0100 Subject: feat(adho): Enable virtualbox & LXC --- adho-configuration.nix | 7 +++++++ configuration.nix | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/adho-configuration.nix b/adho-configuration.nix index 9134818d3a..4498f04549 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -15,6 +15,13 @@ services.avahi.enable = true; services.avahi.nssmdns = true; + # Enable VirtualBox to update Beatstep Pro firmware: + virtualisation.virtualbox.host.enable = true; + virtualisation.virtualbox.host.enableExtensionPack = true; + + # Enable LXC/LXD for Nixini work + virtualisation.lxd.enable = true; + # Give me more entropy: services.haveged.enable = true; diff --git a/configuration.nix b/configuration.nix index e4a9574292..02015cbf24 100644 --- a/configuration.nix +++ b/configuration.nix @@ -83,7 +83,7 @@ # Configure user account users.defaultUserShell = pkgs.fish; users.extraUsers.vincent = { - extraGroups = [ "wheel" "docker" ]; + extraGroups = [ "wheel" "docker" "vboxusers" "lxd" ]; isNormalUser = true; uid = 1000; shell = pkgs.fish; -- cgit 1.4.1 From 432bb85f486e25b71d5eb9a2e627a7a1769beb79 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 26 Dec 2018 01:00:47 +0100 Subject: feat: Open firewall port 3000 --- configuration.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index 02015cbf24..57f5c56dc7 100644 --- a/configuration.nix +++ b/configuration.nix @@ -36,8 +36,8 @@ "1.0.0.1" ]; - # Open Chromecast-related ports - firewall.allowedTCPPorts = [ 5556 5558 ]; + # Open Chromecast-related ports & servedir + firewall.allowedTCPPorts = [ 3000 5556 5558 ]; }; # Generate an immutable /etc/resolv.conf from the nameserver settings -- cgit 1.4.1 From f32222c36f6c2c15294cdc190c0ebd92a130ca26 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 30 Jan 2019 10:14:32 +0100 Subject: chore(adho): Add Kitty's network --- adho-configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 4498f04549..0181c4ace3 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -152,6 +152,11 @@ psk = "couscous"; }; + # Kitty's misspelled network. + "How do I Computer?" = { + psk = "herpderpponies"; + }; + # NixCon 2018 "Coin Street Community Builders " = { psk = "3vents2016"; -- cgit 1.4.1 From 998e1bb7a1940159b57655e04e566f6ecd4afcd5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 30 Jan 2019 10:14:50 +0100 Subject: feat(emacs): Add elm-mode back in --- emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.nix b/emacs.nix index 1d5c1d4393..24426bc438 100644 --- a/emacs.nix +++ b/emacs.nix @@ -66,7 +66,6 @@ in emacsWithPackages(epkgs: # Actual ELPA packages (the enlightened!) (with epkgs.elpaPackages; [ ace-window - adjust-parens avy company pinentry @@ -88,6 +87,7 @@ in emacsWithPackages(epkgs: eglot elixir-mode erlang + elm-mode exwm go-mode gruber-darker-theme -- cgit 1.4.1 From a1751798f1f0bc4419ceab3353fe969508bb40b6 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 30 Jan 2019 10:19:48 +0100 Subject: chore(pkgs): Remove wine again Never managed to get it to work for the things I wanted anyways. --- packages.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages.nix b/packages.nix index b662435f85..b90a4a9ee8 100644 --- a/packages.nix +++ b/packages.nix @@ -117,8 +117,6 @@ in { units unzip vlc - (wineStaging.override { wineBuild = "wine64"; }) - winetricks xclip xfce.xfce4-screenshooter -- cgit 1.4.1 From f661e4e6ebd196e86d1e2cbd17ba5ec95dbc2051 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 3 Feb 2019 21:04:44 +0000 Subject: feat(home): Add initial home-manager configuration for ChromeOS Adds a home-manager configuration that can be used in a Crostini container running Nix. There isn't any truly ChromeOS-specific stuff in this yet, as I've set up the interoperability with garcon etc. manually for now. --- home.nix | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 home.nix diff --git a/home.nix b/home.nix new file mode 100644 index 0000000000..236091cb01 --- /dev/null +++ b/home.nix @@ -0,0 +1,75 @@ +# home-manager configuration used on ChromeOS systems + +{ config, pkgs, ... }: + +{ + # Allow non-free software (fonts, IDEA, etc.): + nixpkgs.config.allowUnfree = true; + + # Install various useful packages: + home.packages = with pkgs; [ + bat + exa + gnupg + google-cloud-sdk + htop + pass + ripgrep + tdesktop + transmission + tree + + # Fonts to make available in X11 applications: + input-fonts + + # Emacs configuration stays in the normal ~/.emacs.d location (for + # now), hence this package is not installed via `programs.emacs`. + (import ./emacs.nix { inherit pkgs; }) + ]; + + programs.git = { + enable = true; + userEmail = "mail@tazj.in"; + userName = "Vincent Ambo"; + }; + + services.gpg-agent = { + enable = true; + extraConfig = '' + pinentry-program ${pkgs.pinentry}/bin/pinentry-gtk-2 + allow-emacs-pinentry + ''; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + manual.html.enable = true; + + # Shell configuration + # + # There are some differences between the ChromeOS / NixOS + # configurations, so instead of fixing up the dotfile to support + # both I opted for keeping the configuration here. + programs.fish = { + enable = true; + interactiveShellInit = '' + # Configure classic prompt + set fish_color_user --bold blue + set fish_color_cwd --bold white + + # Enable colour hints in VCS prompt: + set __fish_git_prompt_showcolorhints yes + set __fish_git_prompt_color_prefix purple + set __fish_git_prompt_color_suffix purple + + # Fish configuration + set fish_greeting "" + + # Fix up nix-env & friends for Nix 2.0 + export NIX_REMOTE=daemon + ''; + }; + + # Ensure fonts installed via Nix are picked up. + fonts.fontconfig.enableProfileFonts = true; +} -- cgit 1.4.1 From 83f1b769fb433c1f3be1fe38c8d31910753a6123 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 11 Feb 2019 14:54:07 +0100 Subject: feat(adho): Add Kulturhuset and Forest & Brown wifis --- adho-configuration.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/adho-configuration.nix b/adho-configuration.nix index 0181c4ace3..11c5a97df5 100644 --- a/adho-configuration.nix +++ b/adho-configuration.nix @@ -162,6 +162,15 @@ psk = "3vents2016"; }; + "KH2 Gjest" = { + psk = "haenfindag"; + }; + + # Forest & Brown + "Forest Guest" = { + psk = "437B99AC5B"; + }; + "Gatwick FREE Wi-Fi" = {}; "mycloud" = {}; "Norwegian Internet Access" = {}; -- cgit 1.4.1 From 3f199f96506d2559dd51d8fff629790e057c9149 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 14 Dec 2019 11:44:01 +0000 Subject: chore(nixos): Move NixOS config to infra/nixos --- .gitignore | 3 - README.md | 23 ---- adho-configuration.nix | 200 ---------------------------------- configuration.nix | 102 ------------------ desktop.nix | 82 -------------- dotfiles.nix | 27 ----- dotfiles/alacritty.yml | 203 ----------------------------------- dotfiles/config.fish | 40 ------- dotfiles/msmtprc | 24 ----- dotfiles/notmuch-config | 21 ---- dotfiles/offlineimaprc | 61 ----------- dotfiles/tmux.conf | 14 --- emacs.nix | 138 ------------------------ home.nix | 75 ------------- infra/nixos/.gitignore | 3 + infra/nixos/README.md | 23 ++++ infra/nixos/adho-configuration.nix | 200 ++++++++++++++++++++++++++++++++++ infra/nixos/configuration.nix | 102 ++++++++++++++++++ infra/nixos/desktop.nix | 82 ++++++++++++++ infra/nixos/dotfiles.nix | 27 +++++ infra/nixos/dotfiles/alacritty.yml | 203 +++++++++++++++++++++++++++++++++++ infra/nixos/dotfiles/config.fish | 40 +++++++ infra/nixos/dotfiles/msmtprc | 24 +++++ infra/nixos/dotfiles/notmuch-config | 21 ++++ infra/nixos/dotfiles/offlineimaprc | 61 +++++++++++ infra/nixos/dotfiles/tmux.conf | 14 +++ infra/nixos/emacs.nix | 138 ++++++++++++++++++++++++ infra/nixos/home.nix | 75 +++++++++++++ infra/nixos/mail.nix | 83 ++++++++++++++ infra/nixos/packages.nix | 132 +++++++++++++++++++++++ infra/nixos/pkgs/pulseaudio-ctl.nix | 26 +++++ infra/nixos/pkgs/wallpapers.nix | 22 ++++ infra/nixos/stallo-configuration.nix | 39 +++++++ mail.nix | 83 -------------- packages.nix | 132 ----------------------- pkgs/pulseaudio-ctl.nix | 26 ----- pkgs/wallpapers.nix | 22 ---- stallo-configuration.nix | 39 ------- 38 files changed, 1315 insertions(+), 1315 deletions(-) delete mode 100644 .gitignore delete mode 100644 README.md delete mode 100644 adho-configuration.nix delete mode 100644 configuration.nix delete mode 100644 desktop.nix delete mode 100644 dotfiles.nix delete mode 100644 dotfiles/alacritty.yml delete mode 100644 dotfiles/config.fish delete mode 100644 dotfiles/msmtprc delete mode 100644 dotfiles/notmuch-config delete mode 100644 dotfiles/offlineimaprc delete mode 100644 dotfiles/tmux.conf delete mode 100644 emacs.nix delete mode 100644 home.nix create mode 100644 infra/nixos/.gitignore create mode 100644 infra/nixos/README.md create mode 100644 infra/nixos/adho-configuration.nix create mode 100644 infra/nixos/configuration.nix create mode 100644 infra/nixos/desktop.nix create mode 100644 infra/nixos/dotfiles.nix create mode 100644 infra/nixos/dotfiles/alacritty.yml create mode 100644 infra/nixos/dotfiles/config.fish create mode 100644 infra/nixos/dotfiles/msmtprc create mode 100644 infra/nixos/dotfiles/notmuch-config create mode 100644 infra/nixos/dotfiles/offlineimaprc create mode 100644 infra/nixos/dotfiles/tmux.conf create mode 100644 infra/nixos/emacs.nix create mode 100644 infra/nixos/home.nix create mode 100644 infra/nixos/mail.nix create mode 100644 infra/nixos/packages.nix create mode 100644 infra/nixos/pkgs/pulseaudio-ctl.nix create mode 100644 infra/nixos/pkgs/wallpapers.nix create mode 100644 infra/nixos/stallo-configuration.nix delete mode 100644 mail.nix delete mode 100644 packages.nix delete mode 100644 pkgs/pulseaudio-ctl.nix delete mode 100644 pkgs/wallpapers.nix delete mode 100644 stallo-configuration.nix diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 773fa16670..0000000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -hardware-configuration.nix -local-configuration.nix -result diff --git a/README.md b/README.md deleted file mode 100644 index 4f2e870f90..0000000000 --- a/README.md +++ /dev/null @@ -1,23 +0,0 @@ -NixOS configuration -=================== - -My NixOS configuration! It configures most of the packages I require -on my systems, sets up Emacs the way I need and does a bunch of other -interesting things. - -In contrast with earlier versions of this configuration, the Nix -channel versions are now pinned in Nix (see the beginning of -[packages.nix][]). - -Machine-local configuration is kept in files with the naming scheme -`$hostname-configuration.nix` and **must** be symlinked to -`local-configuration.nix` before the first configuration run. - -I'm publishing this repository (and my [emacs configuration][]) as a -convenience for myself, but also as a resource that people looking for -example Nix or Emacs configurations can browse through. - -Feel free to ping me with any questions you might have. - -[packages.nix]: packages.nix -[emacs configuration]: https://github.com/tazjin/emacs.d diff --git a/adho-configuration.nix b/adho-configuration.nix deleted file mode 100644 index 11c5a97df5..0000000000 --- a/adho-configuration.nix +++ /dev/null @@ -1,200 +0,0 @@ -# Local configuration for 'adho' (Thinkpad T470s) -{ config, pkgs, ...}: - -{ - boot.initrd.luks.devices.adho.device = "/dev/disk/by-uuid/722006b0-9654-4ea1-8703-e0cf9ac1905e"; - boot.kernelModules = [ "kvm-intel" ]; - - services.xserver.libinput.enable = true; - services.xserver.videoDrivers = [ "intel" ]; - programs.light.enable = true; - - # Office printer configuration - services.printing.enable = true; - services.printing.drivers = [ pkgs.hplip ]; - services.avahi.enable = true; - services.avahi.nssmdns = true; - - # Enable VirtualBox to update Beatstep Pro firmware: - virtualisation.virtualbox.host.enable = true; - virtualisation.virtualbox.host.enableExtensionPack = true; - - # Enable LXC/LXD for Nixini work - virtualisation.lxd.enable = true; - - # Give me more entropy: - services.haveged.enable = true; - - # Disable sandbox to let work-builds function: - nix.useSandbox = false; - - # Yubikey related: - services.pcscd.enable = true; - environment.systemPackages = with pkgs; [ - cfssl - libp11 - opensc - yubico-piv-tool - ]; - - networking = { - hostName = "adho"; - wireless.enable = true; - wireless.userControlled.enable = true; - - wireless.networks = { - # Welcome to roast club! - "How do I computer?" = { - psk = "washyourface"; - }; - - # On the go! - "Rumpetroll" = { - psk = "fisk1234"; - # If this network exists, chances are that I want it: - priority = 10; - }; - - # Public places in Oslo: - "Abelone" = { - psk = "speakeasy"; - }; - - "Wurst" = { - psk = "wurst2015"; - }; - - "postkontoret" = { - psk = "postkontoret"; - }; - - # Eugene's apartment: - "GET_5G_4FD250" = { - psk = "62636342"; - }; - - # FSCONS 2017 - "uioguest" = {}; - - # Hackeriet! - "hackeriet.no" = { - psk = "hackeriet.no"; - }; - - # Cafe Sara - "Sara Nett" = { - psk = "sarabar1989"; - }; - - # The Dubliner - "DubGjest" = { - # of course - psk = "Guinness"; - }; - - "MAGNAT Guest" = { - psk = "elmolino021"; - }; - - "BrewDog" = { - psk = "welovebeer"; - }; - - # Dima's - "What's a Bad Idea?" = { - psk = "DQDxzrzIvy0YtDwH"; - }; - - # Loke's - "VMC28F76E" = { - psk = "d2ftQnr6xppw"; - }; - - "SafetyWiFi - Teknologihuset" = { - psk = "tech4ever"; - }; - - "Selvaag Pluss" = { - psk = "detlilleekstra"; - }; - - "Langler" = { - psk = "Oslo2018"; - }; - - # Pils & Programmering - "BEKKguest" = { - psk = "guest7890"; - }; - - "Homan-Gjest" = { - psk = "haveaniceday"; - }; - - # Røverstaden - "Roverstaden" = { - psk = "r0verstaden2018"; - }; - - "The Brew Dock" = { - psk = "realbeer"; - }; - - "econ-guest" = { - psk = "Finance2010"; - }; - - "KabelBox-2FD0" = { - psk = "92433048597489095671"; - }; - - "TheKasbah" = { - psk = "couscous"; - }; - - # Kitty's misspelled network. - "How do I Computer?" = { - psk = "herpderpponies"; - }; - - # NixCon 2018 - "Coin Street Community Builders " = { - psk = "3vents2016"; - }; - - "KH2 Gjest" = { - psk = "haenfindag"; - }; - - # Forest & Brown - "Forest Guest" = { - psk = "437B99AC5B"; - }; - - "Gatwick FREE Wi-Fi" = {}; - "mycloud" = {}; - "Norwegian Internet Access" = {}; - "NSB_INTERAKTIV" = {}; - "The Thief" = {}; - "espressohouse" = {}; - "Gotanet Open" = {}; - "wifi.flytoget.no" = {}; - "AIRPORT" = {}; - "ilcaffelovesyou" = {}; - "WIFIonICE" = {}; - "Lorry Gjest" = {}; - "Amundsengjest" = {}; - "Beer Palace Gjest" = {}; - "ibis" = {}; - "GoogleGuest" = {}; - }; - }; - - hardware.bluetooth.enable = true; - - # Configure POSIX queue limits (for work) - systemd.tmpfiles.rules = let mqueue = "/proc/sys/fs/mqueue"; in [ - "w ${mqueue}/msgsize_max - - - - ${toString (64 * 1024)}" - "w ${mqueue}/msg_max - - - - 50" - ]; -} diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 57f5c56dc7..0000000000 --- a/configuration.nix +++ /dev/null @@ -1,102 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, lib, pkgs, ... }: - -{ - imports = - [ - ./desktop.nix - ./dotfiles.nix - ./hardware-configuration.nix - ./local-configuration.nix - ./mail.nix - ./packages.nix - ]; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.cleanTmpDir = true; - hardware.pulseaudio.enable = true; - time.timeZone = "Europe/Oslo"; - - # Configure audio setup for JACK + Overtone - boot.kernelModules = [ "snd-seq" "snd-rawmidi" ]; - hardware.pulseaudio.package = pkgs.pulseaudioFull; - - # Update Intel microcode on boot (both machines have Intel CPUs): - hardware.cpu.intel.updateMicrocode = true; - - networking = { - # Don't use ISP's DNS servers: - nameservers = [ - "1.1.1.1" - "1.0.0.1" - ]; - - # Open Chromecast-related ports & servedir - firewall.allowedTCPPorts = [ 3000 5556 5558 ]; - }; - - # Generate an immutable /etc/resolv.conf from the nameserver settings - # above (otherwise DHCP overwrites it): - environment.etc."resolv.conf" = with lib; with pkgs; { - source = writeText "resolv.conf" '' - ${concatStringsSep "\n" (map (ns: "nameserver ${ns}") config.networking.nameservers)} - options edns0 - ''; - }; - - # Configure emacs: - # (actually, that's a lie, this only installs emacs!) - services.emacs = { - install = true; - defaultEditor = true; - package = import ./emacs.nix { inherit pkgs; }; - }; - - services.openssh.enable = true; - - # Enable GNOME keyring (required for Evolution) - services.gnome3.gnome-keyring.enable = true; - - virtualisation = { - # Configure Docker (with socket activation): - # Side note: ... why is this in virtualisation? ... - docker.enable = true; - docker.autoPrune.enable = true; - }; - - # Configure various other applications: - programs = { - java.enable = true; - java.package = pkgs.openjdk; - - fish.enable = true; - ssh.startAgent = true; - }; - - services.postgresql.enable = true; - - # Configure user account - users.defaultUserShell = pkgs.fish; - users.extraUsers.vincent = { - extraGroups = [ "wheel" "docker" "vboxusers" "lxd" ]; - isNormalUser = true; - uid = 1000; - shell = pkgs.fish; - }; - - security.sudo = { - enable = true; - extraConfig = "wheel ALL=(ALL:ALL) SETENV: ALL"; - }; - - # This value determines the NixOS release with which your system is to be - # compatible, in order to avoid breaking some software such as database - # servers. You should change this only after NixOS release notes say you - # should. - system.stateVersion = "18.03"; # Did you read the comment? -} diff --git a/desktop.nix b/desktop.nix deleted file mode 100644 index 07a6274a56..0000000000 --- a/desktop.nix +++ /dev/null @@ -1,82 +0,0 @@ -# Configuration for the desktop environment - -{ config, lib, pkgs, ... }: - -let emacs = import ./emacs.nix { inherit pkgs; }; -screenLock = pkgs.writeShellScriptBin "screen-lock" '' - find ${pkgs.wallpapers} -name "*.png" | shuf -n1 | xargs i3lock -f -t -i -''; -in { - # Configure basic X-server stuff: - services.xserver = { - enable = true; - layout = "us,no"; - xkbOptions = "caps:super, grp:shifts_toggle, parens:swap_brackets"; - exportConfiguration = true; - - # Give EXWM permission to control the session. - displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER"; - - # Use the pre 18.09 default display manager (slim) - displayManager.slim.enable = true; - }; - - # Add a shell script with random screen lock wallpaper selection - environment.systemPackages = [ screenLock ]; - - # Apparently when you have house guests they complain about your screen tearing! - services.compton.enable = true; - services.compton.backend = "xrender"; - - # Configure desktop environment: - services.xserver.windowManager.session = lib.singleton { - name = "exwm"; - start = '' - ${emacs}/bin/emacs --eval '(progn (server-start) (exwm-enable))' - ''; - }; - - # Configure Redshift for Oslo - services.redshift = { - enable = true; - latitude = "59.911491"; - longitude = "10.757933"; - }; - - # Configure fonts - fonts = { - fonts = with pkgs; [ - corefonts - font-awesome-ttf - input-fonts - noto-fonts-cjk - noto-fonts-emoji - powerline-fonts - helvetica-neue-lt-std - ]; - }; - - # Configure random setting of wallpapers - systemd.user.services.feh-wp = { - description = "Randomly set wallpaper via feh"; - serviceConfig = { - Type = "oneshot"; - WorkingDirectory = "${pkgs.wallpapers}/share/wallpapers"; - - # Manually shuffle because feh's --randomize option can't be restricted to - # just certain file types. - ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'"; - }; - }; - - systemd.user.timers.feh-wp = { - description = "Set a random wallpaper every hour"; - wantedBy = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; - - timerConfig = { - OnActiveSec = "1second"; - OnUnitActiveSec = "1hour"; - }; - }; -} diff --git a/dotfiles.nix b/dotfiles.nix deleted file mode 100644 index 2e952207d4..0000000000 --- a/dotfiles.nix +++ /dev/null @@ -1,27 +0,0 @@ -# Bundle configuration files into a derivation. -# I call this derivation dotfiles despite that not technically being true -# anymore ... - -{ config, pkgs, ...}: - -let dotfiles = pkgs.stdenv.mkDerivation { - name = "tazjins-dotfiles"; - - srcs = [ - ./dotfiles - ]; - - installPhase = '' - mkdir -p $out - cp ./* $out/ - ''; -}; -in { - # /etc/ is a special place in NixOS! - # Symlinks that need to be created there must be specified explicitly. - environment.etc = { - "alacritty.yml".source = "${dotfiles}/alacritty.yml"; - "fish/config.fish".source = "${dotfiles}/config.fish"; - "tmux.conf".source = "${dotfiles}/tmux.conf"; - }; -} diff --git a/dotfiles/alacritty.yml b/dotfiles/alacritty.yml deleted file mode 100644 index d229fbdde6..0000000000 --- a/dotfiles/alacritty.yml +++ /dev/null @@ -1,203 +0,0 @@ -# Configuration for Alacritty, the GPU enhanced terminal emulator - -# Any items in the `env` entry below will be added as -# environment variables. Some entries may override variables -# set by alacritty it self. -env: - TERM: xterm-256color - -window: - # TODO - decorations: full - -scrolling: - history: 10000 - multiplier: 3 - faux_multiplier: 3 - auto_scroll: true # TODO - -# Display tabs using this many cells (changes require restart) -tabspaces: 4 - -# When true, bold text is drawn using the bright variant of colors. -draw_bold_text_with_bright_colors: true - -# Font configuration (changes require restart) -font: - # The normal (roman) font face to use. - normal: - family: Input Mono - bold: - family: Input Mono - italic: - family: Input Mono - - # Point size of the font - size: 12.0 - - # Scale the font size based on the monitor's DPI. - scale_with_dpi: false - -# Use custom cursor colors. If true, display the cursor in the cursor.foreground -# and cursor.background colors, otherwise invert the colors of the cursor. -custom_cursor_colors: false - -# Colors (Gruber Darker) -colors: - # Default colors - primary: - background: '0x181818' - foreground: '0xe4e4ef' - - # Colors the cursor will use if `custom_cursor_colors` is true - cursor: - text: '0x000000' - cursor: '0xf5f5f5' - - # Normal colors - normal: - black: '0x282828' - red: '0xf43841' - green: '0x73c936' - yellow: '0xffdd33' - blue: '0x96a6c8' - magenta: '0x9e95c7' - cyan: '0x1fad83' - white: '0xf5f5f5' - - # Bright colors - bright: - black: '0x484848' - red: '0xff4f58' - green: '0x73c936' - yellow: '0xffdd33' - blue: '0x5f627f' - magenta: '0x9e95c7' - cyan: '0x1fad83' - white: '0xffffff' - -# Background opacity -# Key bindings -# -# Each binding is defined as an object with some properties. Most of the -# properties are optional. All of the alphabetical keys should have a letter for -# the `key` value such as `V`. Function keys are probably what you would expect -# as well (F1, F2, ..). The number keys above the main keyboard are encoded as -# `Key1`, `Key2`, etc. Keys on the number pad are encoded `Number1`, `Number2`, -# etc. These all match the glutin::VirtualKeyCode variants. -# -# Possible values for `mods` -# `Command`, `Super` refer to the super/command/windows key -# `Control` for the control key -# `Shift` for the Shift key -# `Alt` and `Option` refer to alt/option -# -# mods may be combined with a `|`. For example, requiring control and shift -# looks like: -# -# mods: Control|Shift -# -# The parser is currently quite sensitive to whitespace and capitalization - -# capitalization must match exactly, and piped items must not have whitespace -# around them. -# -# Either an `action`, `chars`, or `command` field must be present. -# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`. -# `chars` writes the specified string every time that binding is activated. -# These should generally be escape sequences, but they can be configured to -# send arbitrary strings of bytes. -# `command` must be a map containing a `program` string, and `args` array of -# strings. For example: -# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } } -# -# Want to add a binding (e.g. "PageUp") but are unsure what the X sequence -# (e.g. "\x1b[5~") is? Open another terminal (like xterm) without tmux, -# then run `showkey -a` to get the sequence associated to a key combination. -key_bindings: - - { key: V, mods: Control|Shift, action: Paste } - - { key: C, mods: Control|Shift, action: Copy } - - { key: Q, mods: Command, action: Quit } - - { key: W, mods: Command, action: Quit } - - { key: Insert, mods: Shift, action: PasteSelection } - - { key: Home, chars: "\x1bOH", mode: AppCursor } - - { key: Home, chars: "\x1b[H", mode: ~AppCursor } - - { key: End, chars: "\x1bOF", mode: AppCursor } - - { key: End, chars: "\x1b[F", mode: ~AppCursor } - - { key: PageUp, mods: Shift, chars: "\x1b[5;2~" } - - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } - - { key: PageUp, chars: "\x1b[5~" } - - { key: PageDown, mods: Shift, chars: "\x1b[6;2~" } - - { key: PageDown, mods: Control, chars: "\x1b[6;5~" } - - { key: PageDown, chars: "\x1b[6~" } - - { key: Left, mods: Shift, chars: "\x1b[1;2D" } - - { key: Left, mods: Control, chars: "\x1b[1;5D" } - - { key: Left, mods: Alt, chars: "\x1b[1;3D" } - - { key: Left, chars: "\x1b[D", mode: ~AppCursor } - - { key: Left, chars: "\x1bOD", mode: AppCursor } - - { key: Right, mods: Shift, chars: "\x1b[1;2C" } - - { key: Right, mods: Control, chars: "\x1b[1;5C" } - - { key: Right, mods: Alt, chars: "\x1b[1;3C" } - - { key: Right, chars: "\x1b[C", mode: ~AppCursor } - - { key: Right, chars: "\x1bOC", mode: AppCursor } - - { key: Up, mods: Shift, chars: "\x1b[1;2A" } - - { key: Up, mods: Control, chars: "\x1b[1;5A" } - - { key: Up, mods: Alt, chars: "\x1b[1;3A" } - - { key: Up, chars: "\x1b[A", mode: ~AppCursor } - - { key: Up, chars: "\x1bOA", mode: AppCursor } - - { key: Down, mods: Shift, chars: "\x1b[1;2B" } - - { key: Down, mods: Control, chars: "\x1b[1;5B" } - - { key: Down, mods: Alt, chars: "\x1b[1;3B" } - - { key: Down, chars: "\x1b[B", mode: ~AppCursor } - - { key: Down, chars: "\x1bOB", mode: AppCursor } - - { key: Tab, mods: Shift, chars: "\x1b[Z" } - - { key: F1, chars: "\x1bOP" } - - { key: F2, chars: "\x1bOQ" } - - { key: F3, chars: "\x1bOR" } - - { key: F4, chars: "\x1bOS" } - - { key: F5, chars: "\x1b[15~" } - - { key: F6, chars: "\x1b[17~" } - - { key: F7, chars: "\x1b[18~" } - - { key: F8, chars: "\x1b[19~" } - - { key: F9, chars: "\x1b[20~" } - - { key: F10, chars: "\x1b[21~" } - - { key: F11, chars: "\x1b[23~" } - - { key: F12, chars: "\x1b[24~" } - - { key: Back, chars: "\x7f" } - - { key: Back, mods: Alt, chars: "\x1b\x7f" } - - { key: Insert, chars: "\x1b[2~" } - - { key: Delete, chars: "\x1b[3~" } - -# Mouse bindings -# -# Currently doesn't support modifiers. Both the `mouse` and `action` fields must -# be specified. -# -# Values for `mouse`: -# - Middle -# - Left -# - Right -# - Numeric identifier such as `5` -# -# Values for `action`: -# - Paste -# - PasteSelection -# - Copy (TODO) -mouse_bindings: - - { mouse: Middle, action: PasteSelection } - -mouse: - double_click: { threshold: 300 } - triple_click: { threshold: 300 } - -selection: - semantic_escape_chars: ",│`|:\"' ()[]{}<>" -background_opacity: 1.0 - -hide_cursor_when_typing: false - -# Live config reload (changes require restart) -live_config_reload: true - -# Disable visual bell -visual_bell: - duration: 0 diff --git a/dotfiles/config.fish b/dotfiles/config.fish deleted file mode 100644 index de2c99ae60..0000000000 --- a/dotfiles/config.fish +++ /dev/null @@ -1,40 +0,0 @@ -# Configure classic prompt -set fish_color_user --bold blue -set fish_color_cwd --bold white - -# Enable colour hints in VCS prompt: -set __fish_git_prompt_showcolorhints yes -set __fish_git_prompt_color_prefix purple -set __fish_git_prompt_color_suffix purple - -# Fish configuration -set fish_greeting "" -set PATH $HOME/.local/bin $HOME/.cargo/bin $PATH - -# Editor configuration -set -gx EDITOR "emacsclient" -set -gx ALTERNATE_EDITOR "emacs -q -nw" -set -gx VISUAL "emacsclient" - -# Miscellaneous -eval (direnv hook fish) - -# Useful command aliases -alias gpr 'git pull --rebase' -alias gco 'git checkout' -alias gf 'git fetch' -alias gap 'git add -p' -alias pbcopy 'xclip -selection clipboard' -alias edit 'emacsclient -n' -alias servedir 'nix-shell -p haskellPackages.wai-app-static --run warp' - -# Old habits die hard (also ls is just easier to type): -alias ls 'exa' - -# Fix up nix-env & friends for Nix 2.0 -export NIX_REMOTE=daemon - -# Fix display of fish in emacs' term-mode: -function fish_title - true -end diff --git a/dotfiles/msmtprc b/dotfiles/msmtprc deleted file mode 100644 index c6a9a7426a..0000000000 --- a/dotfiles/msmtprc +++ /dev/null @@ -1,24 +0,0 @@ -defaults - -port 587 -tls on -tls_trust_file /etc/ssl/certs/ca-certificates.crt - -# Aprila mail -account aprila -from vincent@aprila.no -host smtp.office365.com -auth on -user vincent@aprila.no -passwordeval pass show aprila/office365-mail - -# Runbox mail -account runbox -from mail@tazj.in -host mail.runbox.com -auth on -user mail@tazj.in -passwordeval pass show general/runbox-tazjin - -# Use Runbox as default -account default : runbox diff --git a/dotfiles/notmuch-config b/dotfiles/notmuch-config deleted file mode 100644 index eb8b2c79bb..0000000000 --- a/dotfiles/notmuch-config +++ /dev/null @@ -1,21 +0,0 @@ -# .notmuch-config - Configuration file for the notmuch mail system -# -# For more information about notmuch, see https://notmuchmail.org - -[database] -path=/home/vincent/mail - -[user] -name=Vincent Ambo -primary_email=vincent@aprila.no -other_email=mail@tazj.in;tazjin@gmail.com; - -[new] -tags=unread;inbox; -ignore= - -[search] -exclude_tags=deleted;spam;draft; - -[maildir] -synchronize_flags=true diff --git a/dotfiles/offlineimaprc b/dotfiles/offlineimaprc deleted file mode 100644 index dd4752f4c3..0000000000 --- a/dotfiles/offlineimaprc +++ /dev/null @@ -1,61 +0,0 @@ -[general] -accounts = aprila, tazjin, gmail - -[DEFAULT] -ssl = yes -sslcacertfile = /etc/ssl/certs/ca-certificates.crt - -# Main work account: -[Account aprila] -localrepository = aprila-local -remoterepository = aprila-remote - -[Repository aprila-local] -type = Maildir -localfolders = ~/mail/aprila - -[Repository aprila-remote] -type = IMAP -remotehost = outlook.office365.com -remoteuser = vincent@aprila.no -remotepassfile = ~/.config/mail/aprila-pass -# Office365 is a naughty boy when it comes to IMAP. Even worse, they -# also seem to have decided that they should change IMAP folder names -# based on the UI language. -# -# I can't be bothered to implement the entire (relatively long) -# blacklist, so I'll instead whitelist relevant folders: -folderfilter = lambda folder: folder in ['INBOX', 'Arkiv', 'Sende element'] - -# Private GMail account (old): -[Account gmail] -maxage = 90 -localrepository = gmail-local -remoterepository = gmail-remote -synclabels = yes - -[Repository gmail-local] -type = GmailMaildir -localfolders = ~/mail/gmail - -[Repository gmail-remote] -type = Gmail -remoteuser = tazjin@gmail.com -remotepassfile = ~/.config/mail/gmail-pass -folderfilter = lambda folder: folder == 'INBOX' - -# Main private account: -[Account tazjin] -localrepository = tazjin-local -remoterepository = tazjin-remote - -[Repository tazjin-local] -type = Maildir -localfolders = ~/mail/tazjin - -[Repository tazjin-remote] -type = IMAP -remotehost = mail.runbox.com -remoteuser = mail@tazj.in -remotepassfile = ~/.config/mail/tazjin-pass -auth_mechanisms = LOGIN diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf deleted file mode 100644 index 6c20ae0370..0000000000 --- a/dotfiles/tmux.conf +++ /dev/null @@ -1,14 +0,0 @@ -set -g status off -set -gw mode-keys emacs -setw -g mouse on - -# Correctly set window titles -set -g set-titles on -set -g set-titles-string "#W (#T)" - -# List of plugins -set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-yank' - -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) -run '~/.tmux/plugins/tpm/tpm' diff --git a/emacs.nix b/emacs.nix deleted file mode 100644 index 24426bc438..0000000000 --- a/emacs.nix +++ /dev/null @@ -1,138 +0,0 @@ -# Derivation for Emacs pre-configured with packages that I need. -# -# TODO: Fix sly (again) - -{ pkgs }: - -with pkgs; with emacsPackagesNg; -let emacsWithPackages = (emacsPackagesNgGen emacs).emacsWithPackages; - -# As the EXWM-README points out, XELB should be built from source if -# EXWM is. -xelb = melpaBuild { - pname = "xelb"; - ename = "xelb"; - version = "0.15"; - recipe = builtins.toFile "recipe" '' - (xelb :fetcher github - :repo "ch11ng/xelb") - ''; - - packageRequires = [ cl-generic emacs ]; - - src = fetchFromGitHub { - owner = "ch11ng"; - repo = "xelb"; - rev = "b8f168b401977098fe2b30f4ca32629c0ab6eb83"; - sha256 = "1ack1h68x8ia0ji6wbhmayrakq35p5sgrrl6qvha3ns3pswc0pl9"; - }; -}; - -# EXWM pinned to a newer version than what is released due to a -# potential fix for ch11ng/exwm#425. -exwm = melpaBuild { - pname = "exwm"; - ename = "exwm"; - version = "0.19"; - recipe = builtins.toFile "recipe" '' - (exwm :fetcher github - :repo "ch11ng/exwm") - ''; - - packageRequires = [ xelb ]; - - src = fetchFromGitHub { - owner = "ch11ng"; - repo = "exwm"; - rev = "472f7cb82b67b98843f10c12e6bda9b8ae7262bc"; - sha256 = "19gflsrb19aijf2xcw7j2m658qad21nbwziw38s1h2jw66vhk8dj"; - }; -}; - -slyFixed = sly.overrideAttrs(_: { - recipe = builtins.toFile "recipe" '' -(sly :repo "joaotavora/sly" - :fetcher github - :files ("*.el" - ("lib" "lib/*") - ("contrib" "contrib/*") - "doc/*.texi" - "doc/*.info" - "doc/dir")) -''; -}); - -in emacsWithPackages(epkgs: - # Actual ELPA packages (the enlightened!) - (with epkgs.elpaPackages; [ - ace-window - avy - company - pinentry - rainbow-mode - undo-tree - which-key - ]) ++ - - # MELPA packages: - (with epkgs.melpaPackages; [ - browse-kill-ring - cargo - counsel - counsel-notmuch - dash - dash-functional - dockerfile-mode - edit-server - eglot - elixir-mode - erlang - elm-mode - exwm - go-mode - gruber-darker-theme - haskell-mode - ht - hydra - idle-highlight-mode - intero - ivy - ivy-pass - ivy-prescient - jq-mode - kotlin-mode - magit - markdown-mode - markdown-toc - meghanada - multi-term - multiple-cursors - nginx-mode - nix-mode - omnisharp - paredit - password-store - pg - pkgs.notmuch - prescient - rainbow-delimiters - restclient - rust-mode - s - slyFixed - smartparens - string-edit - swiper - telephone-line - terraform-mode - toml-mode - use-package - uuidgen - web-mode - websocket - yaml-mode - ]) ++ - - # Custom packaged Emacs packages: - [ xelb exwm ] -) diff --git a/home.nix b/home.nix deleted file mode 100644 index 236091cb01..0000000000 --- a/home.nix +++ /dev/null @@ -1,75 +0,0 @@ -# home-manager configuration used on ChromeOS systems - -{ config, pkgs, ... }: - -{ - # Allow non-free software (fonts, IDEA, etc.): - nixpkgs.config.allowUnfree = true; - - # Install various useful packages: - home.packages = with pkgs; [ - bat - exa - gnupg - google-cloud-sdk - htop - pass - ripgrep - tdesktop - transmission - tree - - # Fonts to make available in X11 applications: - input-fonts - - # Emacs configuration stays in the normal ~/.emacs.d location (for - # now), hence this package is not installed via `programs.emacs`. - (import ./emacs.nix { inherit pkgs; }) - ]; - - programs.git = { - enable = true; - userEmail = "mail@tazj.in"; - userName = "Vincent Ambo"; - }; - - services.gpg-agent = { - enable = true; - extraConfig = '' - pinentry-program ${pkgs.pinentry}/bin/pinentry-gtk-2 - allow-emacs-pinentry - ''; - }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - manual.html.enable = true; - - # Shell configuration - # - # There are some differences between the ChromeOS / NixOS - # configurations, so instead of fixing up the dotfile to support - # both I opted for keeping the configuration here. - programs.fish = { - enable = true; - interactiveShellInit = '' - # Configure classic prompt - set fish_color_user --bold blue - set fish_color_cwd --bold white - - # Enable colour hints in VCS prompt: - set __fish_git_prompt_showcolorhints yes - set __fish_git_prompt_color_prefix purple - set __fish_git_prompt_color_suffix purple - - # Fish configuration - set fish_greeting "" - - # Fix up nix-env & friends for Nix 2.0 - export NIX_REMOTE=daemon - ''; - }; - - # Ensure fonts installed via Nix are picked up. - fonts.fontconfig.enableProfileFonts = true; -} diff --git a/infra/nixos/.gitignore b/infra/nixos/.gitignore new file mode 100644 index 0000000000..773fa16670 --- /dev/null +++ b/infra/nixos/.gitignore @@ -0,0 +1,3 @@ +hardware-configuration.nix +local-configuration.nix +result diff --git a/infra/nixos/README.md b/infra/nixos/README.md new file mode 100644 index 0000000000..4f2e870f90 --- /dev/null +++ b/infra/nixos/README.md @@ -0,0 +1,23 @@ +NixOS configuration +=================== + +My NixOS configuration! It configures most of the packages I require +on my systems, sets up Emacs the way I need and does a bunch of other +interesting things. + +In contrast with earlier versions of this configuration, the Nix +channel versions are now pinned in Nix (see the beginning of +[packages.nix][]). + +Machine-local configuration is kept in files with the naming scheme +`$hostname-configuration.nix` and **must** be symlinked to +`local-configuration.nix` before the first configuration run. + +I'm publishing this repository (and my [emacs configuration][]) as a +convenience for myself, but also as a resource that people looking for +example Nix or Emacs configurations can browse through. + +Feel free to ping me with any questions you might have. + +[packages.nix]: packages.nix +[emacs configuration]: https://github.com/tazjin/emacs.d diff --git a/infra/nixos/adho-configuration.nix b/infra/nixos/adho-configuration.nix new file mode 100644 index 0000000000..11c5a97df5 --- /dev/null +++ b/infra/nixos/adho-configuration.nix @@ -0,0 +1,200 @@ +# Local configuration for 'adho' (Thinkpad T470s) +{ config, pkgs, ...}: + +{ + boot.initrd.luks.devices.adho.device = "/dev/disk/by-uuid/722006b0-9654-4ea1-8703-e0cf9ac1905e"; + boot.kernelModules = [ "kvm-intel" ]; + + services.xserver.libinput.enable = true; + services.xserver.videoDrivers = [ "intel" ]; + programs.light.enable = true; + + # Office printer configuration + services.printing.enable = true; + services.printing.drivers = [ pkgs.hplip ]; + services.avahi.enable = true; + services.avahi.nssmdns = true; + + # Enable VirtualBox to update Beatstep Pro firmware: + virtualisation.virtualbox.host.enable = true; + virtualisation.virtualbox.host.enableExtensionPack = true; + + # Enable LXC/LXD for Nixini work + virtualisation.lxd.enable = true; + + # Give me more entropy: + services.haveged.enable = true; + + # Disable sandbox to let work-builds function: + nix.useSandbox = false; + + # Yubikey related: + services.pcscd.enable = true; + environment.systemPackages = with pkgs; [ + cfssl + libp11 + opensc + yubico-piv-tool + ]; + + networking = { + hostName = "adho"; + wireless.enable = true; + wireless.userControlled.enable = true; + + wireless.networks = { + # Welcome to roast club! + "How do I computer?" = { + psk = "washyourface"; + }; + + # On the go! + "Rumpetroll" = { + psk = "fisk1234"; + # If this network exists, chances are that I want it: + priority = 10; + }; + + # Public places in Oslo: + "Abelone" = { + psk = "speakeasy"; + }; + + "Wurst" = { + psk = "wurst2015"; + }; + + "postkontoret" = { + psk = "postkontoret"; + }; + + # Eugene's apartment: + "GET_5G_4FD250" = { + psk = "62636342"; + }; + + # FSCONS 2017 + "uioguest" = {}; + + # Hackeriet! + "hackeriet.no" = { + psk = "hackeriet.no"; + }; + + # Cafe Sara + "Sara Nett" = { + psk = "sarabar1989"; + }; + + # The Dubliner + "DubGjest" = { + # of course + psk = "Guinness"; + }; + + "MAGNAT Guest" = { + psk = "elmolino021"; + }; + + "BrewDog" = { + psk = "welovebeer"; + }; + + # Dima's + "What's a Bad Idea?" = { + psk = "DQDxzrzIvy0YtDwH"; + }; + + # Loke's + "VMC28F76E" = { + psk = "d2ftQnr6xppw"; + }; + + "SafetyWiFi - Teknologihuset" = { + psk = "tech4ever"; + }; + + "Selvaag Pluss" = { + psk = "detlilleekstra"; + }; + + "Langler" = { + psk = "Oslo2018"; + }; + + # Pils & Programmering + "BEKKguest" = { + psk = "guest7890"; + }; + + "Homan-Gjest" = { + psk = "haveaniceday"; + }; + + # Røverstaden + "Roverstaden" = { + psk = "r0verstaden2018"; + }; + + "The Brew Dock" = { + psk = "realbeer"; + }; + + "econ-guest" = { + psk = "Finance2010"; + }; + + "KabelBox-2FD0" = { + psk = "92433048597489095671"; + }; + + "TheKasbah" = { + psk = "couscous"; + }; + + # Kitty's misspelled network. + "How do I Computer?" = { + psk = "herpderpponies"; + }; + + # NixCon 2018 + "Coin Street Community Builders " = { + psk = "3vents2016"; + }; + + "KH2 Gjest" = { + psk = "haenfindag"; + }; + + # Forest & Brown + "Forest Guest" = { + psk = "437B99AC5B"; + }; + + "Gatwick FREE Wi-Fi" = {}; + "mycloud" = {}; + "Norwegian Internet Access" = {}; + "NSB_INTERAKTIV" = {}; + "The Thief" = {}; + "espressohouse" = {}; + "Gotanet Open" = {}; + "wifi.flytoget.no" = {}; + "AIRPORT" = {}; + "ilcaffelovesyou" = {}; + "WIFIonICE" = {}; + "Lorry Gjest" = {}; + "Amundsengjest" = {}; + "Beer Palace Gjest" = {}; + "ibis" = {}; + "GoogleGuest" = {}; + }; + }; + + hardware.bluetooth.enable = true; + + # Configure POSIX queue limits (for work) + systemd.tmpfiles.rules = let mqueue = "/proc/sys/fs/mqueue"; in [ + "w ${mqueue}/msgsize_max - - - - ${toString (64 * 1024)}" + "w ${mqueue}/msg_max - - - - 50" + ]; +} diff --git a/infra/nixos/configuration.nix b/infra/nixos/configuration.nix new file mode 100644 index 0000000000..57f5c56dc7 --- /dev/null +++ b/infra/nixos/configuration.nix @@ -0,0 +1,102 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ./desktop.nix + ./dotfiles.nix + ./hardware-configuration.nix + ./local-configuration.nix + ./mail.nix + ./packages.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.cleanTmpDir = true; + hardware.pulseaudio.enable = true; + time.timeZone = "Europe/Oslo"; + + # Configure audio setup for JACK + Overtone + boot.kernelModules = [ "snd-seq" "snd-rawmidi" ]; + hardware.pulseaudio.package = pkgs.pulseaudioFull; + + # Update Intel microcode on boot (both machines have Intel CPUs): + hardware.cpu.intel.updateMicrocode = true; + + networking = { + # Don't use ISP's DNS servers: + nameservers = [ + "1.1.1.1" + "1.0.0.1" + ]; + + # Open Chromecast-related ports & servedir + firewall.allowedTCPPorts = [ 3000 5556 5558 ]; + }; + + # Generate an immutable /etc/resolv.conf from the nameserver settings + # above (otherwise DHCP overwrites it): + environment.etc."resolv.conf" = with lib; with pkgs; { + source = writeText "resolv.conf" '' + ${concatStringsSep "\n" (map (ns: "nameserver ${ns}") config.networking.nameservers)} + options edns0 + ''; + }; + + # Configure emacs: + # (actually, that's a lie, this only installs emacs!) + services.emacs = { + install = true; + defaultEditor = true; + package = import ./emacs.nix { inherit pkgs; }; + }; + + services.openssh.enable = true; + + # Enable GNOME keyring (required for Evolution) + services.gnome3.gnome-keyring.enable = true; + + virtualisation = { + # Configure Docker (with socket activation): + # Side note: ... why is this in virtualisation? ... + docker.enable = true; + docker.autoPrune.enable = true; + }; + + # Configure various other applications: + programs = { + java.enable = true; + java.package = pkgs.openjdk; + + fish.enable = true; + ssh.startAgent = true; + }; + + services.postgresql.enable = true; + + # Configure user account + users.defaultUserShell = pkgs.fish; + users.extraUsers.vincent = { + extraGroups = [ "wheel" "docker" "vboxusers" "lxd" ]; + isNormalUser = true; + uid = 1000; + shell = pkgs.fish; + }; + + security.sudo = { + enable = true; + extraConfig = "wheel ALL=(ALL:ALL) SETENV: ALL"; + }; + + # This value determines the NixOS release with which your system is to be + # compatible, in order to avoid breaking some software such as database + # servers. You should change this only after NixOS release notes say you + # should. + system.stateVersion = "18.03"; # Did you read the comment? +} diff --git a/infra/nixos/desktop.nix b/infra/nixos/desktop.nix new file mode 100644 index 0000000000..07a6274a56 --- /dev/null +++ b/infra/nixos/desktop.nix @@ -0,0 +1,82 @@ +# Configuration for the desktop environment + +{ config, lib, pkgs, ... }: + +let emacs = import ./emacs.nix { inherit pkgs; }; +screenLock = pkgs.writeShellScriptBin "screen-lock" '' + find ${pkgs.wallpapers} -name "*.png" | shuf -n1 | xargs i3lock -f -t -i +''; +in { + # Configure basic X-server stuff: + services.xserver = { + enable = true; + layout = "us,no"; + xkbOptions = "caps:super, grp:shifts_toggle, parens:swap_brackets"; + exportConfiguration = true; + + # Give EXWM permission to control the session. + displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER"; + + # Use the pre 18.09 default display manager (slim) + displayManager.slim.enable = true; + }; + + # Add a shell script with random screen lock wallpaper selection + environment.systemPackages = [ screenLock ]; + + # Apparently when you have house guests they complain about your screen tearing! + services.compton.enable = true; + services.compton.backend = "xrender"; + + # Configure desktop environment: + services.xserver.windowManager.session = lib.singleton { + name = "exwm"; + start = '' + ${emacs}/bin/emacs --eval '(progn (server-start) (exwm-enable))' + ''; + }; + + # Configure Redshift for Oslo + services.redshift = { + enable = true; + latitude = "59.911491"; + longitude = "10.757933"; + }; + + # Configure fonts + fonts = { + fonts = with pkgs; [ + corefonts + font-awesome-ttf + input-fonts + noto-fonts-cjk + noto-fonts-emoji + powerline-fonts + helvetica-neue-lt-std + ]; + }; + + # Configure random setting of wallpapers + systemd.user.services.feh-wp = { + description = "Randomly set wallpaper via feh"; + serviceConfig = { + Type = "oneshot"; + WorkingDirectory = "${pkgs.wallpapers}/share/wallpapers"; + + # Manually shuffle because feh's --randomize option can't be restricted to + # just certain file types. + ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'"; + }; + }; + + systemd.user.timers.feh-wp = { + description = "Set a random wallpaper every hour"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + + timerConfig = { + OnActiveSec = "1second"; + OnUnitActiveSec = "1hour"; + }; + }; +} diff --git a/infra/nixos/dotfiles.nix b/infra/nixos/dotfiles.nix new file mode 100644 index 0000000000..2e952207d4 --- /dev/null +++ b/infra/nixos/dotfiles.nix @@ -0,0 +1,27 @@ +# Bundle configuration files into a derivation. +# I call this derivation dotfiles despite that not technically being true +# anymore ... + +{ config, pkgs, ...}: + +let dotfiles = pkgs.stdenv.mkDerivation { + name = "tazjins-dotfiles"; + + srcs = [ + ./dotfiles + ]; + + installPhase = '' + mkdir -p $out + cp ./* $out/ + ''; +}; +in { + # /etc/ is a special place in NixOS! + # Symlinks that need to be created there must be specified explicitly. + environment.etc = { + "alacritty.yml".source = "${dotfiles}/alacritty.yml"; + "fish/config.fish".source = "${dotfiles}/config.fish"; + "tmux.conf".source = "${dotfiles}/tmux.conf"; + }; +} diff --git a/infra/nixos/dotfiles/alacritty.yml b/infra/nixos/dotfiles/alacritty.yml new file mode 100644 index 0000000000..d229fbdde6 --- /dev/null +++ b/infra/nixos/dotfiles/alacritty.yml @@ -0,0 +1,203 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator + +# Any items in the `env` entry below will be added as +# environment variables. Some entries may override variables +# set by alacritty it self. +env: + TERM: xterm-256color + +window: + # TODO + decorations: full + +scrolling: + history: 10000 + multiplier: 3 + faux_multiplier: 3 + auto_scroll: true # TODO + +# Display tabs using this many cells (changes require restart) +tabspaces: 4 + +# When true, bold text is drawn using the bright variant of colors. +draw_bold_text_with_bright_colors: true + +# Font configuration (changes require restart) +font: + # The normal (roman) font face to use. + normal: + family: Input Mono + bold: + family: Input Mono + italic: + family: Input Mono + + # Point size of the font + size: 12.0 + + # Scale the font size based on the monitor's DPI. + scale_with_dpi: false + +# Use custom cursor colors. If true, display the cursor in the cursor.foreground +# and cursor.background colors, otherwise invert the colors of the cursor. +custom_cursor_colors: false + +# Colors (Gruber Darker) +colors: + # Default colors + primary: + background: '0x181818' + foreground: '0xe4e4ef' + + # Colors the cursor will use if `custom_cursor_colors` is true + cursor: + text: '0x000000' + cursor: '0xf5f5f5' + + # Normal colors + normal: + black: '0x282828' + red: '0xf43841' + green: '0x73c936' + yellow: '0xffdd33' + blue: '0x96a6c8' + magenta: '0x9e95c7' + cyan: '0x1fad83' + white: '0xf5f5f5' + + # Bright colors + bright: + black: '0x484848' + red: '0xff4f58' + green: '0x73c936' + yellow: '0xffdd33' + blue: '0x5f627f' + magenta: '0x9e95c7' + cyan: '0x1fad83' + white: '0xffffff' + +# Background opacity +# Key bindings +# +# Each binding is defined as an object with some properties. Most of the +# properties are optional. All of the alphabetical keys should have a letter for +# the `key` value such as `V`. Function keys are probably what you would expect +# as well (F1, F2, ..). The number keys above the main keyboard are encoded as +# `Key1`, `Key2`, etc. Keys on the number pad are encoded `Number1`, `Number2`, +# etc. These all match the glutin::VirtualKeyCode variants. +# +# Possible values for `mods` +# `Command`, `Super` refer to the super/command/windows key +# `Control` for the control key +# `Shift` for the Shift key +# `Alt` and `Option` refer to alt/option +# +# mods may be combined with a `|`. For example, requiring control and shift +# looks like: +# +# mods: Control|Shift +# +# The parser is currently quite sensitive to whitespace and capitalization - +# capitalization must match exactly, and piped items must not have whitespace +# around them. +# +# Either an `action`, `chars`, or `command` field must be present. +# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`. +# `chars` writes the specified string every time that binding is activated. +# These should generally be escape sequences, but they can be configured to +# send arbitrary strings of bytes. +# `command` must be a map containing a `program` string, and `args` array of +# strings. For example: +# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } } +# +# Want to add a binding (e.g. "PageUp") but are unsure what the X sequence +# (e.g. "\x1b[5~") is? Open another terminal (like xterm) without tmux, +# then run `showkey -a` to get the sequence associated to a key combination. +key_bindings: + - { key: V, mods: Control|Shift, action: Paste } + - { key: C, mods: Control|Shift, action: Copy } + - { key: Q, mods: Command, action: Quit } + - { key: W, mods: Command, action: Quit } + - { key: Insert, mods: Shift, action: PasteSelection } + - { key: Home, chars: "\x1bOH", mode: AppCursor } + - { key: Home, chars: "\x1b[H", mode: ~AppCursor } + - { key: End, chars: "\x1bOF", mode: AppCursor } + - { key: End, chars: "\x1b[F", mode: ~AppCursor } + - { key: PageUp, mods: Shift, chars: "\x1b[5;2~" } + - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } + - { key: PageUp, chars: "\x1b[5~" } + - { key: PageDown, mods: Shift, chars: "\x1b[6;2~" } + - { key: PageDown, mods: Control, chars: "\x1b[6;5~" } + - { key: PageDown, chars: "\x1b[6~" } + - { key: Left, mods: Shift, chars: "\x1b[1;2D" } + - { key: Left, mods: Control, chars: "\x1b[1;5D" } + - { key: Left, mods: Alt, chars: "\x1b[1;3D" } + - { key: Left, chars: "\x1b[D", mode: ~AppCursor } + - { key: Left, chars: "\x1bOD", mode: AppCursor } + - { key: Right, mods: Shift, chars: "\x1b[1;2C" } + - { key: Right, mods: Control, chars: "\x1b[1;5C" } + - { key: Right, mods: Alt, chars: "\x1b[1;3C" } + - { key: Right, chars: "\x1b[C", mode: ~AppCursor } + - { key: Right, chars: "\x1bOC", mode: AppCursor } + - { key: Up, mods: Shift, chars: "\x1b[1;2A" } + - { key: Up, mods: Control, chars: "\x1b[1;5A" } + - { key: Up, mods: Alt, chars: "\x1b[1;3A" } + - { key: Up, chars: "\x1b[A", mode: ~AppCursor } + - { key: Up, chars: "\x1bOA", mode: AppCursor } + - { key: Down, mods: Shift, chars: "\x1b[1;2B" } + - { key: Down, mods: Control, chars: "\x1b[1;5B" } + - { key: Down, mods: Alt, chars: "\x1b[1;3B" } + - { key: Down, chars: "\x1b[B", mode: ~AppCursor } + - { key: Down, chars: "\x1bOB", mode: AppCursor } + - { key: Tab, mods: Shift, chars: "\x1b[Z" } + - { key: F1, chars: "\x1bOP" } + - { key: F2, chars: "\x1bOQ" } + - { key: F3, chars: "\x1bOR" } + - { key: F4, chars: "\x1bOS" } + - { key: F5, chars: "\x1b[15~" } + - { key: F6, chars: "\x1b[17~" } + - { key: F7, chars: "\x1b[18~" } + - { key: F8, chars: "\x1b[19~" } + - { key: F9, chars: "\x1b[20~" } + - { key: F10, chars: "\x1b[21~" } + - { key: F11, chars: "\x1b[23~" } + - { key: F12, chars: "\x1b[24~" } + - { key: Back, chars: "\x7f" } + - { key: Back, mods: Alt, chars: "\x1b\x7f" } + - { key: Insert, chars: "\x1b[2~" } + - { key: Delete, chars: "\x1b[3~" } + +# Mouse bindings +# +# Currently doesn't support modifiers. Both the `mouse` and `action` fields must +# be specified. +# +# Values for `mouse`: +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# Values for `action`: +# - Paste +# - PasteSelection +# - Copy (TODO) +mouse_bindings: + - { mouse: Middle, action: PasteSelection } + +mouse: + double_click: { threshold: 300 } + triple_click: { threshold: 300 } + +selection: + semantic_escape_chars: ",│`|:\"' ()[]{}<>" +background_opacity: 1.0 + +hide_cursor_when_typing: false + +# Live config reload (changes require restart) +live_config_reload: true + +# Disable visual bell +visual_bell: + duration: 0 diff --git a/infra/nixos/dotfiles/config.fish b/infra/nixos/dotfiles/config.fish new file mode 100644 index 0000000000..de2c99ae60 --- /dev/null +++ b/infra/nixos/dotfiles/config.fish @@ -0,0 +1,40 @@ +# Configure classic prompt +set fish_color_user --bold blue +set fish_color_cwd --bold white + +# Enable colour hints in VCS prompt: +set __fish_git_prompt_showcolorhints yes +set __fish_git_prompt_color_prefix purple +set __fish_git_prompt_color_suffix purple + +# Fish configuration +set fish_greeting "" +set PATH $HOME/.local/bin $HOME/.cargo/bin $PATH + +# Editor configuration +set -gx EDITOR "emacsclient" +set -gx ALTERNATE_EDITOR "emacs -q -nw" +set -gx VISUAL "emacsclient" + +# Miscellaneous +eval (direnv hook fish) + +# Useful command aliases +alias gpr 'git pull --rebase' +alias gco 'git checkout' +alias gf 'git fetch' +alias gap 'git add -p' +alias pbcopy 'xclip -selection clipboard' +alias edit 'emacsclient -n' +alias servedir 'nix-shell -p haskellPackages.wai-app-static --run warp' + +# Old habits die hard (also ls is just easier to type): +alias ls 'exa' + +# Fix up nix-env & friends for Nix 2.0 +export NIX_REMOTE=daemon + +# Fix display of fish in emacs' term-mode: +function fish_title + true +end diff --git a/infra/nixos/dotfiles/msmtprc b/infra/nixos/dotfiles/msmtprc new file mode 100644 index 0000000000..c6a9a7426a --- /dev/null +++ b/infra/nixos/dotfiles/msmtprc @@ -0,0 +1,24 @@ +defaults + +port 587 +tls on +tls_trust_file /etc/ssl/certs/ca-certificates.crt + +# Aprila mail +account aprila +from vincent@aprila.no +host smtp.office365.com +auth on +user vincent@aprila.no +passwordeval pass show aprila/office365-mail + +# Runbox mail +account runbox +from mail@tazj.in +host mail.runbox.com +auth on +user mail@tazj.in +passwordeval pass show general/runbox-tazjin + +# Use Runbox as default +account default : runbox diff --git a/infra/nixos/dotfiles/notmuch-config b/infra/nixos/dotfiles/notmuch-config new file mode 100644 index 0000000000..eb8b2c79bb --- /dev/null +++ b/infra/nixos/dotfiles/notmuch-config @@ -0,0 +1,21 @@ +# .notmuch-config - Configuration file for the notmuch mail system +# +# For more information about notmuch, see https://notmuchmail.org + +[database] +path=/home/vincent/mail + +[user] +name=Vincent Ambo +primary_email=vincent@aprila.no +other_email=mail@tazj.in;tazjin@gmail.com; + +[new] +tags=unread;inbox; +ignore= + +[search] +exclude_tags=deleted;spam;draft; + +[maildir] +synchronize_flags=true diff --git a/infra/nixos/dotfiles/offlineimaprc b/infra/nixos/dotfiles/offlineimaprc new file mode 100644 index 0000000000..dd4752f4c3 --- /dev/null +++ b/infra/nixos/dotfiles/offlineimaprc @@ -0,0 +1,61 @@ +[general] +accounts = aprila, tazjin, gmail + +[DEFAULT] +ssl = yes +sslcacertfile = /etc/ssl/certs/ca-certificates.crt + +# Main work account: +[Account aprila] +localrepository = aprila-local +remoterepository = aprila-remote + +[Repository aprila-local] +type = Maildir +localfolders = ~/mail/aprila + +[Repository aprila-remote] +type = IMAP +remotehost = outlook.office365.com +remoteuser = vincent@aprila.no +remotepassfile = ~/.config/mail/aprila-pass +# Office365 is a naughty boy when it comes to IMAP. Even worse, they +# also seem to have decided that they should change IMAP folder names +# based on the UI language. +# +# I can't be bothered to implement the entire (relatively long) +# blacklist, so I'll instead whitelist relevant folders: +folderfilter = lambda folder: folder in ['INBOX', 'Arkiv', 'Sende element'] + +# Private GMail account (old): +[Account gmail] +maxage = 90 +localrepository = gmail-local +remoterepository = gmail-remote +synclabels = yes + +[Repository gmail-local] +type = GmailMaildir +localfolders = ~/mail/gmail + +[Repository gmail-remote] +type = Gmail +remoteuser = tazjin@gmail.com +remotepassfile = ~/.config/mail/gmail-pass +folderfilter = lambda folder: folder == 'INBOX' + +# Main private account: +[Account tazjin] +localrepository = tazjin-local +remoterepository = tazjin-remote + +[Repository tazjin-local] +type = Maildir +localfolders = ~/mail/tazjin + +[Repository tazjin-remote] +type = IMAP +remotehost = mail.runbox.com +remoteuser = mail@tazj.in +remotepassfile = ~/.config/mail/tazjin-pass +auth_mechanisms = LOGIN diff --git a/infra/nixos/dotfiles/tmux.conf b/infra/nixos/dotfiles/tmux.conf new file mode 100644 index 0000000000..6c20ae0370 --- /dev/null +++ b/infra/nixos/dotfiles/tmux.conf @@ -0,0 +1,14 @@ +set -g status off +set -gw mode-keys emacs +setw -g mouse on + +# Correctly set window titles +set -g set-titles on +set -g set-titles-string "#W (#T)" + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-yank' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' diff --git a/infra/nixos/emacs.nix b/infra/nixos/emacs.nix new file mode 100644 index 0000000000..24426bc438 --- /dev/null +++ b/infra/nixos/emacs.nix @@ -0,0 +1,138 @@ +# Derivation for Emacs pre-configured with packages that I need. +# +# TODO: Fix sly (again) + +{ pkgs }: + +with pkgs; with emacsPackagesNg; +let emacsWithPackages = (emacsPackagesNgGen emacs).emacsWithPackages; + +# As the EXWM-README points out, XELB should be built from source if +# EXWM is. +xelb = melpaBuild { + pname = "xelb"; + ename = "xelb"; + version = "0.15"; + recipe = builtins.toFile "recipe" '' + (xelb :fetcher github + :repo "ch11ng/xelb") + ''; + + packageRequires = [ cl-generic emacs ]; + + src = fetchFromGitHub { + owner = "ch11ng"; + repo = "xelb"; + rev = "b8f168b401977098fe2b30f4ca32629c0ab6eb83"; + sha256 = "1ack1h68x8ia0ji6wbhmayrakq35p5sgrrl6qvha3ns3pswc0pl9"; + }; +}; + +# EXWM pinned to a newer version than what is released due to a +# potential fix for ch11ng/exwm#425. +exwm = melpaBuild { + pname = "exwm"; + ename = "exwm"; + version = "0.19"; + recipe = builtins.toFile "recipe" '' + (exwm :fetcher github + :repo "ch11ng/exwm") + ''; + + packageRequires = [ xelb ]; + + src = fetchFromGitHub { + owner = "ch11ng"; + repo = "exwm"; + rev = "472f7cb82b67b98843f10c12e6bda9b8ae7262bc"; + sha256 = "19gflsrb19aijf2xcw7j2m658qad21nbwziw38s1h2jw66vhk8dj"; + }; +}; + +slyFixed = sly.overrideAttrs(_: { + recipe = builtins.toFile "recipe" '' +(sly :repo "joaotavora/sly" + :fetcher github + :files ("*.el" + ("lib" "lib/*") + ("contrib" "contrib/*") + "doc/*.texi" + "doc/*.info" + "doc/dir")) +''; +}); + +in emacsWithPackages(epkgs: + # Actual ELPA packages (the enlightened!) + (with epkgs.elpaPackages; [ + ace-window + avy + company + pinentry + rainbow-mode + undo-tree + which-key + ]) ++ + + # MELPA packages: + (with epkgs.melpaPackages; [ + browse-kill-ring + cargo + counsel + counsel-notmuch + dash + dash-functional + dockerfile-mode + edit-server + eglot + elixir-mode + erlang + elm-mode + exwm + go-mode + gruber-darker-theme + haskell-mode + ht + hydra + idle-highlight-mode + intero + ivy + ivy-pass + ivy-prescient + jq-mode + kotlin-mode + magit + markdown-mode + markdown-toc + meghanada + multi-term + multiple-cursors + nginx-mode + nix-mode + omnisharp + paredit + password-store + pg + pkgs.notmuch + prescient + rainbow-delimiters + restclient + rust-mode + s + slyFixed + smartparens + string-edit + swiper + telephone-line + terraform-mode + toml-mode + use-package + uuidgen + web-mode + websocket + yaml-mode + ]) ++ + + # Custom packaged Emacs packages: + [ xelb exwm ] +) diff --git a/infra/nixos/home.nix b/infra/nixos/home.nix new file mode 100644 index 0000000000..236091cb01 --- /dev/null +++ b/infra/nixos/home.nix @@ -0,0 +1,75 @@ +# home-manager configuration used on ChromeOS systems + +{ config, pkgs, ... }: + +{ + # Allow non-free software (fonts, IDEA, etc.): + nixpkgs.config.allowUnfree = true; + + # Install various useful packages: + home.packages = with pkgs; [ + bat + exa + gnupg + google-cloud-sdk + htop + pass + ripgrep + tdesktop + transmission + tree + + # Fonts to make available in X11 applications: + input-fonts + + # Emacs configuration stays in the normal ~/.emacs.d location (for + # now), hence this package is not installed via `programs.emacs`. + (import ./emacs.nix { inherit pkgs; }) + ]; + + programs.git = { + enable = true; + userEmail = "mail@tazj.in"; + userName = "Vincent Ambo"; + }; + + services.gpg-agent = { + enable = true; + extraConfig = '' + pinentry-program ${pkgs.pinentry}/bin/pinentry-gtk-2 + allow-emacs-pinentry + ''; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + manual.html.enable = true; + + # Shell configuration + # + # There are some differences between the ChromeOS / NixOS + # configurations, so instead of fixing up the dotfile to support + # both I opted for keeping the configuration here. + programs.fish = { + enable = true; + interactiveShellInit = '' + # Configure classic prompt + set fish_color_user --bold blue + set fish_color_cwd --bold white + + # Enable colour hints in VCS prompt: + set __fish_git_prompt_showcolorhints yes + set __fish_git_prompt_color_prefix purple + set __fish_git_prompt_color_suffix purple + + # Fish configuration + set fish_greeting "" + + # Fix up nix-env & friends for Nix 2.0 + export NIX_REMOTE=daemon + ''; + }; + + # Ensure fonts installed via Nix are picked up. + fonts.fontconfig.enableProfileFonts = true; +} diff --git a/infra/nixos/mail.nix b/infra/nixos/mail.nix new file mode 100644 index 0000000000..a9375a1eea --- /dev/null +++ b/infra/nixos/mail.nix @@ -0,0 +1,83 @@ +# This file configures offlineimap, notmuch and MSMTP. +# +# Some manual configuration is required the first time this is +# applied: +# +# 1. Credential setup. +# 2. Linking of MSMTP config (ln -s /etc/msmtprc ~/.msmtprc) +# 3. Linking of notmuch config (ln -s /etc/notmuch-config ~/.notmuch-config) + +{ config, lib, pkgs, ... }: + +let offlineImapConfig = pkgs.writeText "offlineimaprc" + (builtins.readFile ./dotfiles/offlineimaprc); + +msmtpConfig = pkgs.writeText "msmtprc" + (builtins.readFile ./dotfiles/msmtprc); + +notmuchConfig = pkgs.writeText "notmuch-config" + (builtins.readFile ./dotfiles/notmuch-config); + +tagConfig = pkgs.writeText "notmuch-tags" '' + # Tag emacs-devel mailing list: + -inbox +emacs-devel -- to:emacs-devel@gnu.org OR cc:emacs-devel@gnu.org + + # Tag nix-devel mailing list & discourse: + -inbox +nix-devel -- to:nix-devel@googlegroups.com OR from:nixos1@discoursemail.com + + # Filter out Gitlab mails: + -inbox +gitlab -- from:gitlab@aprila.no + + # Tag my own mail (from other devices) as sent: + -inbox +sent -- folder:"aprila/Sende element" OR from:vincent@aprila.no OR from:mail@tazj.in + + # Drafts are always read, duh. + -unread -- tag:draft + + # Tag development list + -inbox +aprila-dev -- to:dev@aprila.no OR cc:dev@aprila.no +''; + +notmuchIndex = pkgs.writeShellScriptBin "notmuch-index" '' + echo "Indexing new mails in notmuch" + + # Index new mail + ${pkgs.notmuch}/bin/notmuch new + + # Apply tags + cat ${tagConfig} | ${pkgs.notmuch}/bin/notmuch tag --batch + + echo "Done indexing new mails" +''; +in { + # Enable OfflineIMAP timer & service: + systemd.user.timers.offlineimap = { + description = "OfflineIMAP timer"; + wantedBy = [ "timers.target" ]; + + timerConfig = { + Unit = "offlineimap.service"; + OnCalendar = "*:0/2"; # every 2 minutes + Persistent = "true"; # persist timer state after reboots + }; + }; + + systemd.user.services.offlineimap = { + description = "OfflineIMAP service"; + path = with pkgs; [ pass notmuch ]; + + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.offlineimap}/bin/offlineimap -u syslog -o -c ${offlineImapConfig}"; + ExecStartPost = "${notmuchIndex}/bin/notmuch-index"; + TimeoutStartSec = "2min"; + }; + }; + + # Link configuration files to /etc/ (from where they will be linked + # further): + environment.etc = { + "msmtprc".source = msmtpConfig; + "notmuch-config".source = notmuchConfig; + }; +} diff --git a/infra/nixos/packages.nix b/infra/nixos/packages.nix new file mode 100644 index 0000000000..b90a4a9ee8 --- /dev/null +++ b/infra/nixos/packages.nix @@ -0,0 +1,132 @@ +# This file contains configuration for packages to install. +# It does not contain configuration for software that is already covered +# by other NixOS options (e.g. emacs) + +{ config, pkgs, ... }: + +let + fetchChannel = { rev, sha256 }: import (fetchTarball { + inherit sha256; + url = "https://github.com/NixOS/nixpkgs-channels/archive/${rev}.tar.gz"; + }) { config.allowUnfree = true; }; + + # Channels last updated: 2018-10-10 + # + # Instead of relying on Nix channels and ending up with out-of-sync + # situations between machines, the commit for the stable Nix channel + # is pinned here. + stable = fetchChannel { + rev = "d96c7a356383302db4426a0d5a8383af921d964f"; + sha256 = "0hlhczh3m077rwrhp4smf3zd2sfj38h2c126bycv66m0aff0gycn"; + }; + + # Certain packages from unstable are hand-picked into the package + # set. + unstable = fetchChannel { + rev = "32bcd72bf28a971c9063a9cdcc32effe49f49331"; + sha256 = "1f74m18r6xl9s55jbkj9bjhdxg2489kwjam4d96pf9rzq0i1f8li"; + }; +in { + # Configure the Nix package manager + nixpkgs = { + config.allowUnfree = true; + # To use the pinned channel, the original package set is thrown + # away in the overrides: + config.packageOverrides = oldPkgs: stable // { + # Store whole unstable channel in case that other modules need + # it (see emacs.nix for example): + inherit unstable; + + # Backport Exa from unstable until a fix for the Rust builder is + # backported. + # + # https://github.com/NixOS/nixpkgs/pull/48020 + exa = unstable.exa; + + wallpapers = import ./pkgs/wallpapers.nix; + pulseaudio-ctl = import pkgs/pulseaudio-ctl.nix; + }; + }; + + # ... and declare packages to be installed. + environment.systemPackages = with pkgs; [ + # Default nixos.* packages: + alacritty + binutils-unwrapped + chromium + curl + direnv + dnsutils + dotnet-sdk + evince + exa + extremetuxracer + fd + file + firefox-unwrapped + fish + gcc + git + gnumake + gnupg + google-cloud-sdk + gopass + hicolor-icon-theme + htop + i3lock + iftop + jq + kontemplate + kubernetes + lispPackages.quicklisp + lxappearance-gtk3 + manpages + maven + mono + mq-cli + msmtp + ngrok + notmuch + numix-cursor-theme + numix-gtk-theme + numix-icon-theme + offlineimap + openjdk + openssl + openssl.dev + pass + pavucontrol + pkgconfig + pulseaudio-ctl + pwgen + ripgrep + rustup + sbcl + screen + siege + spotify + stdmanpages + systemd.dev + tdesktop + terraform + tig + tmux + tokei + transmission + tree + units + unzip + vlc + xclip + xfce.xfce4-screenshooter + + # Haskell packages: + cabal-install + ghc + hlint + stack + stack2nix + haskellPackages.stylish-haskell + haskellPackages.yesod-bin + ]; +} diff --git a/infra/nixos/pkgs/pulseaudio-ctl.nix b/infra/nixos/pkgs/pulseaudio-ctl.nix new file mode 100644 index 0000000000..9651ea097f --- /dev/null +++ b/infra/nixos/pkgs/pulseaudio-ctl.nix @@ -0,0 +1,26 @@ +with import {}; + +stdenv.mkDerivation rec { + name = "pulseaudio-ctl-${version}"; + version = "v1.66"; + + src = fetchzip { + url = "https://github.com/graysky2/pulseaudio-ctl/archive/${version}.tar.gz"; + sha256 = "19a24w7y19551ar41q848w7r1imqkl9cpff4dpb7yry7qp1yjg0y"; + }; + + buildFlags = ''PREFIX=$(out)''; + + # Force Nix to detect the runtime dependency on 'bc' + preInstall = '' + sed -i 's|bc)|${bc}/bin/bc)|g' common/pulseaudio-ctl + ''; + + installFlags = ''PREFIX=$(out)''; + + meta = with stdenv.lib; { + description = "Control pulseaudio volume from the shell or mapped to keyboard shortcuts"; + homepage = "https://github.com/graysky2/pulseaudio-ctl"; + license = licenses.mit; + }; +} diff --git a/infra/nixos/pkgs/wallpapers.nix b/infra/nixos/pkgs/wallpapers.nix new file mode 100644 index 0000000000..3a26a54fb7 --- /dev/null +++ b/infra/nixos/pkgs/wallpapers.nix @@ -0,0 +1,22 @@ +# Fetch my wallpapers from git +with import {}; + +stdenv.mkDerivation { + name = "tazjins-wallpapers-1"; + + src = fetchgit { + url = "https://git.tazj.in/tazjin/wallpapers.git"; + rev = "3bce73b605ba5f848cb4e7cc33058a2be3952c68"; + sha256 = "1gjlazag7x005sf2bd6a7dw5p9ry5vjgzmvycsyiw3pv9b1gzc0j"; + }; + + installPhase = '' + mkdir -p $out/share/wallpapers + cp -r $src/* $out/share/wallpapers + ''; + + meta = with stdenv.lib; { + description = "tazjin's wallpaper collection"; + platforms = platforms.all; + }; +} diff --git a/infra/nixos/stallo-configuration.nix b/infra/nixos/stallo-configuration.nix new file mode 100644 index 0000000000..4af4a5fd4c --- /dev/null +++ b/infra/nixos/stallo-configuration.nix @@ -0,0 +1,39 @@ +# Local configuration for 'stallo' (Home desktop PC) +{ config, pkgs, ...}: + +{ + boot.initrd.luks.devices.stallo-luks.device = "/dev/disk/by-uuid/b484cf1e-a27b-4785-8bd6-fa85a004b073"; + + # Use proprietary nvidia driver + services.xserver.videoDrivers = [ "nvidia" ]; + + # Enable 32-bit compatibility for Steam: + hardware.opengl.driSupport32Bit = true; + hardware.pulseaudio.support32Bit = true; + + # Wine for Blizzard stuff + environment.systemPackages = with pkgs.unstable; [ wineWowPackages.staging winetricks ]; + + networking = { + hostName = "stallo"; + wireless.enable = true; + wireless.networks = { + # Welcome to roast club! + + "How do I computer fast?" = { + psk = "washyourface"; + # Prefer 5Ghz unless the card is acting up. + priority = 10; + }; + + "How do I computer?" = { + psk = "washyourface"; + }; + }; + # IPv6 at home, of course: + nameservers = [ + "2606:4700:4700::1111" + "2606:4700:4700::1001" + ]; + }; +} diff --git a/mail.nix b/mail.nix deleted file mode 100644 index a9375a1eea..0000000000 --- a/mail.nix +++ /dev/null @@ -1,83 +0,0 @@ -# This file configures offlineimap, notmuch and MSMTP. -# -# Some manual configuration is required the first time this is -# applied: -# -# 1. Credential setup. -# 2. Linking of MSMTP config (ln -s /etc/msmtprc ~/.msmtprc) -# 3. Linking of notmuch config (ln -s /etc/notmuch-config ~/.notmuch-config) - -{ config, lib, pkgs, ... }: - -let offlineImapConfig = pkgs.writeText "offlineimaprc" - (builtins.readFile ./dotfiles/offlineimaprc); - -msmtpConfig = pkgs.writeText "msmtprc" - (builtins.readFile ./dotfiles/msmtprc); - -notmuchConfig = pkgs.writeText "notmuch-config" - (builtins.readFile ./dotfiles/notmuch-config); - -tagConfig = pkgs.writeText "notmuch-tags" '' - # Tag emacs-devel mailing list: - -inbox +emacs-devel -- to:emacs-devel@gnu.org OR cc:emacs-devel@gnu.org - - # Tag nix-devel mailing list & discourse: - -inbox +nix-devel -- to:nix-devel@googlegroups.com OR from:nixos1@discoursemail.com - - # Filter out Gitlab mails: - -inbox +gitlab -- from:gitlab@aprila.no - - # Tag my own mail (from other devices) as sent: - -inbox +sent -- folder:"aprila/Sende element" OR from:vincent@aprila.no OR from:mail@tazj.in - - # Drafts are always read, duh. - -unread -- tag:draft - - # Tag development list - -inbox +aprila-dev -- to:dev@aprila.no OR cc:dev@aprila.no -''; - -notmuchIndex = pkgs.writeShellScriptBin "notmuch-index" '' - echo "Indexing new mails in notmuch" - - # Index new mail - ${pkgs.notmuch}/bin/notmuch new - - # Apply tags - cat ${tagConfig} | ${pkgs.notmuch}/bin/notmuch tag --batch - - echo "Done indexing new mails" -''; -in { - # Enable OfflineIMAP timer & service: - systemd.user.timers.offlineimap = { - description = "OfflineIMAP timer"; - wantedBy = [ "timers.target" ]; - - timerConfig = { - Unit = "offlineimap.service"; - OnCalendar = "*:0/2"; # every 2 minutes - Persistent = "true"; # persist timer state after reboots - }; - }; - - systemd.user.services.offlineimap = { - description = "OfflineIMAP service"; - path = with pkgs; [ pass notmuch ]; - - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.offlineimap}/bin/offlineimap -u syslog -o -c ${offlineImapConfig}"; - ExecStartPost = "${notmuchIndex}/bin/notmuch-index"; - TimeoutStartSec = "2min"; - }; - }; - - # Link configuration files to /etc/ (from where they will be linked - # further): - environment.etc = { - "msmtprc".source = msmtpConfig; - "notmuch-config".source = notmuchConfig; - }; -} diff --git a/packages.nix b/packages.nix deleted file mode 100644 index b90a4a9ee8..0000000000 --- a/packages.nix +++ /dev/null @@ -1,132 +0,0 @@ -# This file contains configuration for packages to install. -# It does not contain configuration for software that is already covered -# by other NixOS options (e.g. emacs) - -{ config, pkgs, ... }: - -let - fetchChannel = { rev, sha256 }: import (fetchTarball { - inherit sha256; - url = "https://github.com/NixOS/nixpkgs-channels/archive/${rev}.tar.gz"; - }) { config.allowUnfree = true; }; - - # Channels last updated: 2018-10-10 - # - # Instead of relying on Nix channels and ending up with out-of-sync - # situations between machines, the commit for the stable Nix channel - # is pinned here. - stable = fetchChannel { - rev = "d96c7a356383302db4426a0d5a8383af921d964f"; - sha256 = "0hlhczh3m077rwrhp4smf3zd2sfj38h2c126bycv66m0aff0gycn"; - }; - - # Certain packages from unstable are hand-picked into the package - # set. - unstable = fetchChannel { - rev = "32bcd72bf28a971c9063a9cdcc32effe49f49331"; - sha256 = "1f74m18r6xl9s55jbkj9bjhdxg2489kwjam4d96pf9rzq0i1f8li"; - }; -in { - # Configure the Nix package manager - nixpkgs = { - config.allowUnfree = true; - # To use the pinned channel, the original package set is thrown - # away in the overrides: - config.packageOverrides = oldPkgs: stable // { - # Store whole unstable channel in case that other modules need - # it (see emacs.nix for example): - inherit unstable; - - # Backport Exa from unstable until a fix for the Rust builder is - # backported. - # - # https://github.com/NixOS/nixpkgs/pull/48020 - exa = unstable.exa; - - wallpapers = import ./pkgs/wallpapers.nix; - pulseaudio-ctl = import pkgs/pulseaudio-ctl.nix; - }; - }; - - # ... and declare packages to be installed. - environment.systemPackages = with pkgs; [ - # Default nixos.* packages: - alacritty - binutils-unwrapped - chromium - curl - direnv - dnsutils - dotnet-sdk - evince - exa - extremetuxracer - fd - file - firefox-unwrapped - fish - gcc - git - gnumake - gnupg - google-cloud-sdk - gopass - hicolor-icon-theme - htop - i3lock - iftop - jq - kontemplate - kubernetes - lispPackages.quicklisp - lxappearance-gtk3 - manpages - maven - mono - mq-cli - msmtp - ngrok - notmuch - numix-cursor-theme - numix-gtk-theme - numix-icon-theme - offlineimap - openjdk - openssl - openssl.dev - pass - pavucontrol - pkgconfig - pulseaudio-ctl - pwgen - ripgrep - rustup - sbcl - screen - siege - spotify - stdmanpages - systemd.dev - tdesktop - terraform - tig - tmux - tokei - transmission - tree - units - unzip - vlc - xclip - xfce.xfce4-screenshooter - - # Haskell packages: - cabal-install - ghc - hlint - stack - stack2nix - haskellPackages.stylish-haskell - haskellPackages.yesod-bin - ]; -} diff --git a/pkgs/pulseaudio-ctl.nix b/pkgs/pulseaudio-ctl.nix deleted file mode 100644 index 9651ea097f..0000000000 --- a/pkgs/pulseaudio-ctl.nix +++ /dev/null @@ -1,26 +0,0 @@ -with import {}; - -stdenv.mkDerivation rec { - name = "pulseaudio-ctl-${version}"; - version = "v1.66"; - - src = fetchzip { - url = "https://github.com/graysky2/pulseaudio-ctl/archive/${version}.tar.gz"; - sha256 = "19a24w7y19551ar41q848w7r1imqkl9cpff4dpb7yry7qp1yjg0y"; - }; - - buildFlags = ''PREFIX=$(out)''; - - # Force Nix to detect the runtime dependency on 'bc' - preInstall = '' - sed -i 's|bc)|${bc}/bin/bc)|g' common/pulseaudio-ctl - ''; - - installFlags = ''PREFIX=$(out)''; - - meta = with stdenv.lib; { - description = "Control pulseaudio volume from the shell or mapped to keyboard shortcuts"; - homepage = "https://github.com/graysky2/pulseaudio-ctl"; - license = licenses.mit; - }; -} diff --git a/pkgs/wallpapers.nix b/pkgs/wallpapers.nix deleted file mode 100644 index 3a26a54fb7..0000000000 --- a/pkgs/wallpapers.nix +++ /dev/null @@ -1,22 +0,0 @@ -# Fetch my wallpapers from git -with import {}; - -stdenv.mkDerivation { - name = "tazjins-wallpapers-1"; - - src = fetchgit { - url = "https://git.tazj.in/tazjin/wallpapers.git"; - rev = "3bce73b605ba5f848cb4e7cc33058a2be3952c68"; - sha256 = "1gjlazag7x005sf2bd6a7dw5p9ry5vjgzmvycsyiw3pv9b1gzc0j"; - }; - - installPhase = '' - mkdir -p $out/share/wallpapers - cp -r $src/* $out/share/wallpapers - ''; - - meta = with stdenv.lib; { - description = "tazjin's wallpaper collection"; - platforms = platforms.all; - }; -} diff --git a/stallo-configuration.nix b/stallo-configuration.nix deleted file mode 100644 index 4af4a5fd4c..0000000000 --- a/stallo-configuration.nix +++ /dev/null @@ -1,39 +0,0 @@ -# Local configuration for 'stallo' (Home desktop PC) -{ config, pkgs, ...}: - -{ - boot.initrd.luks.devices.stallo-luks.device = "/dev/disk/by-uuid/b484cf1e-a27b-4785-8bd6-fa85a004b073"; - - # Use proprietary nvidia driver - services.xserver.videoDrivers = [ "nvidia" ]; - - # Enable 32-bit compatibility for Steam: - hardware.opengl.driSupport32Bit = true; - hardware.pulseaudio.support32Bit = true; - - # Wine for Blizzard stuff - environment.systemPackages = with pkgs.unstable; [ wineWowPackages.staging winetricks ]; - - networking = { - hostName = "stallo"; - wireless.enable = true; - wireless.networks = { - # Welcome to roast club! - - "How do I computer fast?" = { - psk = "washyourface"; - # Prefer 5Ghz unless the card is acting up. - priority = 10; - }; - - "How do I computer?" = { - psk = "washyourface"; - }; - }; - # IPv6 at home, of course: - nameservers = [ - "2606:4700:4700::1111" - "2606:4700:4700::1001" - ]; - }; -} -- cgit 1.4.1