From 91f87892e27abee249e331e5dd5997ac7f69cd2d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 13:42:47 +0200 Subject: Add readme --- README.org | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.org diff --git a/README.org b/README.org new file mode 100644 index 00000000..96b63e71 --- /dev/null +++ b/README.org @@ -0,0 +1,3 @@ +* nixos-configuration + +This repository is for my [[https://nixos.org/][NixOS]] configuration. -- cgit 1.4.1 From a6ecfec5e8401c10ab8bbddc39cd203b7c0eeac7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 13:53:45 +0200 Subject: Create entry point configuration for satoshipad --- machines/satoshipad.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 machines/satoshipad.nix diff --git a/machines/satoshipad.nix b/machines/satoshipad.nix new file mode 100644 index 00000000..40fa3c72 --- /dev/null +++ b/machines/satoshipad.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ]; + + networking.hostName = "satoshipad"; + + system.stateVersion = "17.03"; +} -- cgit 1.4.1 From beeb65621be5ccecb06c5994696599a282530625 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 13:54:24 +0200 Subject: Add grub2 module --- machines/satoshipad.nix | 1 + modules/grub2.nix | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 modules/grub2.nix diff --git a/machines/satoshipad.nix b/machines/satoshipad.nix index 40fa3c72..ff3a1046 100644 --- a/machines/satoshipad.nix +++ b/machines/satoshipad.nix @@ -3,6 +3,7 @@ { imports = [ ./hardware-configuration.nix + ./modules/grub2.nix ]; networking.hostName = "satoshipad"; diff --git a/modules/grub2.nix b/modules/grub2.nix new file mode 100644 index 00000000..6eaa8cc5 --- /dev/null +++ b/modules/grub2.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ boot.loader = { + grub = { + enable = true; + version = 2; + device = "nodev"; + efiSupport = true; + }; + efi.canTouchEfiVariables = true; + }; +} -- cgit 1.4.1 From d5e8695fa082b59de9807cc27af47d90c519ac55 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:05:41 +0200 Subject: Move entry point configs to root directory --- machines/satoshipad.nix | 12 ------------ satoshipad.nix | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 machines/satoshipad.nix create mode 100644 satoshipad.nix diff --git a/machines/satoshipad.nix b/machines/satoshipad.nix deleted file mode 100644 index ff3a1046..00000000 --- a/machines/satoshipad.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ - ./hardware-configuration.nix - ./modules/grub2.nix - ]; - - networking.hostName = "satoshipad"; - - system.stateVersion = "17.03"; -} diff --git a/satoshipad.nix b/satoshipad.nix new file mode 100644 index 00000000..ff3a1046 --- /dev/null +++ b/satoshipad.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ./modules/grub2.nix + ]; + + networking.hostName = "satoshipad"; + + system.stateVersion = "17.03"; +} -- cgit 1.4.1 From 057e1926729ababa1cc6533e6ff5b5e52575513d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:18:09 +0200 Subject: Create laptop-relevant modules --- modules/laptop.nix | 41 +++++++++++++++++++++++++++++++++++++++++ modules/thinkpad.nix | 31 +++++++++++++++++++++++++++++++ satoshipad.nix | 2 ++ 3 files changed, 74 insertions(+) create mode 100644 modules/laptop.nix create mode 100644 modules/thinkpad.nix diff --git a/modules/laptop.nix b/modules/laptop.nix new file mode 100644 index 00000000..17acb381 --- /dev/null +++ b/modules/laptop.nix @@ -0,0 +1,41 @@ +{ config, pkgs, ... }: + +{ boot.kernelModules = [ "coretemp" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + x86_energy_perf_policy + ]; + + hardware = { + bluetooth.enable = true; + }; + + environment.systemPackages = with pkgs; [ + powerstat + powertop + ]; + + programs.light.enable = true; + + services.logind.extraConfig = '' + IdleAction=suspend + IdleActionSec=600 + ''; + + services.tlp = { + enable = true; + extraConfig = '' + CPU_SCALING_GOVERNOR_ON_BAT=powersave + ''; + }; + + services.xserver = { + libinput = { + enable = true; + naturalScrolling = true; + disableWhileTyping = true; + }; + }; + + systemd.services.nixos-upgrade.unitConfig.ConditionACPower = true; + systemd.services.nix-gc.unitConfig.ConditionACPower = true; +} diff --git a/modules/thinkpad.nix b/modules/thinkpad.nix new file mode 100644 index 00000000..009e3f08 --- /dev/null +++ b/modules/thinkpad.nix @@ -0,0 +1,31 @@ +{ config, pkgs, ... }: + +{ boot.kernelModules = [ "tp_smapi" ]; + boot.blacklistedKernelModules = [ "thinkpad_ec" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + # acpi_call + tp_smapi + ]; + + hardware.trackpoint = { + enable = true; + emulateWheel = true; + }; + + services.thinkfan = { + enable = true; + sensor = "/sys/class/thermal/thermal_zone0/temp"; + }; + + services.tlp = { + enable = true; + extraConfig = '' + # Newer Thinkpads have a battery firmware + # it conflicts with TLP if stop thresholds are set + START_CHARGE_THRESH_BAT0=70 + STOP_CHARGE_THRESH_BAT0=80 + START_CHARGE_THRESH_BAT1=70 + STOP_CHARGE_THRESH_BAT1=80 + ''; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index ff3a1046..9d1cbe69 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -4,6 +4,8 @@ imports = [ ./hardware-configuration.nix ./modules/grub2.nix + ./modules/laptop.nix + ./modules/thinkpad.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 7b6b9247cde2aee34b09c738dcfa8966e0852d51 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:21:03 +0200 Subject: Add audio configuration --- modules/audio.nix | 12 ++++++++++++ satoshipad.nix | 1 + 2 files changed, 13 insertions(+) create mode 100644 modules/audio.nix diff --git a/modules/audio.nix b/modules/audio.nix new file mode 100644 index 00000000..f5046574 --- /dev/null +++ b/modules/audio.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ hardware.pulseaudio = { + enable = true; + support32Bit = true; + }; + + environment.systemPackages = with pkgs; [ + pamixer + pavucontrol + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 9d1cbe69..7002cf98 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -6,6 +6,7 @@ ./modules/grub2.nix ./modules/laptop.nix ./modules/thinkpad.nix + ./modules/audio.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From a5b0892e4f3d255d695f6a54219e1f5edf21c725 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:22:41 +0200 Subject: Add adb configuration --- modules/adb.nix | 9 +++++++++ satoshipad.nix | 1 + 2 files changed, 10 insertions(+) create mode 100644 modules/adb.nix diff --git a/modules/adb.nix b/modules/adb.nix new file mode 100644 index 00000000..8b511f55 --- /dev/null +++ b/modules/adb.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ programs.adb.enable = true; + users.groups.adbusers = {}; + + services.udev = { + packages = [ pkgs.android-udev-rules ]; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index 7002cf98..9f1f6f05 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -7,6 +7,7 @@ ./modules/laptop.nix ./modules/thinkpad.nix ./modules/audio.nix + ./modules/adb.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From c24e26149c78725b33c68b6bce46cc9fc79f9bea Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:25:02 +0200 Subject: Add syncthing configuration --- modules/syncthing.nix | 11 +++++++++++ satoshipad.nix | 1 + 2 files changed, 12 insertions(+) create mode 100644 modules/syncthing.nix diff --git a/modules/syncthing.nix b/modules/syncthing.nix new file mode 100644 index 00000000..9c9b7787 --- /dev/null +++ b/modules/syncthing.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ services.syncthing = { + enable = true; + user = "alan"; + group = "users"; + systemService = true; + useInotify = true; + dataDir = "/home/alan/.config/syncthing"; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index 9f1f6f05..687980f1 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -8,6 +8,7 @@ ./modules/thinkpad.nix ./modules/audio.nix ./modules/adb.nix + ./modules/syncthing.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 3bea12cd01499c02b0f5d8b33b658b529ebf9d1e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:41:35 +0200 Subject: Create hidpi configuration module --- modules/hidpi.nix | 9 +++++++++ satoshipad.nix | 1 + 2 files changed, 10 insertions(+) create mode 100644 modules/hidpi.nix diff --git a/modules/hidpi.nix b/modules/hidpi.nix new file mode 100644 index 00000000..1f4644c5 --- /dev/null +++ b/modules/hidpi.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ i18n = { + consoleFont = "ter-v24b"; + consolePackages = with pkgs; [ + terminus_font + ]; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index 687980f1..7bd39268 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -9,6 +9,7 @@ ./modules/audio.nix ./modules/adb.nix ./modules/syncthing.nix + ./modules/hidpi.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 7cff825c1df5494c6c070ad34f5288b9b7786cfc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:43:09 +0200 Subject: Add Nitrokey/GnuPG module --- modules/nitrokey.nix | 24 ++++++++++++++++++++++++ satoshipad.nix | 1 + 2 files changed, 25 insertions(+) create mode 100644 modules/nitrokey.nix diff --git a/modules/nitrokey.nix b/modules/nitrokey.nix new file mode 100644 index 00000000..a256c33d --- /dev/null +++ b/modules/nitrokey.nix @@ -0,0 +1,24 @@ +{ config, nixpkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ services.pcscd.enable = true; + + services.tor = { + enable = true; + client = { + enable = true; + socksListenAddress = "9050 IPv6Traffic"; + }; + torsocks = { + enable = true; + }; + }; + + environment.systemPackages = [ + pkgsUnstable.gnupg + pkgsUnstable.nitrokey-app + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 7bd39268..624ac593 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -10,6 +10,7 @@ ./modules/adb.nix ./modules/syncthing.nix ./modules/hidpi.nix + ./modules/nitrokey.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 679f00fb3203ec503c977da4e6dd9b9646212e7e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:49:58 +0200 Subject: Add shell module --- modules/shell.nix | 24 ++++++++++++++++++++++++ satoshipad.nix | 1 + 2 files changed, 25 insertions(+) create mode 100644 modules/shell.nix diff --git a/modules/shell.nix b/modules/shell.nix new file mode 100644 index 00000000..65982166 --- /dev/null +++ b/modules/shell.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: + +{ programs.zsh = { + enable = true; + promptInit = ""; + }; + programs.bash.enableCompletion = true; + + environment.systemPackages = with pkgs; [ + vim + pv + file + htop + lsof + iftop + nmap + netperf + psmisc + tree + zip + unzip + telnet + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 624ac593..354403fa 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -11,6 +11,7 @@ ./modules/syncthing.nix ./modules/hidpi.nix ./modules/nitrokey.nix + ./modules/shell.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 237e8d6f5d9f4ed9a98891d1486c3fa0a7d2fafe Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:53:45 +0200 Subject: Add dotfiles module --- modules/dotfiles.nix | 13 +++++++++++++ satoshipad.nix | 1 + 2 files changed, 14 insertions(+) create mode 100644 modules/dotfiles.nix diff --git a/modules/dotfiles.nix b/modules/dotfiles.nix new file mode 100644 index 00000000..eed22233 --- /dev/null +++ b/modules/dotfiles.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ environment.systemPackages = with pkgs; [ + git + stow + fzf + pkgsUnstable.ghq + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 354403fa..2e644c43 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -12,6 +12,7 @@ ./modules/hidpi.nix ./modules/nitrokey.nix ./modules/shell.nix + ./modules/dotfiles.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 2a7fdeb9dfa214e1eef0b7cdabc970b69e65c25d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:55:22 +0200 Subject: Add Berlin module --- modules/berlin.nix | 8 ++++++++ satoshipad.nix | 1 + 2 files changed, 9 insertions(+) create mode 100644 modules/berlin.nix diff --git a/modules/berlin.nix b/modules/berlin.nix new file mode 100644 index 00000000..a388a57a --- /dev/null +++ b/modules/berlin.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ time.timezone = "Europe/Berlin"; + redshift = { + latitude = "52.586"; + longitude = "13.300"; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index 2e644c43..ed688e21 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -13,6 +13,7 @@ ./modules/nitrokey.nix ./modules/shell.nix ./modules/dotfiles.nix + ./modules/berlin.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From cf85d19331d519f99ffd8652b6a279acfaa3f9be Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 14:57:39 +0200 Subject: Add colemak module --- modules/colemak.nix | 17 +++++++++++++++++ satoshipad.nix | 1 + 2 files changed, 18 insertions(+) create mode 100644 modules/colemak.nix diff --git a/modules/colemak.nix b/modules/colemak.nix new file mode 100644 index 00000000..53a4901e --- /dev/null +++ b/modules/colemak.nix @@ -0,0 +1,17 @@ +{ config, pkgs, ... }: + +{ i18n.consoleKeyMap = "colemak/en-latin9"; + kmscon = { + extraConfig = '' + xkb-model=pc104 + xkb-layout=us + xkb-variant=colemak + xkb-options="altwin:prtsc_rwin" + ''; + }; + xserver = { + layout = "us,us"; + xkbVariant = "colemak,"; + xkbOptions = "grp:shifts_toggle,altwin:prtsc_rwin"; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index ed688e21..923a3b26 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -14,6 +14,7 @@ ./modules/shell.nix ./modules/dotfiles.nix ./modules/berlin.nix + ./modules/colemak.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 97ae80b5109f6ad75bf9464d166db6860f76d7c0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 15:04:51 +0200 Subject: Add xserver modules --- modules/trackball.nix | 13 ++++++++ modules/xserver.nix | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++ satoshipad.nix | 2 ++ 3 files changed, 101 insertions(+) create mode 100644 modules/trackball.nix create mode 100644 modules/xserver.nix diff --git a/modules/trackball.nix b/modules/trackball.nix new file mode 100644 index 00000000..9aa5abc0 --- /dev/null +++ b/modules/trackball.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ services.xserver.config = '' + Section "InputClass" + Identifier "Trackball (No Acceleration)" + MatchIsPointer "yes" + MatchIsTouchpad "no" + MatchProduct "Trackball" + Option "AccelerationProfile" "-1" + Option "AccelerationScheme" "none" + EndSection + ''; +} diff --git a/modules/xserver.nix b/modules/xserver.nix new file mode 100644 index 00000000..45caef7a --- /dev/null +++ b/modules/xserver.nix @@ -0,0 +1,86 @@ +{ config, pkgs, ... }: + +{ services.xserver = { + enable = true; + enableCtrlAltBackspace = true; + exportConfiguration = true; + }; + + environment.sessionVariables = { + XCURSOR_PATH = [ + "${config.system.path}/share/icons" + "$HOME/.icons" + "$HOME/.nix-profile/share/icons/" + ]; + }; + + environment.systemPackages = with pkgs; [ + xorg.xmodmap + xorg.xinit + xorg.xev + xorg.xdpyinfo + xclip + + vanilla-dmz + + hicolor_icon_theme + adapta-gtk-theme + flat-plat + paper-gtk-theme + paper-icon-theme + numix-gtk-theme + numix-icon-theme + + gtk-engine-murrine + gtk_engines + ]; + + fonts = { + enableFontDir = true; + enableDefaultFonts = true; + fontconfig = { + defaultFonts = { + monospace = [ "Roboto Mono" ]; + sansSerif = [ "Noto Sans" ]; + serif = [ "Noto Serif" ]; + }; + ultimate = { + enable = true; + # presets: + # ultimate1 ultimate2 ultimate3 ultimate4 ultimate5 osx windowsxp + preset = "ultimate3"; + }; + }; + fonts = with pkgs; [ + anonymousPro + cantarell_fonts + carlito + cm_unicode + dejavu_fonts + fantasque-sans-mono + fira + fira-code + fira-mono + font-droid + font-awesome-ttf + hack-font + nerdfonts + iosevka + liberation_ttf + noto-fonts + mononoki + opensans-ttf + paratype-pt-mono + paratype-pt-sans + paratype-pt-serif + roboto + roboto-mono + source-code-pro + source-sans-pro + source-serif-pro + terminus_font + ubuntu_font_family + xorg.fontxfree86type1 + ]; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index 923a3b26..b5f48a0c 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -15,6 +15,8 @@ ./modules/dotfiles.nix ./modules/berlin.nix ./modules/colemak.nix + ./modules/trackball.nix + ./modules/xserver.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From a3761db1bf6df8cc4e58dbbdde75f10059dd6068 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 15:06:28 +0200 Subject: Add british-english module --- modules/british-english.nix | 4 ++++ satoshipad.nix | 1 + 2 files changed, 5 insertions(+) create mode 100644 modules/british-english.nix diff --git a/modules/british-english.nix b/modules/british-english.nix new file mode 100644 index 00000000..3ff93678 --- /dev/null +++ b/modules/british-english.nix @@ -0,0 +1,4 @@ +{ config, pkgs, ... }: + +{ i18n.defaultLocale = "en_GB.UTF-8"; +} diff --git a/satoshipad.nix b/satoshipad.nix index b5f48a0c..4b84ab53 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -17,6 +17,7 @@ ./modules/colemak.nix ./modules/trackball.nix ./modules/xserver.nix + ./modules/british-english.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From cca3a69947eb84d79c5816648cc104ad9b55623f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 15:13:50 +0200 Subject: Create more hardware modules --- modules/bare-metal.nix | 13 +++++++++++++ modules/intel-gpu.nix | 6 ++++++ modules/t470s.nix | 7 +++++++ satoshipad.nix | 3 +++ 4 files changed, 29 insertions(+) create mode 100644 modules/bare-metal.nix create mode 100644 modules/intel-gpu.nix create mode 100644 modules/t470s.nix diff --git a/modules/bare-metal.nix b/modules/bare-metal.nix new file mode 100644 index 00000000..04046b1b --- /dev/null +++ b/modules/bare-metal.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + fuse_exfat + cryptsetup + dmidecode + hdparm + pciutils + usbutils + ]; + + boot.kernelPackages = pkgs.linuxPackages_4_12; +} diff --git a/modules/intel-gpu.nix b/modules/intel-gpu.nix new file mode 100644 index 00000000..775396ae --- /dev/null +++ b/modules/intel-gpu.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ hardware.opengl.extraPackages = with pkgs; [ + vaapiIntel + ]; +} diff --git a/modules/t470s.nix b/modules/t470s.nix new file mode 100644 index 00000000..ba2c17cc --- /dev/null +++ b/modules/t470s.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ hardware.usbWwan.enable = true; + hardware.firmware = with pkgs; [ + firmwareLinuxNonfree + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 4b84ab53..b5178ca1 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -18,6 +18,9 @@ ./modules/trackball.nix ./modules/xserver.nix ./modules/british-english.nix + ./modules/bare-metal.nix + ./modules/intel-gpu.nix + ./modules/t470s.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From ab3093dca65fe624c2535a5215b4863b38421595 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 15:14:27 +0200 Subject: Create user module --- modules/user.nix | 11 +++++++++++ satoshipad.nix | 1 + 2 files changed, 12 insertions(+) create mode 100644 modules/user.nix diff --git a/modules/user.nix b/modules/user.nix new file mode 100644 index 00000000..1b2b6747 --- /dev/null +++ b/modules/user.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ users.extraUsers.alan = { + description = "Alan Pearce"; + isNormalUser = true; + extraGroups = [ "audio" "wheel" "adbusers" "docker" ]; + shell = "/run/current-system/sw/bin/zsh"; + home = "/home/alan"; + uid = 1000; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index b5178ca1..3d97e5e9 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -21,6 +21,7 @@ ./modules/bare-metal.nix ./modules/intel-gpu.nix ./modules/t470s.nix + ./modules/user.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 5e68b39af8a46a0a9c68b57aa84d8689e06be1ed Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 15:49:30 +0200 Subject: Add user interface module --- config/st-config.h | 461 ++++++++++++++++++++++++++++++++++++++++++ config/st-scrollback-0.7.diff | 387 +++++++++++++++++++++++++++++++++++ modules/user-interface.nix | 44 ++++ satoshipad.nix | 1 + 4 files changed, 893 insertions(+) create mode 100644 config/st-config.h create mode 100644 config/st-scrollback-0.7.diff create mode 100644 modules/user-interface.nix diff --git a/config/st-config.h b/config/st-config.h new file mode 100644 index 00000000..11e17954 --- /dev/null +++ b/config/st-config.h @@ -0,0 +1,461 @@ +/* See LICENSE file for copyright and license details. */ + +/* + * appearance + * + * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html + */ +static char font[] = "Liberation Mono:pixelsize=16:antialias=true:autohint=false"; +static int borderpx = 2; +#define histsize 2000 + +/* + * What program is execed by st depends of these precedence rules: + * 1: program passed with -e + * 2: utmp option + * 3: SHELL environment variable + * 4: value of shell in /etc/passwd + * 5: value of shell in config.h + */ +static char shell[] = "/bin/sh"; +static char *utmp = NULL; +static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400"; + +/* identification sequence returned in DA and DECID */ +static char vtiden[] = "\033[?6c"; + +/* Kerning / character bounding-box multipliers */ +static float cwscale = 1.0; +static float chscale = 1.0; + +/* + * word delimiter string + * + * More advanced example: " `'\"()[]{}" + */ +static char worddelimiters[] = " "; + +/* selection timeouts (in milliseconds) */ +static unsigned int doubleclicktimeout = 300; +static unsigned int tripleclicktimeout = 600; + +/* alt screens */ +static int allowaltscreen = 1; + +/* frames per second st should at maximum draw to the screen */ +static unsigned int xfps = 120; +static unsigned int actionfps = 30; + +/* + * blinking timeout (set to 0 to disable blinking) for the terminal blinking + * attribute. + */ +static unsigned int blinktimeout = 800; + +/* + * thickness of underline and bar cursors + */ +static unsigned int cursorthickness = 2; + +/* + * bell volume. It must be a value between -100 and 100. Use 0 for disabling + * it + */ +static int bellvolume = 0; + +/* default TERM value */ +static char termname[] = "st-meta-256color"; + +/* + * spaces per tab + * + * When you are changing this value, don't forget to adapt the »it« value in + * the st.info and appropriately install the st.info in the environment where + * you use this st version. + * + * it#$tabspaces, + * + * Secondly make sure your kernel is not expanding tabs. When running `stty + * -a` »tab0« should appear. You can tell the terminal to not expand tabs by + * running following command: + * + * stty tabs + */ +static unsigned int tabspaces = 8; + +/* Terminal colors (16 first used in escape sequence) */ +static const char *colorname[] = { + /* solarized light */ + /* "#eee8d5", /\* 0: black *\/ */ + /* "#dc322f", /\* 1: red *\/ */ + /* "#859900", /\* 2: green *\/ */ + /* "#b58900", /\* 3: yellow *\/ */ + /* "#268bd2", /\* 4: blue *\/ */ + /* "#d33682", /\* 5: magenta *\/ */ + /* "#2aa198", /\* 6: cyan *\/ */ + /* "#073642", /\* 7: white *\/ */ + /* "#fdf6e3", /\* 8: brblack *\/ */ + /* "#cb4b16", /\* 9: brred *\/ */ + /* "#93a1a1", /\* 10: brgreen *\/ */ + /* "#839496", /\* 11: bryellow *\/ */ + /* "#657b83", /\* 12: brblue *\/ */ + /* "#6c71c4", /\* 13: brmagenta*\/ */ + /* "#586e75", /\* 14: brcyan *\/ */ + /* "#002b36", /\* 15: brwhite *\/ */ + + "#000000", /* 0: black */ + "#9e1828", /* 1: red */ + "#5cb247", /* 2: green */ + "#968a38", /* 3: yellow */ + "#4161a0", /* 4: blue */ + "#9b768e", /* 5: magenta */ + "#419189", /* 6: cyan */ + "#bebebe", /* 7: white */ + "#666666", /* 8: brblack */ + "#cf6171", /* 9: brred */ + "#c5f779", /* 10: brgreen */ + "#fff796", /* 11: bryellow */ + "#4186be", /* 12: brblue */ + "#cf9ebe", /* 13: brmagenta*/ + "#71bebe", /* 14: brcyan */ + "#ffffff", /* 15: brwhite */ +}; + + +/* + * Default colors (colorname index) + * foreground, background, cursor + */ +static unsigned int defaultfg = 0; +static unsigned int defaultbg = 15; +static unsigned int defaultcs = 8; + +/* + * Default colors (colorname index) + * foreground, background, cursor, reverse cursor + */ +static unsigned int defaultrcs = 257; + +/* + * Default shape of cursor + * 2: Block ("█") + * 4: Underline ("_") + * 6: Bar ("|") + * 7: Snowman ("☃") + */ +static unsigned int cursorshape = 2; + +/* + * Default colour and shape of the mouse cursor + */ +static unsigned int mouseshape = XC_xterm; +static unsigned int mousefg = 7; +static unsigned int mousebg = 0; + +/* + * Colors used, when the specific fg == defaultfg. So in reverse mode this + * will reverse too. Another logic would only make the simple feature too + * complex. + */ +static unsigned int defaultitalic = 11; +static unsigned int defaultunderline = 7; + +/* + * Internal mouse shortcuts. + * Beware that overloading Button1 will disable the selection. + */ +static MouseShortcut mshortcuts[] = { + /* button mask string */ + { Button4, XK_ANY_MOD, "\031" }, + { Button5, XK_ANY_MOD, "\005" }, +}; + +/* Internal keyboard shortcuts. */ +#define MODKEY Mod1Mask + +static Shortcut shortcuts[] = { + /* mask keysym function argument */ + { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, + { ControlMask, XK_Print, toggleprinter, {.i = 0} }, + { ShiftMask, XK_Print, printscreen, {.i = 0} }, + { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, + { MODKEY|ShiftMask, XK_Prior, xzoom, {.f = +1} }, + { MODKEY|ShiftMask, XK_Next, xzoom, {.f = -1} }, + { MODKEY|ShiftMask, XK_Home, xzoomreset, {.f = 0} }, + { ShiftMask, XK_Insert, selpaste, {.i = 0} }, + { MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} }, + { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, + { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, + { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, + { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, + { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, + +}; + +/* + * Special keys (change & recompile st.info accordingly) + * + * Mask value: + * * Use XK_ANY_MOD to match the key no matter modifiers state + * * Use XK_NO_MOD to match the key alone (no modifiers) + * appkey value: + * * 0: no value + * * > 0: keypad application mode enabled + * * = 2: term.numlock = 1 + * * < 0: keypad application mode disabled + * appcursor value: + * * 0: no value + * * > 0: cursor application mode enabled + * * < 0: cursor application mode disabled + * crlf value + * * 0: no value + * * > 0: crlf mode is enabled + * * < 0: crlf mode is disabled + * + * Be careful with the order of the definitions because st searches in + * this table sequentially, so any XK_ANY_MOD must be in the last + * position for a key. + */ + +/* + * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) + * to be mapped below, add them to this array. + */ +static KeySym mappedkeys[] = { -1 }; + +/* + * State bits to ignore when matching key or button events. By default, + * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. + */ +static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; + +/* + * Override mouse-select while mask is active (when MODE_MOUSE is set). + * Note that if you want to use ShiftMask with selmasks, set this to an other + * modifier, set to 0 to not use it. + */ +static uint forceselmod = ShiftMask; + +/* + * This is the huge key array which defines all compatibility to the Linux + * world. Please decide about changes wisely. + */ +static Key key[] = { + /* keysym mask string appkey appcursor crlf */ + { XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0}, + { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, + { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, + { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, + { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, + { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, + { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0}, + { XK_KP_End, ControlMask, "\033[J", -1, 0, 0}, + { XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0}, + { XK_KP_End, ShiftMask, "\033[K", -1, 0, 0}, + { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0, 0}, + { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, + { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, + { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, + { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, + { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0, 0}, + { XK_KP_Insert, ControlMask, "\033[L", -1, 0, 0}, + { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, + { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, + { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, + { XK_KP_Delete, ControlMask, "\033[M", -1, 0, 0}, + { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, + { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0, 0}, + { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, + { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0}, + { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0, -1}, + { XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1}, + { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0, 0}, + { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0, 0}, + { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0, 0}, + { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0, 0}, + { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0, 0}, + { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0, 0}, + { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0, 0}, + { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0, 0}, + { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0, 0}, + { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0, 0}, + { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0}, + { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0}, + { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0}, + { XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0}, + { XK_Up, ControlMask, "\033[1;5A", 0, 0, 0}, + { XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0}, + { XK_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, + { XK_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, + { XK_Down, ShiftMask, "\033[1;2B", 0, 0, 0}, + { XK_Down, ControlMask, "\033[1;5B", 0, 0, 0}, + { XK_Down, Mod1Mask, "\033[1;3B", 0, 0, 0}, + { XK_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, + { XK_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, + { XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0}, + { XK_Left, ControlMask, "\033[1;5D", 0, 0, 0}, + { XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0}, + { XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, + { XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, + { XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0}, + { XK_Right, ControlMask, "\033[1;5C", 0, 0, 0}, + { XK_Right, Mod1Mask, "\033[1;3C", 0, 0, 0}, + { XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, + { XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, + { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0}, + { XK_Return, Mod1Mask, "\033\r", 0, 0, -1}, + { XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1}, + { XK_Return, XK_ANY_MOD, "\r", 0, 0, -1}, + { XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1}, + { XK_Insert, ShiftMask, "\033[4l", -1, 0, 0}, + { XK_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, + { XK_Insert, ControlMask, "\033[L", -1, 0, 0}, + { XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, + { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, + { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, + { XK_Delete, ControlMask, "\033[M", -1, 0, 0}, + { XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, + { XK_Delete, ShiftMask, "\033[2K", -1, 0, 0}, + { XK_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, + { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, + { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, + { XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0}, + { XK_BackSpace, Mod1Mask, "\033\177", 0, 0, 0}, + { XK_Home, ShiftMask, "\033[2J", 0, -1, 0}, + { XK_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, + { XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, + { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, + { XK_End, ControlMask, "\033[J", -1, 0, 0}, + { XK_End, ControlMask, "\033[1;5F", +1, 0, 0}, + { XK_End, ShiftMask, "\033[K", -1, 0, 0}, + { XK_End, ShiftMask, "\033[1;2F", +1, 0, 0}, + { XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, + { XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0}, + { XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, + { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, + { XK_Next, ControlMask, "\033[6;5~", 0, 0, 0}, + { XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, + { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, + { XK_F1, XK_NO_MOD, "\033OP" , 0, 0, 0}, + { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0, 0}, + { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0, 0}, + { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0, 0}, + { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0, 0}, + { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0, 0}, + { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0, 0}, + { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0, 0}, + { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0, 0}, + { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0, 0}, + { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0, 0}, + { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0, 0}, + { XK_F3, XK_NO_MOD, "\033OR" , 0, 0, 0}, + { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0, 0}, + { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0, 0}, + { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0, 0}, + { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0, 0}, + { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0}, + { XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0}, + { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0}, + { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0, 0}, + { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0}, + { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0}, + { XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0}, + { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0, 0}, + { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0, 0}, + { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0, 0}, + { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0, 0}, + { XK_F6, XK_NO_MOD, "\033[17~", 0, 0, 0}, + { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0, 0}, + { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0, 0}, + { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0, 0}, + { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0, 0}, + { XK_F7, XK_NO_MOD, "\033[18~", 0, 0, 0}, + { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0, 0}, + { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0, 0}, + { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0, 0}, + { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0, 0}, + { XK_F8, XK_NO_MOD, "\033[19~", 0, 0, 0}, + { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0, 0}, + { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0, 0}, + { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0, 0}, + { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0, 0}, + { XK_F9, XK_NO_MOD, "\033[20~", 0, 0, 0}, + { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0, 0}, + { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0, 0}, + { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0, 0}, + { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0, 0}, + { XK_F10, XK_NO_MOD, "\033[21~", 0, 0, 0}, + { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0, 0}, + { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0, 0}, + { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0, 0}, + { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0, 0}, + { XK_F11, XK_NO_MOD, "\033[23~", 0, 0, 0}, + { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0, 0}, + { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0, 0}, + { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0, 0}, + { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0, 0}, + { XK_F12, XK_NO_MOD, "\033[24~", 0, 0, 0}, + { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0, 0}, + { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0, 0}, + { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0, 0}, + { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0, 0}, + { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0, 0}, + { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0, 0}, + { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0, 0}, + { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0, 0}, + { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0, 0}, + { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0, 0}, + { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0, 0}, + { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0, 0}, + { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0, 0}, + { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0, 0}, + { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0, 0}, + { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0, 0}, + { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0, 0}, + { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0, 0}, + { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0, 0}, + { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0, 0}, + { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0, 0}, + { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0, 0}, + { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0, 0}, + { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0, 0}, + { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0, 0}, + { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0, 0}, + { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0, 0}, +}; + +/* + * Selection types' masks. + * Use the same masks as usual. + * Button1Mask is always unset, to make masks match between ButtonPress. + * ButtonRelease and MotionNotify. + * If no match is found, regular selection is used. + */ +static uint selmasks[] = { + [SEL_RECTANGULAR] = Mod1Mask, +}; + +/* + * Printable characters in ASCII, used to estimate the advance width + * of single wide characters. + */ +static char ascii_printable[] = + " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~"; diff --git a/config/st-scrollback-0.7.diff b/config/st-scrollback-0.7.diff new file mode 100644 index 00000000..3f23f872 --- /dev/null +++ b/config/st-scrollback-0.7.diff @@ -0,0 +1,387 @@ +diff --git a/config.def.h b/config.def.h +index b41747f..eae969e 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -7,6 +7,7 @@ + */ + static char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; + static int borderpx = 2; ++#define histsize 2000 + + /* + * What program is execed by st depends of these precedence rules: +@@ -172,6 +173,8 @@ static Shortcut shortcuts[] = { + { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, + { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, + { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, ++ { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, ++ { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, + }; + + /* +diff --git a/st.c b/st.c +index 2594c65..233d301 100644 +--- a/st.c ++++ b/st.c +@@ -86,6 +86,8 @@ char *argv0; + #define TRUERED(x) (((x) & 0xff0000) >> 8) + #define TRUEGREEN(x) (((x) & 0xff00)) + #define TRUEBLUE(x) (((x) & 0xff) << 8) ++#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - term.scr \ ++ + histsize + 1) % histsize] : term.line[(y) - term.scr]) + + + enum glyph_attribute { +@@ -228,26 +230,6 @@ typedef struct { + int narg; /* nb of args */ + } STREscape; + +-/* Internal representation of the screen */ +-typedef struct { +- int row; /* nb row */ +- int col; /* nb col */ +- Line *line; /* screen */ +- Line *alt; /* alternate screen */ +- int *dirty; /* dirtyness of lines */ +- XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ +- TCursor c; /* cursor */ +- int top; /* top scroll limit */ +- int bot; /* bottom scroll limit */ +- int mode; /* terminal mode flags */ +- int esc; /* escape state flags */ +- char trantbl[4]; /* charset table translation */ +- int charset; /* current charset */ +- int icharset; /* selected charset for sequence */ +- int numlock; /* lock numbers in keyboard */ +- int *tabs; +-} Term; +- + /* Purely graphic info */ + typedef struct { + Display *dpy; +@@ -327,6 +309,8 @@ typedef struct { + /* function definitions used in config.h */ + static void clipcopy(const Arg *); + static void clippaste(const Arg *); ++static void kscrolldown(const Arg *); ++static void kscrollup(const Arg *); + static void numlock(const Arg *); + static void selpaste(const Arg *); + static void xzoom(const Arg *); +@@ -340,6 +324,29 @@ static void sendbreak(const Arg *); + /* Config.h for applying patches and the configuration. */ + #include "config.h" + ++/* Internal representation of the screen */ ++typedef struct { ++ int row; /* nb row */ ++ int col; /* nb col */ ++ Line *line; /* screen */ ++ Line *alt; /* alternate screen */ ++ Line hist[histsize]; /* history buffer */ ++ int histi; /* history index */ ++ int scr; /* scroll back */ ++ int *dirty; /* dirtyness of lines */ ++ XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ ++ TCursor c; /* cursor */ ++ int top; /* top scroll limit */ ++ int bot; /* bottom scroll limit */ ++ int mode; /* terminal mode flags */ ++ int esc; /* escape state flags */ ++ char trantbl[4]; /* charset table translation */ ++ int charset; /* current charset */ ++ int icharset; /* selected charset for sequence */ ++ int numlock; /* lock numbers in keyboard */ ++ int *tabs; ++} Term; ++ + /* Font structure */ + typedef struct { + int height; +@@ -399,8 +406,8 @@ static void tputtab(int); + static void tputc(Rune); + static void treset(void); + static void tresize(int, int); +-static void tscrollup(int, int); +-static void tscrolldown(int, int); ++static void tscrollup(int, int, int); ++static void tscrolldown(int, int, int); + static void tsetattr(int *, int); + static void tsetchar(Rune, Glyph *, int, int); + static void tsetscroll(int, int); +@@ -731,10 +738,10 @@ tlinelen(int y) + { + int i = term.col; + +- if (term.line[y][i - 1].mode & ATTR_WRAP) ++ if (TLINE(y)[i - 1].mode & ATTR_WRAP) + return i; + +- while (i > 0 && term.line[y][i - 1].u == ' ') ++ while (i > 0 && TLINE(y)[i - 1].u == ' ') + --i; + + return i; +@@ -796,7 +803,7 @@ selsnap(int *x, int *y, int direction) + * Snap around if the word wraps around at the end or + * beginning of a line. + */ +- prevgp = &term.line[*y][*x]; ++ prevgp = &TLINE(*y)[*x]; + prevdelim = ISDELIM(prevgp->u); + for (;;) { + newx = *x + direction; +@@ -811,14 +818,14 @@ selsnap(int *x, int *y, int direction) + yt = *y, xt = *x; + else + yt = newy, xt = newx; +- if (!(term.line[yt][xt].mode & ATTR_WRAP)) ++ if (!(TLINE(yt)[xt].mode & ATTR_WRAP)) + break; + } + + if (newx >= tlinelen(newy)) + break; + +- gp = &term.line[newy][newx]; ++ gp = &TLINE(newy)[newx]; + delim = ISDELIM(gp->u); + if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim + || (delim && gp->u != prevgp->u))) +@@ -839,14 +846,14 @@ selsnap(int *x, int *y, int direction) + *x = (direction < 0) ? 0 : term.col - 1; + if (direction < 0) { + for (; *y > 0; *y += direction) { +- if (!(term.line[*y-1][term.col-1].mode ++ if (!(TLINE(*y-1)[term.col-1].mode + & ATTR_WRAP)) { + break; + } + } + } else if (direction > 0) { + for (; *y < term.row-1; *y += direction) { +- if (!(term.line[*y][term.col-1].mode ++ if (!(TLINE(*y)[term.col-1].mode + & ATTR_WRAP)) { + break; + } +@@ -1012,13 +1019,13 @@ getsel(void) + } + + if (sel.type == SEL_RECTANGULAR) { +- gp = &term.line[y][sel.nb.x]; ++ gp = &TLINE(y)[sel.nb.x]; + lastx = sel.ne.x; + } else { +- gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; ++ gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0]; + lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; + } +- last = &term.line[y][MIN(lastx, linelen-1)]; ++ last = &TLINE(y)[MIN(lastx, linelen-1)]; + while (last >= gp && last->u == ' ') + --last; + +@@ -1490,6 +1497,9 @@ ttyread(void) + /* keep any uncomplete utf8 char for the next call */ + memmove(buf, ptr, buflen); + ++ if (term.scr > 0 && term.scr < histsize-1) ++ term.scr++; ++ + return ret; + } + +@@ -1499,6 +1509,9 @@ ttywrite(const char *s, size_t n) + fd_set wfd, rfd; + ssize_t r; + size_t lim = 256; ++ Arg arg = (Arg){ .i = term.scr }; ++ ++ kscrolldown(&arg); + + /* + * Remember that we are using a pty, which might be a modem line. +@@ -1690,13 +1703,53 @@ tswapscreen(void) + } + + void +-tscrolldown(int orig, int n) ++kscrolldown(const Arg* a) ++{ ++ int n = a->i; ++ ++ if (n < 0) ++ n = term.row + n; ++ ++ if (n > term.scr) ++ n = term.scr; ++ ++ if (term.scr > 0) { ++ term.scr -= n; ++ selscroll(0, -n); ++ tfulldirt(); ++ } ++} ++ ++void ++kscrollup(const Arg* a) ++{ ++ int n = a->i; ++ ++ if (n < 0) ++ n = term.row + n; ++ ++ if (term.scr <= histsize - n) { ++ term.scr += n; ++ selscroll(0, n); ++ tfulldirt(); ++ } ++} ++ ++void ++tscrolldown(int orig, int n, int copyhist) + { + int i; + Line temp; + + LIMIT(n, 0, term.bot-orig+1); + ++ if (copyhist) { ++ term.histi = (term.histi - 1 + histsize) % histsize; ++ temp = term.hist[term.histi]; ++ term.hist[term.histi] = term.line[term.bot]; ++ term.line[term.bot] = temp; ++ } ++ + tsetdirt(orig, term.bot-n); + tclearregion(0, term.bot-n+1, term.col-1, term.bot); + +@@ -1710,13 +1763,20 @@ tscrolldown(int orig, int n) + } + + void +-tscrollup(int orig, int n) ++tscrollup(int orig, int n, int copyhist) + { + int i; + Line temp; + + LIMIT(n, 0, term.bot-orig+1); + ++ if (copyhist) { ++ term.histi = (term.histi + 1) % histsize; ++ temp = term.hist[term.histi]; ++ term.hist[term.histi] = term.line[orig]; ++ term.line[orig] = temp; ++ } ++ + tclearregion(0, orig, term.col-1, orig+n-1); + tsetdirt(orig+n, term.bot); + +@@ -1765,7 +1825,7 @@ tnewline(int first_col) + int y = term.c.y; + + if (y == term.bot) { +- tscrollup(term.top, 1); ++ tscrollup(term.top, 1, 1); + } else { + y++; + } +@@ -1930,14 +1990,14 @@ void + tinsertblankline(int n) + { + if (BETWEEN(term.c.y, term.top, term.bot)) +- tscrolldown(term.c.y, n); ++ tscrolldown(term.c.y, n, 0); + } + + void + tdeleteline(int n) + { + if (BETWEEN(term.c.y, term.top, term.bot)) +- tscrollup(term.c.y, n); ++ tscrollup(term.c.y, n, 0); + } + + int32_t +@@ -2371,11 +2431,11 @@ csihandle(void) + break; + case 'S': /* SU -- Scroll line up */ + DEFAULT(csiescseq.arg[0], 1); +- tscrollup(term.top, csiescseq.arg[0]); ++ tscrollup(term.top, csiescseq.arg[0], 0); + break; + case 'T': /* SD -- Scroll line down */ + DEFAULT(csiescseq.arg[0], 1); +- tscrolldown(term.top, csiescseq.arg[0]); ++ tscrolldown(term.top, csiescseq.arg[0], 0); + break; + case 'L': /* IL -- Insert blank lines */ + DEFAULT(csiescseq.arg[0], 1); +@@ -2871,7 +2931,7 @@ eschandle(uchar ascii) + return 0; + case 'D': /* IND -- Linefeed */ + if (term.c.y == term.bot) { +- tscrollup(term.top, 1); ++ tscrollup(term.top, 1, 1); + } else { + tmoveto(term.c.x, term.c.y+1); + } +@@ -2884,7 +2944,7 @@ eschandle(uchar ascii) + break; + case 'M': /* RI -- Reverse index */ + if (term.c.y == term.top) { +- tscrolldown(term.top, 1); ++ tscrolldown(term.top, 1, 1); + } else { + tmoveto(term.c.x, term.c.y-1); + } +@@ -3047,7 +3107,7 @@ tputc(Rune u) + void + tresize(int col, int row) + { +- int i; ++ int i, j; + int minrow = MIN(row, term.row); + int mincol = MIN(col, term.col); + int *bp; +@@ -3087,6 +3147,14 @@ tresize(int col, int row) + term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); + term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); + ++ for (i = 0; i < histsize; i++) { ++ term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph)); ++ for (j = mincol; j < col; j++) { ++ term.hist[i][j] = term.c.attr; ++ term.hist[i][j].u = ' '; ++ } ++ } ++ + /* resize each row to new width, zero-pad if needed */ + for (i = 0; i < minrow; i++) { + term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); +@@ -3976,11 +4044,11 @@ drawregion(int x1, int y1, int x2, int y2) + term.dirty[y] = 0; + + specs = term.specbuf; +- numspecs = xmakeglyphfontspecs(specs, &term.line[y][x1], x2 - x1, x1, y); ++ numspecs = xmakeglyphfontspecs(specs, &TLINE(y)[x1], x2 - x1, x1, y); + + i = ox = 0; + for (x = x1; x < x2 && i < numspecs; x++) { +- new = term.line[y][x]; ++ new = TLINE(y)[x]; + if (new.mode == ATTR_WDUMMY) + continue; + if (ena_sel && selected(x, y)) +@@ -4000,7 +4068,8 @@ drawregion(int x1, int y1, int x2, int y2) + if (i > 0) + xdrawglyphfontspecs(specs, base, i, ox, y); + } +- xdrawcursor(); ++ if (term.scr == 0) ++ xdrawcursor(); + } + + void diff --git a/modules/user-interface.nix b/modules/user-interface.nix new file mode 100644 index 00000000..ef05abbf --- /dev/null +++ b/modules/user-interface.nix @@ -0,0 +1,44 @@ +{ config, pkgs, ... }: + +{ # programs.browserpass.enable = true; + programs.info.enable = true; + + environment.systemPackages = with pkgs; [ + firefox-bin + + vdirsyncer + khal + + offlineimap + isync + mu + msmtp + + mosh + aspell + aspellDicts.en + + st + + trash-cli + ]; + + nixpkgs.config.st = { + patches = [ ../config/st-scrollback-0.7.diff ]; + conf = builtins.readFile ../config/st-config.h; + }; + + services.devmon.enable = true; + + services.redshift = { + enable = true; + temperature = { + day = 6500; + night = 3600; + }; + }; + + services.urxvtd = { + enable = true; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index 3d97e5e9..d85242c4 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -22,6 +22,7 @@ ./modules/intel-gpu.nix ./modules/t470s.nix ./modules/user.nix + ./modules/user-interface.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From f1a49dcee9df5c96ec5c261373c43c6da70701e4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 15:51:54 +0200 Subject: laptop: Add multi-display setup --- modules/laptop.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/modules/laptop.nix b/modules/laptop.nix index 17acb381..ea6b9c6e 100644 --- a/modules/laptop.nix +++ b/modules/laptop.nix @@ -12,8 +12,34 @@ environment.systemPackages = with pkgs; [ powerstat powertop + + arandr + autorandr + disper ]; + # powerManagement.resumeCommands = '' + # AUTORANDR="autorandr -c" + + # detect_display() + # { + # for X in /tmp/.X11-unix/X*; do + # D="''${X##/tmp/.X11-unix/X}" + # user=$(who | awk -vD="$D" '$5 ~ "\\(:"D"\\)$" {print $1}') + # if [ x"$user" != x"" ]; then + # export DISPLAY=":$D" + # /bin/su -c "''${AUTORANDR}" "$user" + # fi + # done + # } + + # case "$1" in + # thaw|resume) + # detect_display + # ;; + # esac + # ''; + programs.light.enable = true; services.logind.extraConfig = '' @@ -21,6 +47,8 @@ IdleActionSec=600 ''; + services.physlock.enable = true; + services.tlp = { enable = true; extraConfig = '' @@ -28,6 +56,10 @@ ''; }; + services.udev.extraRules = '' + # ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/alan/.Xauthority", RUN+="${pkgs.autorandr}/bin/autorandr -c" + ''; + services.xserver = { libinput = { enable = true; -- cgit 1.4.1 From 1eb55b1642a209feb1b8a245edabe3361c62cb5d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:16:49 +0200 Subject: user-interface: Import Emacs setup --- modules/user-interface.nix | 21 ++++++ packages/emacs.nix | 166 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 packages/emacs.nix diff --git a/modules/user-interface.nix b/modules/user-interface.nix index ef05abbf..9d216d50 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -1,5 +1,9 @@ { config, pkgs, ... }: +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in { # programs.browserpass.enable = true; programs.info.enable = true; @@ -30,6 +34,23 @@ services.devmon.enable = true; + services.emacs = { + enable = true; + defaultEditor = true; + package = import ./emacs.nix { + inherit (pkgs) stdenv; + pkgs = pkgsUnstable; + emacs = pkgs.lib.overrideDerivation (pkgs.emacs.override { + withGTK2 = false; + withGTK3 = true; + }) (attrs: { + postInstall = attrs.postInstall + '' + rm $out/share/applications/emacs.desktop + ''; + }); + }; + }; + services.redshift = { enable = true; temperature = { diff --git a/packages/emacs.nix b/packages/emacs.nix new file mode 100644 index 00000000..30b21c2d --- /dev/null +++ b/packages/emacs.nix @@ -0,0 +1,166 @@ +{ + pkgs, + emacs ? pkgs.emacs, + stdenv +}: + +let + myEmacs = emacs; + emacsWithPackages = (pkgs.emacsPackagesNgGen myEmacs).emacsWithPackages; + + elpaBuild = import { + inherit (pkgs) fetchurl lib stdenv texinfo; + emacs = myEmacs; + }; + + hook-helpers = pkgs.callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild { + pname = "hook-helpers"; + version = "1.1"; + src = fetchurl { + url = "http://elpa.gnu.org/packages/hook-helpers-1.1.tar"; + sha256 = "0xvabl0lfc0ijr98clsyh0bqk2fdi1ncl0knn58j2p30gn9958i5"; + }; + packageRequires = []; + meta = { + homepage = https://savannah.nongnu.org/projects/hook-helpers-el/; + license = lib.licenses.free; + }; + }) { + inherit elpaBuild; + inherit (pkgs) fetchurl lib; + }; + + dired-du = pkgs.callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild { + pname = "dired-du"; + version = "0.5"; + src = fetchurl { + url = "http://elpa.gnu.org/packages/dired-du-0.5.tar"; + sha256 = "09yj37p2fa5f81fqrzwghjkyy2ydsf4rbkfwpn2yyvzd5nd97bpl"; + }; + packageRequires = []; + meta = { + homepage = https://github.com/calancha/dired-du; + license = lib.licenses.free; + }; + }) { + inherit elpaBuild; + inherit (pkgs) fetchurl lib; + }; +in + emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [ + diminish + bind-key + use-package + smartparens + ]) ++ (with epkgs.melpaPackages; [ + ace-link + ace-window + add-node-modules-path + ag + auto-compile + avy + bbdb + beginend + cider + clj-refactor + clojure-mode + cmd-to-echo + command-log-mode + company + company-go + company-restclient + company-tern + company-web + counsel + counsel-projectile + crux + cyphejor + dired-narrow + dired-subtree + discover-my-major + dockerfile-mode + dtrt-indent + dumb-jump + easy-hugo + editorconfig + elisp-slime-nav + emmet-mode + ensime + exec-path-from-shell + expand-region + eyebrowse + flow-minor-mode + flycheck + flycheck-flow + flycheck-pos-tip + flycheck-vale + fontawesome + geiser + ggtags + ghq + git-gutter-fringe + git-messenger + git-timemachine + go-eldoc + go-mode + go-projectile + goto-chg + haskell-mode + highlight-stages + helpful + imenu-anywhere + indium + jinja2-mode + js2-mode + js2-refactor + json-mode + ledger-mode + lua-mode + magit + markdown-mode + move-text + multiple-cursors + nginx-mode + nix-mode + nix-sandbox + outorg + outshine + navi-mode + org-journal + page-break-lines + paredit + password-store + projectile + projectile-ripgrep + quickrun + redshank + relative-buffers + restclient + ripgrep + rjsx-mode + scala-mode + scss-mode + shrink-whitespace + slime + smart-tabs-mode + smex + suggest + swiper + tern + toml-mode + undo-tree + visual-regexp + volatile-highlights + web-mode + white-theme + wgrep-ag + which-key + yaml-mode + ]) ++ (with epkgs.elpaPackages; [ + rainbow-mode + ]) ++ [ + # defined above + hook-helpers + dired-du + # From main packages set + ]) -- cgit 1.4.1 From 27aeb718a79d1c84e80145ef4fa8446c69aab20e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:18:31 +0200 Subject: syncthing: Open default ports --- modules/syncthing.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/syncthing.nix b/modules/syncthing.nix index 9c9b7787..5a3e1d6e 100644 --- a/modules/syncthing.nix +++ b/modules/syncthing.nix @@ -4,6 +4,7 @@ enable = true; user = "alan"; group = "users"; + openDefaultPorts = true; systemService = true; useInotify = true; dataDir = "/home/alan/.config/syncthing"; -- cgit 1.4.1 From dc4ea159709bf7904140f2430bb0a1178dd152dd Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:19:10 +0200 Subject: Add modules for development --- modules/dev.nix | 10 ++++++++++ modules/javascript.nix | 12 ++++++++++++ modules/satoshipay.nix | 24 ++++++++++++++++++++++++ satoshipad.nix | 3 +++ 4 files changed, 49 insertions(+) create mode 100644 modules/dev.nix create mode 100644 modules/javascript.nix create mode 100644 modules/satoshipay.nix diff --git a/modules/dev.nix b/modules/dev.nix new file mode 100644 index 00000000..ebef3f48 --- /dev/null +++ b/modules/dev.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + mercurial + gitAndTools.hub + + ag + ripgrep + ]; +} diff --git a/modules/javascript.nix b/modules/javascript.nix new file mode 100644 index 00000000..d950fe53 --- /dev/null +++ b/modules/javascript.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ environment.systemPackages = with pkgs; [ + nodejs-8_x + pkgsUnstable.nodePackages.yarn + pkgsUnstable.nodePackages.tern + ]; +} diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix new file mode 100644 index 00000000..70053038 --- /dev/null +++ b/modules/satoshipay.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ virtualisation = { + docker = { + enable = true; + liveRestore = false; + }; + }; + + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + google-chrome + mongodb + franz + pkgsUnstable.scudCloud + ]; + + networking.domain = "satoshipay.io"; +} diff --git a/satoshipad.nix b/satoshipad.nix index d85242c4..e46f323b 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -23,6 +23,9 @@ ./modules/t470s.nix ./modules/user.nix ./modules/user-interface.nix + ./modules/dev.nix + ./modules/javascript.nix + ./modules/satoshipay.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From a992ae2e0100c761e5385b938d61a124aa7d503c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:20:38 +0200 Subject: Add accounting module --- modules/accounting.nix | 9 +++++++++ satoshipad.nix | 1 + 2 files changed, 10 insertions(+) create mode 100644 modules/accounting.nix diff --git a/modules/accounting.nix b/modules/accounting.nix new file mode 100644 index 00000000..0b180a81 --- /dev/null +++ b/modules/accounting.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + ledger + bean-add + beancount + fava + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index e46f323b..f3b2d79c 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -26,6 +26,7 @@ ./modules/dev.nix ./modules/javascript.nix ./modules/satoshipay.nix + ./modules/accounting.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 12be12c3130dfcb9190afe35a462e4ba2c850a31 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:22:06 +0200 Subject: Add passwords module --- modules/passwords.nix | 8 ++++++++ satoshipad.nix | 1 + 2 files changed, 9 insertions(+) create mode 100644 modules/passwords.nix diff --git a/modules/passwords.nix b/modules/passwords.nix new file mode 100644 index 00000000..8c9d7cff --- /dev/null +++ b/modules/passwords.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + keepassx-community + pass + pwgen + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index f3b2d79c..6c8d6d34 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -27,6 +27,7 @@ ./modules/javascript.nix ./modules/satoshipay.nix ./modules/accounting.nix + ./modules/passwords.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 0cef6aa80ff7d52afe80b7086cc3452bf020722a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:25:32 +0200 Subject: Add modules for network configuration --- modules/connman.nix | 12 ++++++++++++ modules/network-manager.nix | 10 ++++++++++ satoshipad.nix | 1 + 3 files changed, 23 insertions(+) create mode 100644 modules/connman.nix create mode 100644 modules/network-manager.nix diff --git a/modules/connman.nix b/modules/connman.nix new file mode 100644 index 00000000..cbd216cf --- /dev/null +++ b/modules/connman.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ networking.connman = { + enable = true; + }; + + environment.systemPackages = with pkgs; [ + cmst + connman-notify + connman_dmenu + ]; +} diff --git a/modules/network-manager.nix b/modules/network-manager.nix new file mode 100644 index 00000000..b85b8f41 --- /dev/null +++ b/modules/network-manager.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ networking.networkmanager = { + enable = true; + }; + + environment.systemPackages = with pkgs; [ + networkmanagerapplet + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 6c8d6d34..6aba5a6f 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -28,6 +28,7 @@ ./modules/satoshipay.nix ./modules/accounting.nix ./modules/passwords.nix + ./modules/network-manager.nix ]; networking.hostName = "satoshipad"; -- cgit 1.4.1 From 5a4ead8db870f7c9950d092d5dd3ec1c570024f2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:35:14 +0200 Subject: Add disk configuration --- modules/bare-metal.nix | 3 +++ satoshipad.nix | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/modules/bare-metal.nix b/modules/bare-metal.nix index 04046b1b..969848bb 100644 --- a/modules/bare-metal.nix +++ b/modules/bare-metal.nix @@ -10,4 +10,7 @@ ]; boot.kernelPackages = pkgs.linuxPackages_4_12; + + fileSystems."/".options = [ "noatime" "nodiratime" ]; + fileSystems."/home".options = [ "noatime" "nodiratime" ]; } diff --git a/satoshipad.nix b/satoshipad.nix index 6aba5a6f..1f013def 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -31,6 +31,14 @@ ./modules/network-manager.nix ]; + boot.initrd.luks.devices = [ + { + name = "root"; + device = "/dev/disk/by-uuid/bb7f9a24-8963-4d00-9258-118050b35748"; + preLVM = true; + } + ]; + networking.hostName = "satoshipad"; system.stateVersion = "17.03"; -- cgit 1.4.1 From 3e054571d73ccacfec7b1d4714bfa74818b7affe Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:40:31 +0200 Subject: Add nix configuration --- modules/nix.nix | 24 ++++++++++++++++++++++++ satoshipad.nix | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 modules/nix.nix diff --git a/modules/nix.nix b/modules/nix.nix new file mode 100644 index 00000000..35b7cea6 --- /dev/null +++ b/modules/nix.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: + +{ nix = { + buildCores = 0; + + daemonNiceLevel = 10; + daemonIONiceLevel = 4; + + extraOptions = '' + auto-optimise-store = true; + ''; + gc = { + automatic = true; + options = "--delete-older-than 30d"; + }; + }; + + system.autoUpgrade = { + enable = true; + }; + systemd.services.nixos-upgrade.script = '' + ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} + ''; +} diff --git a/satoshipad.nix b/satoshipad.nix index 1f013def..36e0331f 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -29,6 +29,7 @@ ./modules/accounting.nix ./modules/passwords.nix ./modules/network-manager.nix + ./modules/nix.nix ]; boot.initrd.luks.devices = [ @@ -41,5 +42,8 @@ networking.hostName = "satoshipad"; + nix.gc.dates = "12:00"; + system.autoUpgrade.dates = "12:24"; + system.stateVersion = "17.03"; } -- cgit 1.4.1 From bfecab269ec49fd9ce07812211f95fafab5e11e8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:46:57 +0200 Subject: Add i3 module --- modules/i3.nix | 12 ++++++++++++ modules/window-manager.nix | 15 +++++++++++++++ satoshipad.nix | 1 + 3 files changed, 28 insertions(+) create mode 100644 modules/i3.nix create mode 100644 modules/window-manager.nix diff --git a/modules/i3.nix b/modules/i3.nix new file mode 100644 index 00000000..07bf64a2 --- /dev/null +++ b/modules/i3.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ services.xserver.windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + }; + + environment.systemPackages = with pkgs; [ + i3status + i3lock-color + ]; +} diff --git a/modules/window-manager.nix b/modules/window-manager.nix new file mode 100644 index 00000000..4b6a710f --- /dev/null +++ b/modules/window-manager.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: + +{ services.xserver.displayManager = { + slim = { + enable = true; + }; + }; + + environment.systemPackages = with pkgs; [ + dmenu + dunst + sxhkd + scrot + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 36e0331f..4414bb2d 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -30,6 +30,7 @@ ./modules/passwords.nix ./modules/network-manager.nix ./modules/nix.nix + ./modules/i3.nix ]; boot.initrd.luks.devices = [ -- cgit 1.4.1 From 64bbc795267a2c3e1596bdf46aff691d77152c95 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:47:43 +0200 Subject: user-interface: Add calibre and mpv --- modules/user-interface.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 9d216d50..d83a601a 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -18,6 +18,9 @@ in mu msmtp + calibre + mpv + mosh aspell aspellDicts.en -- cgit 1.4.1 From 0884991b398b9d3189f3b38a17d29ed95519daf8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:49:09 +0200 Subject: Add private configuration --- .gitignore | 1 + satoshipad.nix | 1 + 2 files changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..fd1a426a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/private/ diff --git a/satoshipad.nix b/satoshipad.nix index 4414bb2d..344479eb 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -31,6 +31,7 @@ ./modules/network-manager.nix ./modules/nix.nix ./modules/i3.nix + ./private/default.nix ]; boot.initrd.luks.devices = [ -- cgit 1.4.1 From 8fb655de6c13a164de7f97e8e3451645707fd041 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:50:51 +0200 Subject: Ignore hardware-configuration.nix --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fd1a426a..b69079b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /private/ +/hardware-configuration.nix -- cgit 1.4.1 From 297404c8be8b79762fc99bf47df425eaa7b81ff7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:57:31 +0200 Subject: README: Add setup notes --- README.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.org b/README.org index 96b63e71..cc07d58d 100644 --- a/README.org +++ b/README.org @@ -1,3 +1,13 @@ * nixos-configuration This repository is for my [[https://nixos.org/][NixOS]] configuration. + +** Setup + +1. Clone or symlink to =/etc/nixos= +2. If necessary, re-create relevant files in =./private= +3. Run =nixos-generate-config= if on a fresh machine +4. Remove =configuration.nix= +5. Link a machine configuration to =configuration.nix= +6. Apply configuration with =nixos-rebuild= or =nixos-install= + -- cgit 1.4.1 From 2460a54df4acd9860635a4e1cf5427187a670616 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 17:01:46 +0200 Subject: fix evaluation errors --- modules/berlin.nix | 4 ++-- modules/colemak.nix | 4 ++-- modules/satoshipay.nix | 2 +- modules/user-interface.nix | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/berlin.nix b/modules/berlin.nix index a388a57a..246510c4 100644 --- a/modules/berlin.nix +++ b/modules/berlin.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: -{ time.timezone = "Europe/Berlin"; - redshift = { +{ time.timeZone = "Europe/Berlin"; + services.redshift = { latitude = "52.586"; longitude = "13.300"; }; diff --git a/modules/colemak.nix b/modules/colemak.nix index 53a4901e..3b1c0582 100644 --- a/modules/colemak.nix +++ b/modules/colemak.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { i18n.consoleKeyMap = "colemak/en-latin9"; - kmscon = { + services.kmscon = { extraConfig = '' xkb-model=pc104 xkb-layout=us @@ -9,7 +9,7 @@ xkb-options="altwin:prtsc_rwin" ''; }; - xserver = { + services.xserver = { layout = "us,us"; xkbVariant = "colemak,"; xkbOptions = "grp:shifts_toggle,altwin:prtsc_rwin"; diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 70053038..178d67a4 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -17,7 +17,7 @@ in google-chrome mongodb franz - pkgsUnstable.scudCloud + pkgsUnstable.scudcloud ]; networking.domain = "satoshipay.io"; diff --git a/modules/user-interface.nix b/modules/user-interface.nix index d83a601a..cae4b6b9 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -40,7 +40,7 @@ in services.emacs = { enable = true; defaultEditor = true; - package = import ./emacs.nix { + package = import ../packages/emacs.nix { inherit (pkgs) stdenv; pkgs = pkgsUnstable; emacs = pkgs.lib.overrideDerivation (pkgs.emacs.override { -- cgit 1.4.1 From 4526167140d421f45ce4a6edc1e72b18ca1d4019 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 17:01:54 +0200 Subject: Remove nerdfonts --- modules/xserver.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/xserver.nix b/modules/xserver.nix index 45caef7a..57d4c10d 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -64,7 +64,6 @@ font-droid font-awesome-ttf hack-font - nerdfonts iosevka liberation_ttf noto-fonts -- cgit 1.4.1 From 0eeccee975288f9e0889f1503a278e8328a11411 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 17:02:02 +0200 Subject: Ignore configuration.nix --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b69079b4..e4fc3504 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /private/ /hardware-configuration.nix +/configuration.nix -- cgit 1.4.1 From 98aafa849eb7aa534a7ba14ecc0016072977553e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 17:09:47 +0200 Subject: Add packages remaining in satoshipad user profile --- modules/dev.nix | 6 +++++- modules/satoshipay.nix | 1 + modules/shell.nix | 1 + modules/user-interface.nix | 4 ++++ modules/xserver.nix | 1 + 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/dev.nix b/modules/dev.nix index ebef3f48..cf1958d5 100644 --- a/modules/dev.nix +++ b/modules/dev.nix @@ -6,5 +6,9 @@ ag ripgrep - ]; + + httpie + + nodePackages.js-yaml + ]; } diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 178d67a4..91aa89fe 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -15,6 +15,7 @@ in environment.systemPackages = with pkgs; [ google-chrome + docker_compose mongodb franz pkgsUnstable.scudcloud diff --git a/modules/shell.nix b/modules/shell.nix index 65982166..dd08a4a4 100644 --- a/modules/shell.nix +++ b/modules/shell.nix @@ -13,6 +13,7 @@ htop lsof iftop + iotop nmap netperf psmisc diff --git a/modules/user-interface.nix b/modules/user-interface.nix index cae4b6b9..a7142ba2 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -9,6 +9,9 @@ in environment.systemPackages = with pkgs; [ firefox-bin + pcmanfm + + lxappearance vdirsyncer khal @@ -25,6 +28,7 @@ in aspell aspellDicts.en + pkgsUnstable.alacritty st trash-cli diff --git a/modules/xserver.nix b/modules/xserver.nix index 57d4c10d..0c8e05fa 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -20,6 +20,7 @@ xorg.xev xorg.xdpyinfo xclip + xfontsel vanilla-dmz -- cgit 1.4.1 From d541dcbb64da728b7b630f83463e0dedc420747c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 19:32:00 +0200 Subject: connman: Add missing settings --- modules/connman.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/connman.nix b/modules/connman.nix index cbd216cf..0361f9cb 100644 --- a/modules/connman.nix +++ b/modules/connman.nix @@ -2,7 +2,9 @@ { networking.connman = { enable = true; + enableVPN = false; }; + networking.wireless.enable = true; environment.systemPackages = with pkgs; [ cmst -- cgit 1.4.1 From d901c0e42094c806655b1ec2a250e657a54f9dfc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 19:32:09 +0200 Subject: bare-metal: Mount tmpfs to /tmp on boot --- modules/bare-metal.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/bare-metal.nix b/modules/bare-metal.nix index 969848bb..b5e0fc7b 100644 --- a/modules/bare-metal.nix +++ b/modules/bare-metal.nix @@ -11,6 +11,8 @@ boot.kernelPackages = pkgs.linuxPackages_4_12; + boot.tmpOnTmpfs = true; + fileSystems."/".options = [ "noatime" "nodiratime" ]; fileSystems."/home".options = [ "noatime" "nodiratime" ]; } -- cgit 1.4.1 From 9c28f332eb6719b5625f674ff0844ef614d11649 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 19:33:26 +0200 Subject: Import synaptics configuration --- modules/synaptics.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 modules/synaptics.nix diff --git a/modules/synaptics.nix b/modules/synaptics.nix new file mode 100644 index 00000000..0e9db17a --- /dev/null +++ b/modules/synaptics.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: + +{ services.xserver.synaptics = { + enable = true; + + accelFactor = "0.001"; + + minSpeed = "0.4"; + maxSpeed = "2.0"; + + palmDetect = true; + palmMinWidth = 5; + palmMinZ = 20; + + twoFingerScroll = true; + vertTwoFingerScroll = true; + horizTwoFingerScroll = true; + additionalOptions = '' + Option "RBCornerButton" "3" + Option "VertScrollDelta" "-111" + Option "HorizScrollDelta" "-111" + ''; + }; +} -- cgit 1.4.1 From 9a3f32686b6da2e86d55fa986fac935128b37bc1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 19:33:49 +0200 Subject: Add systemd-boot module --- modules/systemd-boot.nix | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 modules/systemd-boot.nix diff --git a/modules/systemd-boot.nix b/modules/systemd-boot.nix new file mode 100644 index 00000000..4f7ca361 --- /dev/null +++ b/modules/systemd-boot.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.vesa = true; + boot.earlyVconsoleSetup = true; +} -- cgit 1.4.1 From 5d61d9068a4897cce320f92ec31bd823f021378b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 19:34:04 +0200 Subject: Add system configuration for marvin (x250) --- marvin.nix | 43 +++++++++++++++++++++++++++++++++++++++++++ modules/x250.nix | 31 +++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 marvin.nix create mode 100644 modules/x250.nix diff --git a/marvin.nix b/marvin.nix new file mode 100644 index 00000000..f82d2e6a --- /dev/null +++ b/marvin.nix @@ -0,0 +1,43 @@ +{ config, pkgs, ... }: + +{ imports = [ + ./hardware-configuration.nix + ./modules/systemd-boot.nix + ./modules/laptop.nix + ./modules/thinkpad.nix + ./modules/audio.nix + ./modules/adb.nix + ./modules/syncthing.nix + ./modules/nitrokey.nix + ./modules/shell.nix + ./modules/dotfiles.nix + ./modules/berlin.nix + ./modules/colemak.nix + ./modules/trackball.nix + ./modules/xserver.nix + ./modules/british-english.nix + ./modules/bare-metal.nix + ./modules/intel-gpu.nix + ./modules/x250.nix + ./modules/user.nix + ./modules/user-interface.nix + ./modules/dev.nix + ./modules/javascript.nix + ./modules/accounting.nix + ./modules/passwords.nix + ./modules/network-manager.nix + ./modules/nix.nix + ./modules/i3.nix + ]; + + environment.systemPackages = with pkgs; [ + chromium + ]; + + networking = { + hostName = "marvin"; + domain = "alanpearce.eu"; + }; + + system.stateVersion = "17.03"; +} diff --git a/modules/x250.nix b/modules/x250.nix new file mode 100644 index 00000000..025bc302 --- /dev/null +++ b/modules/x250.nix @@ -0,0 +1,31 @@ +{ config, pkgs, ... }: + +{ boot.extraModulePackages = with config.boot.kernelPackages; [ + acpi_call + ]; + + hardware.firmware = with pkgs; [ + firmwareLinuxNonfree + ]; + + services.xserver.monitorSection = '' + DisplaySize 277 156 + ''; + + services.tlp.extraConfig = '' + # Newer Thinkpads have a battery firmware + # it conflicts with TLP if stop thresholds are set + START_CHARGE_THRESH_BAT0=70 + # STOP_CHARGE_THRESH_BAT0=80 + START_CHARGE_THRESH_BAT1=70 + # STOP_CHARGE_THRESH_BAT1=80 + + DISK_APM_LEVEL_ON_AC="254 254" + DISK_APM_LEVEL_ON_BAT="128 128" + + # One or both of these lines stops disk corruption + # when re-attaching to AC whilst on. + SATA_LINKPWR_ON_BAT=medium_power + SATA_LINKPWR_BLACKLIST="host1" + ''; +} -- cgit 1.4.1 From fcda0e9be54eff63d8acc89f67e5e37b220ee369 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 19:56:21 +0200 Subject: user-interface: allow unfree packages Necessary for firefox-bin --- modules/user-interface.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index a7142ba2..2111d8b0 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -34,6 +34,8 @@ in trash-cli ]; + nixpkgs.config.allowUnfree = true; + nixpkgs.config.st = { patches = [ ../config/st-scrollback-0.7.diff ]; conf = builtins.readFile ../config/st-config.h; -- cgit 1.4.1 From 2d522c9c0a0d33d151435a0aed6c48684dd678cd Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 21:23:44 +0200 Subject: marvin: Add window-manager config --- marvin.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/marvin.nix b/marvin.nix index f82d2e6a..ca080fab 100644 --- a/marvin.nix +++ b/marvin.nix @@ -27,6 +27,7 @@ ./modules/passwords.nix ./modules/network-manager.nix ./modules/nix.nix + ./modules/window-manager.nix ./modules/i3.nix ]; -- cgit 1.4.1 From 61b85e007d4ce04a28ec9be8378a609b4508279a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 21:54:03 +0200 Subject: laptop: Disable physlock It breaks on satoshipad. Stick to invoking i3lock manually --- modules/laptop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/laptop.nix b/modules/laptop.nix index ea6b9c6e..3d6894cc 100644 --- a/modules/laptop.nix +++ b/modules/laptop.nix @@ -47,7 +47,7 @@ IdleActionSec=600 ''; - services.physlock.enable = true; + services.physlock.enable = false; services.tlp = { enable = true; -- cgit 1.4.1 From d5fabd7234da98818ebe6bc6f1e70e67aa513c23 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 21:54:34 +0200 Subject: nix: Fix configuration syntax --- modules/nix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nix.nix b/modules/nix.nix index 35b7cea6..e5353de5 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -7,7 +7,7 @@ daemonIONiceLevel = 4; extraOptions = '' - auto-optimise-store = true; + auto-optimise-store = true ''; gc = { automatic = true; -- cgit 1.4.1 From d877dfd64c7ea9acb8131532700a58a4774452d0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 22:06:36 +0200 Subject: satoshipad: Add missing window-manager configuration --- satoshipad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/satoshipad.nix b/satoshipad.nix index 344479eb..53784715 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -31,6 +31,7 @@ ./modules/network-manager.nix ./modules/nix.nix ./modules/i3.nix + ./modules/window-manager.nix ./private/default.nix ]; -- cgit 1.4.1 From 43b45692de6fdd24c64b5e530d59290d38ff6e93 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 22:17:44 +0200 Subject: grub2: Setup console earlier in boot --- modules/grub2.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/grub2.nix b/modules/grub2.nix index 6eaa8cc5..be78a60c 100644 --- a/modules/grub2.nix +++ b/modules/grub2.nix @@ -9,4 +9,5 @@ }; efi.canTouchEfiVariables = true; }; + boot.earlyVconsoleSetup = true; } -- cgit 1.4.1 From 33bdedd376532cd30eb77de11fc7e2341c069531 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 23:26:29 +0200 Subject: Set different fonts for high/low DPI --- modules/hidpi.nix | 8 ++++++++ modules/xserver.nix | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/hidpi.nix b/modules/hidpi.nix index 1f4644c5..762e50e1 100644 --- a/modules/hidpi.nix +++ b/modules/hidpi.nix @@ -6,4 +6,12 @@ terminus_font ]; }; + + fonts = { + defaultFonts = { + monospace = [ "Noto Mono" ]; + sansSerif = [ "Noto Sans" ]; + serif = [ "Noto Serif" ]; + }; + }; } diff --git a/modules/xserver.nix b/modules/xserver.nix index 0c8e05fa..799eab82 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -41,9 +41,9 @@ enableDefaultFonts = true; fontconfig = { defaultFonts = { - monospace = [ "Roboto Mono" ]; - sansSerif = [ "Noto Sans" ]; - serif = [ "Noto Serif" ]; + monospace = [ "Liberation Mono" ]; + sansSerif = [ "Liberation Sans" ]; + serif = [ "Liberation Serif" ]; }; ultimate = { enable = true; -- cgit 1.4.1 From a8247a03c426c9d62be3231742084ae2d4e257c7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 10 Sep 2017 12:02:32 +0200 Subject: t470s: Allow querying the NVMe device --- modules/t470s.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/t470s.nix b/modules/t470s.nix index ba2c17cc..ddaba1df 100644 --- a/modules/t470s.nix +++ b/modules/t470s.nix @@ -4,4 +4,8 @@ hardware.firmware = with pkgs; [ firmwareLinuxNonfree ]; + + environment.systemPackages = with pkgs; [ + nvme-cli + ]; } -- cgit 1.4.1 From 40aa6a71001395b69a7145096524d4e7e580ad13 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 10 Sep 2017 12:02:50 +0200 Subject: satoshipad: Pass discards through LUKS Don't enable automatic discards though, it can leak some FS information. This way allows me to run `fstrim` if I feel I need to. --- satoshipad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/satoshipad.nix b/satoshipad.nix index 53784715..fc4b6763 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -38,6 +38,7 @@ boot.initrd.luks.devices = [ { name = "root"; + allowDiscards = true; device = "/dev/disk/by-uuid/bb7f9a24-8963-4d00-9258-118050b35748"; preLVM = true; } -- cgit 1.4.1 From 37fff5a466ab7e2084b1a89a62602435516d51e8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 10 Sep 2017 13:54:34 +0200 Subject: Add lisp module --- marvin.nix | 1 + modules/lisp.nix | 11 +++++++++++ satoshipad.nix | 1 + 3 files changed, 13 insertions(+) create mode 100644 modules/lisp.nix diff --git a/marvin.nix b/marvin.nix index ca080fab..fc08a9e2 100644 --- a/marvin.nix +++ b/marvin.nix @@ -22,6 +22,7 @@ ./modules/user.nix ./modules/user-interface.nix ./modules/dev.nix + ./modules/lisp.nix ./modules/javascript.nix ./modules/accounting.nix ./modules/passwords.nix diff --git a/modules/lisp.nix b/modules/lisp.nix new file mode 100644 index 00000000..ffaa7115 --- /dev/null +++ b/modules/lisp.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + ccl + sbcl + lispPackages.quicklisp + + dust + pixie + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 53784715..1e4168f8 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -24,6 +24,7 @@ ./modules/user.nix ./modules/user-interface.nix ./modules/dev.nix + ./modules/lisp.nix ./modules/javascript.nix ./modules/satoshipay.nix ./modules/accounting.nix -- cgit 1.4.1 From 67a97cece0f462b149514a341fb6facf3abad815 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 10 Sep 2017 13:59:26 +0200 Subject: Add infrastructure module --- marvin.nix | 1 + modules/infrastructure.nix | 9 +++++++++ satoshipad.nix | 1 + 3 files changed, 11 insertions(+) create mode 100644 modules/infrastructure.nix diff --git a/marvin.nix b/marvin.nix index fc08a9e2..7d6e7986 100644 --- a/marvin.nix +++ b/marvin.nix @@ -24,6 +24,7 @@ ./modules/dev.nix ./modules/lisp.nix ./modules/javascript.nix + ./modules/infrastructure.nix ./modules/accounting.nix ./modules/passwords.nix ./modules/network-manager.nix diff --git a/modules/infrastructure.nix b/modules/infrastructure.nix new file mode 100644 index 00000000..b41816e2 --- /dev/null +++ b/modules/infrastructure.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + ansible + hugo + + nixops + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 1e4168f8..67fda3ec 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -27,6 +27,7 @@ ./modules/lisp.nix ./modules/javascript.nix ./modules/satoshipay.nix + ./modules/infrastructure.nix ./modules/accounting.nix ./modules/passwords.nix ./modules/network-manager.nix -- cgit 1.4.1 From da93d42ee1b52155080fd5a46f33e96c7e8346d3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 10 Sep 2017 14:00:34 +0200 Subject: Import packages from marvin user profile --- modules/accounting.nix | 1 + modules/dev.nix | 2 ++ modules/javascript.nix | 3 +++ modules/user-interface.nix | 3 +++ 4 files changed, 9 insertions(+) diff --git a/modules/accounting.nix b/modules/accounting.nix index 0b180a81..5882436f 100644 --- a/modules/accounting.nix +++ b/modules/accounting.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: { environment.systemPackages = with pkgs; [ + aqbanking ledger bean-add beancount diff --git a/modules/dev.nix b/modules/dev.nix index cf1958d5..453d365c 100644 --- a/modules/dev.nix +++ b/modules/dev.nix @@ -4,6 +4,8 @@ mercurial gitAndTools.hub + editorconfig-core-c + ag ripgrep diff --git a/modules/javascript.nix b/modules/javascript.nix index d950fe53..cc5b89e8 100644 --- a/modules/javascript.nix +++ b/modules/javascript.nix @@ -6,7 +6,10 @@ let in { environment.systemPackages = with pkgs; [ nodejs-8_x + pkgsUnstable.flow pkgsUnstable.nodePackages.yarn pkgsUnstable.nodePackages.tern + pkgsUnstable.nodePackages.node2nix + pkgsUnstable.nodePackages.nodemon ]; } diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 2111d8b0..3f4fb6e6 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -11,6 +11,9 @@ in firefox-bin pcmanfm + epdfview + geeqie + lxappearance vdirsyncer -- cgit 1.4.1 From 45fcfe8435222078c2153f22b3f32d8bafb94633 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 10 Sep 2017 14:38:21 +0200 Subject: x250: Use synaptics driver instead of libinput --- modules/laptop.nix | 4 ++-- modules/synaptics.nix | 35 +++++++++++++++++++---------------- modules/x250.nix | 5 ++++- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/modules/laptop.nix b/modules/laptop.nix index 3d6894cc..f0c88e7d 100644 --- a/modules/laptop.nix +++ b/modules/laptop.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { boot.kernelModules = [ "coretemp" ]; boot.extraModulePackages = with config.boot.kernelPackages; [ @@ -62,7 +62,7 @@ services.xserver = { libinput = { - enable = true; + enable = lib.mkDefault true; naturalScrolling = true; disableWhileTyping = true; }; diff --git a/modules/synaptics.nix b/modules/synaptics.nix index 0e9db17a..1028db35 100644 --- a/modules/synaptics.nix +++ b/modules/synaptics.nix @@ -1,24 +1,27 @@ { config, pkgs, ... }: -{ services.xserver.synaptics = { - enable = true; +{ services.xserver = { + libinput.enable = false; + synaptics = { + enable = true; - accelFactor = "0.001"; + accelFactor = "0.05"; - minSpeed = "0.4"; - maxSpeed = "2.0"; + minSpeed = "0.2"; + maxSpeed = "1.0"; - palmDetect = true; - palmMinWidth = 5; - palmMinZ = 20; + palmDetect = true; + palmMinWidth = 5; + palmMinZ = 20; - twoFingerScroll = true; - vertTwoFingerScroll = true; - horizTwoFingerScroll = true; - additionalOptions = '' - Option "RBCornerButton" "3" - Option "VertScrollDelta" "-111" - Option "HorizScrollDelta" "-111" - ''; + twoFingerScroll = true; + vertTwoFingerScroll = true; + horizTwoFingerScroll = true; + additionalOptions = '' + Option "RBCornerButton" "3" + Option "VertScrollDelta" "-111" + Option "HorizScrollDelta" "-111" + ''; + }; }; } diff --git a/modules/x250.nix b/modules/x250.nix index 025bc302..a6509bf1 100644 --- a/modules/x250.nix +++ b/modules/x250.nix @@ -1,6 +1,9 @@ { config, pkgs, ... }: -{ boot.extraModulePackages = with config.boot.kernelPackages; [ +{ imports = [ + ./synaptics.nix + ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ]; -- cgit 1.4.1 From 94eaea428f207a3791e60092c3ef2a4a6e2fb669 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 10 Sep 2017 14:38:36 +0200 Subject: user-interface: Run emacs with --debug-init --- modules/user-interface.nix | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 3f4fb6e6..d8a2b6a4 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -1,8 +1,20 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: let pkgsUnstable = import {}; # pkgsUnstable = pkgs; + emacsPackage = import ../packages/emacs.nix { + inherit (pkgs) stdenv; + pkgs = pkgsUnstable; + emacs = pkgs.lib.overrideDerivation (pkgs.emacs.override { + withGTK2 = false; + withGTK3 = true; + }) (attrs: { + postInstall = attrs.postInstall + '' + rm $out/share/applications/emacs.desktop + ''; + }); + }; in { # programs.browserpass.enable = true; programs.info.enable = true; @@ -49,19 +61,9 @@ in services.emacs = { enable = true; defaultEditor = true; - package = import ../packages/emacs.nix { - inherit (pkgs) stdenv; - pkgs = pkgsUnstable; - emacs = pkgs.lib.overrideDerivation (pkgs.emacs.override { - withGTK2 = false; - withGTK3 = true; - }) (attrs: { - postInstall = attrs.postInstall + '' - rm $out/share/applications/emacs.desktop - ''; - }); - }; + package = emacsPackage; }; + systemd.user.services.emacs.serviceConfig.ExecStart = lib.mkForce "${pkgs.bash}/bin/bash -c 'source ${config.system.build.setEnvironment}; exec ${emacsPackage}/bin/emacs --daemon --debug-init'"; services.redshift = { enable = true; -- cgit 1.4.1 From 9b2347d2832781c13f73e57ca775fd3583aeeaee Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 10 Sep 2017 14:53:04 +0200 Subject: nitrokey: Disable ssh-agent --- modules/nitrokey.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nitrokey.nix b/modules/nitrokey.nix index a256c33d..ac85e352 100644 --- a/modules/nitrokey.nix +++ b/modules/nitrokey.nix @@ -4,7 +4,9 @@ let pkgsUnstable = import {}; # pkgsUnstable = pkgs; in -{ services.pcscd.enable = true; +{ programs.ssh.startAgent = false; + + services.pcscd.enable = true; services.tor = { enable = true; -- cgit 1.4.1 From 4d814ea9e74052f851a498fc6ee95e850a374636 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 12 Sep 2017 11:29:20 +0200 Subject: window-manager: Install libnotify --- modules/window-manager.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/window-manager.nix b/modules/window-manager.nix index 4b6a710f..40a120fa 100644 --- a/modules/window-manager.nix +++ b/modules/window-manager.nix @@ -9,6 +9,7 @@ environment.systemPackages = with pkgs; [ dmenu dunst + libnotify # for notify-send sxhkd scrot ]; -- cgit 1.4.1 From 0fa96641a6ad7e37cc8013b73348392b3465f1a9 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 13 Sep 2017 09:45:53 +0200 Subject: Add services for printing via network --- modules/printing.nix | 8 ++++++++ modules/zeroconf.nix | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 modules/printing.nix create mode 100644 modules/zeroconf.nix diff --git a/modules/printing.nix b/modules/printing.nix new file mode 100644 index 00000000..3172f33b --- /dev/null +++ b/modules/printing.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ services.printing.enable = true; + + imports = [ + ./zeroconf.nix + ]; +} diff --git a/modules/zeroconf.nix b/modules/zeroconf.nix new file mode 100644 index 00000000..aa4b47e8 --- /dev/null +++ b/modules/zeroconf.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ services.avahi = { + enable = true; + nssmdns = true; + }; +} -- cgit 1.4.1 From d75c3b679efe46fe391c5c57fd2ec4c27302d3d5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 13 Sep 2017 09:46:03 +0200 Subject: Add print drivers for SatoshiPay These are non-free. For some reason, with `pkgsUnstable`, one has to pass `NIXPKGS_ALLOW_UNFREE=1` to `nixos-rebuild`. --- modules/satoshipay.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 91aa89fe..ffe6ccf7 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -21,5 +21,9 @@ in pkgsUnstable.scudcloud ]; + services.printing.drivers = with pkgs; [ + pkgsUnstable.cups-toshiba-estudio + ]; + networking.domain = "satoshipay.io"; } -- cgit 1.4.1 From 6f2b320ea5012f64412849b28d37296395af7d13 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 13 Sep 2017 09:47:20 +0200 Subject: T470s: Enable ModemManager --- modules/t470s.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/t470s.nix b/modules/t470s.nix index ddaba1df..133354a6 100644 --- a/modules/t470s.nix +++ b/modules/t470s.nix @@ -5,6 +5,8 @@ firmwareLinuxNonfree ]; + systemd.services.ModemManager.enable = true; + environment.systemPackages = with pkgs; [ nvme-cli ]; -- cgit 1.4.1 From f32689fd89da67c74d893424faa53918babaf9f5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 13 Sep 2017 09:47:41 +0200 Subject: Satoshipad: Setup printing --- satoshipad.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/satoshipad.nix b/satoshipad.nix index fc4b6763..6be962c2 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -19,6 +19,7 @@ ./modules/xserver.nix ./modules/british-english.nix ./modules/bare-metal.nix + ./modules/printing.nix ./modules/intel-gpu.nix ./modules/t470s.nix ./modules/user.nix @@ -29,6 +30,7 @@ ./modules/accounting.nix ./modules/passwords.nix ./modules/network-manager.nix + ./modules/zeroconf.nix ./modules/nix.nix ./modules/i3.nix ./modules/window-manager.nix -- cgit 1.4.1 From 4811eda25396755c0fc479b4a1fa23b7a970ce2b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 13 Sep 2017 15:55:54 +0200 Subject: window-manager: Add perl-file-mimeinfo package --- modules/window-manager.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/window-manager.nix b/modules/window-manager.nix index 40a120fa..b8cbb85a 100644 --- a/modules/window-manager.nix +++ b/modules/window-manager.nix @@ -12,5 +12,7 @@ libnotify # for notify-send sxhkd scrot + + perlPackages.FileMimeInfo # xdg-utils uses this when no DE ]; } -- cgit 1.4.1 From 52b72d494d3090418202043f05ca87e9e82b75dd Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 13 Sep 2017 15:56:28 +0200 Subject: dev: Add useful packages for HTTP work --- modules/dev.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/dev.nix b/modules/dev.nix index cf1958d5..d3fe92fb 100644 --- a/modules/dev.nix +++ b/modules/dev.nix @@ -8,6 +8,8 @@ ripgrep httpie + http-prompt + mitmproxy nodePackages.js-yaml ]; -- cgit 1.4.1 From 7db05c60364d3d6be69b243e0c43272b36e6ffa0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 13 Sep 2017 15:56:58 +0200 Subject: Add gnome module --- modules/gnome.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 modules/gnome.nix diff --git a/modules/gnome.nix b/modules/gnome.nix new file mode 100644 index 00000000..bd785453 --- /dev/null +++ b/modules/gnome.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: + +with lib; +{ services = { + gnome3 = { + gnome-documents.enable = false; + gnome-user-share.enable = false; + gnome-online-accounts.enable = false; + seahorse.enable = false; + tracker.enable = false; + }; + telepathy.enable = false; + + xserver = { + desktopManager.gnome3 = { + enable = true; + extraGSettingsOverrides = '' + [org.gnome.desktop.input-sources] + sources=[('xkb','${config.services.xserver.layout + (optionalString (config.services.xserver.xkbVariant != "") ("+" + config.services.xserver.xkbVariant))}')] + ''; + }; + }; + }; +} -- cgit 1.4.1 From 28e8cdf197e28662d2933daa2a742cff91ed05af Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 15 Sep 2017 14:00:45 +0200 Subject: systemd-boot: Don't allow modifying boot options --- modules/systemd-boot.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/systemd-boot.nix b/modules/systemd-boot.nix index 4f7ca361..80e79fdc 100644 --- a/modules/systemd-boot.nix +++ b/modules/systemd-boot.nix @@ -1,6 +1,9 @@ { config, pkgs, ... }: -{ boot.loader.systemd-boot.enable = true; +{ boot.loader.systemd-boot = { + enable = true; + editor = false; # Don't allow modification + }; boot.loader.efi.canTouchEfiVariables = true; boot.vesa = true; boot.earlyVconsoleSetup = true; -- cgit 1.4.1 From 6e62d660060b6661ffce847979783999692aa267 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 15 Sep 2017 14:01:10 +0200 Subject: window-manager: Use LightDM instead of the deprecated Slim --- modules/window-manager.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/window-manager.nix b/modules/window-manager.nix index b8cbb85a..c1593745 100644 --- a/modules/window-manager.nix +++ b/modules/window-manager.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { services.xserver.displayManager = { - slim = { + lightdm = { enable = true; }; }; -- cgit 1.4.1 From d11f0455f026fa0165a04f08c2cd6ee01f13de97 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 15 Sep 2017 14:01:58 +0200 Subject: t470s: Kludgy fix for missing HDMI sound sink --- modules/t470s.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/t470s.nix b/modules/t470s.nix index 133354a6..09263b6e 100644 --- a/modules/t470s.nix +++ b/modules/t470s.nix @@ -7,6 +7,10 @@ systemd.services.ModemManager.enable = true; + hardware.pulseaudio.extraConfig = '' + load-module module-alsa-sink device=hw:0,7 + ''; + environment.systemPackages = with pkgs; [ nvme-cli ]; -- cgit 1.4.1 From e57191803f0134663310313ea0c0956e2ab4ae9f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 15 Sep 2017 14:27:16 +0200 Subject: Satoshipad: Switch to systemd-boot --- satoshipad.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 766f78c0..6ee2b3f7 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -3,7 +3,7 @@ { imports = [ ./hardware-configuration.nix - ./modules/grub2.nix + ./modules/systemd-boot.nix ./modules/laptop.nix ./modules/thinkpad.nix ./modules/audio.nix -- cgit 1.4.1 From 7eaf41a62212eac2ed037141bf7de6fdef803f6b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 15 Sep 2017 14:58:12 +0200 Subject: satoshipad: Install gnome I don't plan on using it, but it might be useful for printer setup and other things. --- satoshipad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/satoshipad.nix b/satoshipad.nix index 6ee2b3f7..87a10692 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -36,6 +36,7 @@ ./modules/nix.nix ./modules/i3.nix ./modules/window-manager.nix + ./modules/gnome.nix ./private/default.nix ]; -- cgit 1.4.1 From cc28a5341073dccf3fd974828da916b6a8919380 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Sep 2017 09:15:47 +0200 Subject: synaptics: Tweak movement parameters --- modules/synaptics.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/synaptics.nix b/modules/synaptics.nix index 1028db35..9f075cce 100644 --- a/modules/synaptics.nix +++ b/modules/synaptics.nix @@ -5,10 +5,10 @@ synaptics = { enable = true; - accelFactor = "0.05"; + accelFactor = "0.04"; - minSpeed = "0.2"; - maxSpeed = "1.0"; + minSpeed = "0.3"; + maxSpeed = "0.6"; palmDetect = true; palmMinWidth = 5; -- cgit 1.4.1 From b3dca1bdfcbdf3aaf8c7db40fd55f70bb7ca96ca Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Sep 2017 20:29:08 +0200 Subject: shell: Install moreutils --- modules/shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/shell.nix b/modules/shell.nix index dd08a4a4..dd511cd5 100644 --- a/modules/shell.nix +++ b/modules/shell.nix @@ -16,6 +16,7 @@ iotop nmap netperf + moreutils psmisc tree zip -- cgit 1.4.1 From 08ea3cbbc483e928fb60293d2341dc7e98bddcb6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Sep 2017 20:29:23 +0200 Subject: satoshipay: Uninstall franz --- modules/satoshipay.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index ffe6ccf7..a8ca6b88 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -17,7 +17,6 @@ in google-chrome docker_compose mongodb - franz pkgsUnstable.scudcloud ]; -- cgit 1.4.1 From fdad069a8c0da04dd9ff636ce5e25f028a1eaa10 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Sep 2017 20:29:30 +0200 Subject: satoshipay: Install scudcloud --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index a8ca6b88..2ff3b9eb 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -17,6 +17,7 @@ in google-chrome docker_compose mongodb + electrum pkgsUnstable.scudcloud ]; -- cgit 1.4.1 From eb92294f514568445b134f3fb9154c4d55f0519f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Sep 2017 20:30:05 +0200 Subject: nix: Allow auto-upgrading with unstable packages --- modules/nix.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/nix.nix b/modules/nix.nix index e5353de5..e1f1e163 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -18,7 +18,10 @@ system.autoUpgrade = { enable = true; }; - systemd.services.nixos-upgrade.script = '' - ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} - ''; + systemd.services.nixos-upgrade = { + environment.NIXPKGS_ALLOW_UNFREE = "1"; + script = '' + ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} + ''; + }; } -- cgit 1.4.1 From b1a0cb9247a1000dc17bcd7f14ec801a8a98c770 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Sep 2017 20:30:47 +0200 Subject: intel-gpu: Use i915 to setup console earlier --- modules/grub2.nix | 1 - modules/intel-gpu.nix | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/grub2.nix b/modules/grub2.nix index be78a60c..6eaa8cc5 100644 --- a/modules/grub2.nix +++ b/modules/grub2.nix @@ -9,5 +9,4 @@ }; efi.canTouchEfiVariables = true; }; - boot.earlyVconsoleSetup = true; } diff --git a/modules/intel-gpu.nix b/modules/intel-gpu.nix index 775396ae..b44ddadf 100644 --- a/modules/intel-gpu.nix +++ b/modules/intel-gpu.nix @@ -3,4 +3,12 @@ { hardware.opengl.extraPackages = with pkgs; [ vaapiIntel ]; + + boot.earlyVconsoleSetup = true; + boot.initrd.kernelModules = [ + "i915" + ]; + boot.kernelModules = [ + "i915" + ]; } -- cgit 1.4.1 From 685aeb15376bc906522b938be68a3049294d733b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Sep 2017 20:31:24 +0200 Subject: hidpi: Remove font settings With a mostly-docked hiDPI laptop, it doesn't make any sense. --- modules/hidpi.nix | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modules/hidpi.nix b/modules/hidpi.nix index 762e50e1..1f4644c5 100644 --- a/modules/hidpi.nix +++ b/modules/hidpi.nix @@ -6,12 +6,4 @@ terminus_font ]; }; - - fonts = { - defaultFonts = { - monospace = [ "Noto Mono" ]; - sansSerif = [ "Noto Sans" ]; - serif = [ "Noto Serif" ]; - }; - }; } -- cgit 1.4.1 From 6183039a262d5ab946e64832434c1e42702a20f0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Sep 2017 20:32:05 +0200 Subject: satoshipad: Switch back to grub --- satoshipad.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 87a10692..d4d0bc2c 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -3,7 +3,7 @@ { imports = [ ./hardware-configuration.nix - ./modules/systemd-boot.nix + ./modules/grub2.nix ./modules/laptop.nix ./modules/thinkpad.nix ./modules/audio.nix -- cgit 1.4.1 From f7103802c21e1ebe4fba1055c13030285f6e7d58 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Sep 2017 20:32:53 +0200 Subject: xserver: Change installed themes --- modules/xserver.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/xserver.nix b/modules/xserver.nix index 799eab82..d482e74e 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -29,8 +29,9 @@ flat-plat paper-gtk-theme paper-icon-theme - numix-gtk-theme - numix-icon-theme + + arc-icon-theme + tango-icon-theme gtk-engine-murrine gtk_engines -- cgit 1.4.1 From 975ef23c19f93a01db60c9834823b4eeea96be8e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 18 Sep 2017 18:58:18 +0200 Subject: Workaround dbus error in systemd user sessions --- modules/xserver.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/xserver.nix b/modules/xserver.nix index d482e74e..80430f40 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -6,6 +6,8 @@ exportConfiguration = true; }; + services.dbus.socketActivated = true; + environment.sessionVariables = { XCURSOR_PATH = [ "${config.system.path}/share/icons" -- cgit 1.4.1 From 64ed5e8642a2ea66937e328d5ce9bc22b38055ff Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 22 Sep 2017 12:54:13 +0200 Subject: dev: Install git-extras --- modules/dev.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/dev.nix b/modules/dev.nix index 48679cb4..abe5f969 100644 --- a/modules/dev.nix +++ b/modules/dev.nix @@ -2,6 +2,7 @@ { environment.systemPackages = with pkgs; [ mercurial + gitAndTools.git-extras gitAndTools.hub editorconfig-core-c -- cgit 1.4.1 From 375725cc27d35349cd2d4d2dcab87ee43de065ef Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 22 Sep 2017 13:31:10 +0200 Subject: Add hostname to /etc/hosts --- modules/base.nix | 8 ++++++++ satoshipad.nix | 1 + 2 files changed, 9 insertions(+) create mode 100644 modules/base.nix diff --git a/modules/base.nix b/modules/base.nix new file mode 100644 index 00000000..acf773e0 --- /dev/null +++ b/modules/base.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + networking.extraHosts = '' + 127.0.0.1 ${config.networking.hostName} + ::1 ${config.networking.hostName} + ''; +} diff --git a/satoshipad.nix b/satoshipad.nix index d4d0bc2c..6393c497 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -3,6 +3,7 @@ { imports = [ ./hardware-configuration.nix + ./modules/base.nix ./modules/grub2.nix ./modules/laptop.nix ./modules/thinkpad.nix -- cgit 1.4.1 From 3382429413980806511c0d8de3b381c9c5b39bfe Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 22 Sep 2017 13:47:01 +0200 Subject: xserver: Remove noto fonts They're supplementary to Roboto, which should include all the glyphs I need. --- modules/xserver.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/xserver.nix b/modules/xserver.nix index 80430f40..8f238407 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -70,7 +70,6 @@ hack-font iosevka liberation_ttf - noto-fonts mononoki opensans-ttf paratype-pt-mono -- cgit 1.4.1 From 29277c70cc00480b153409ddc465bc2144b4459b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 22 Sep 2017 15:58:01 +0200 Subject: Xserver: Remove unused fonts --- modules/xserver.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/xserver.nix b/modules/xserver.nix index 8f238407..9b03cf4b 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -56,10 +56,8 @@ }; }; fonts = with pkgs; [ - anonymousPro cantarell_fonts carlito - cm_unicode dejavu_fonts fantasque-sans-mono fira @@ -68,7 +66,6 @@ font-droid font-awesome-ttf hack-font - iosevka liberation_ttf mononoki opensans-ttf @@ -81,7 +78,6 @@ source-sans-pro source-serif-pro terminus_font - ubuntu_font_family xorg.fontxfree86type1 ]; }; -- cgit 1.4.1 From 29211f81353b076fbca7cf4417faa9dc0da3948e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 22 Sep 2017 15:58:45 +0200 Subject: satoshipay: Install mongod as a non-autostarted service --- modules/satoshipay.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 2ff3b9eb..7e1a8d40 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: let pkgsUnstable = import {}; @@ -16,11 +16,15 @@ in environment.systemPackages = with pkgs; [ google-chrome docker_compose - mongodb electrum pkgsUnstable.scudcloud ]; + services.mongodb = { + enable = true; + }; + systemd.services.mongodb.wantedBy = lib.mkForce []; + services.printing.drivers = with pkgs; [ pkgsUnstable.cups-toshiba-estudio ]; -- cgit 1.4.1 From 84f85b3c00501ed302621b44ee4b57c3c82a5d32 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 22 Sep 2017 15:58:59 +0200 Subject: satoshipay: lazy-load docker --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 7e1a8d40..be158128 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -7,6 +7,7 @@ in { virtualisation = { docker = { enable = true; + enableOnBoot = false; liveRestore = false; }; }; -- cgit 1.4.1 From c6c996c7272b2233b74649e41fde99a1ff25e553 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 22 Sep 2017 15:59:19 +0200 Subject: satoshipay: Install redis service (manually started) --- modules/satoshipay.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index be158128..81fe8a7e 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -25,6 +25,10 @@ in enable = true; }; systemd.services.mongodb.wantedBy = lib.mkForce []; + services.redis = { + enable = true; + }; + systemd.services.redis.wantedBy = lib.mkForce []; services.printing.drivers = with pkgs; [ pkgsUnstable.cups-toshiba-estudio -- cgit 1.4.1 From 363b6f0870750edea48e865a84dee9c5a0ae0196 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 22 Sep 2017 15:59:48 +0200 Subject: nix: Use normal configuration for auto-optimise-store --- modules/nix.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/nix.nix b/modules/nix.nix index e1f1e163..504942ec 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -6,9 +6,7 @@ daemonNiceLevel = 10; daemonIONiceLevel = 4; - extraOptions = '' - auto-optimise-store = true - ''; + autoOptimiseStore = true; gc = { automatic = true; options = "--delete-older-than 30d"; -- cgit 1.4.1 From 78ce34a501cc9a9187eb35d15855be3fd30e0cc5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Sep 2017 10:23:09 +0200 Subject: base: Boot faster --- modules/base.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/base.nix b/modules/base.nix index acf773e0..ee59c61e 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: -{ +{ boot.loader.timeout = 1; + networking.extraHosts = '' 127.0.0.1 ${config.networking.hostName} ::1 ${config.networking.hostName} -- cgit 1.4.1 From 86f8ba751f949a013a29e2a7f49c3d41c078318b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Sep 2017 10:23:25 +0200 Subject: grub2: Disable splash image --- modules/grub2.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/grub2.nix b/modules/grub2.nix index 6eaa8cc5..70e86e71 100644 --- a/modules/grub2.nix +++ b/modules/grub2.nix @@ -3,6 +3,7 @@ { boot.loader = { grub = { enable = true; + splashImage = null; version = 2; device = "nodev"; efiSupport = true; -- cgit 1.4.1 From 2c98b8c453cac66b09b6e2f505c336ce3f01663d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Sep 2017 10:23:54 +0200 Subject: T470s: Blacklist thinkpad_acpi module It seems to cause freezing on boot when on battery power --- modules/t470s.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/t470s.nix b/modules/t470s.nix index 09263b6e..34d7f9e3 100644 --- a/modules/t470s.nix +++ b/modules/t470s.nix @@ -5,6 +5,8 @@ firmwareLinuxNonfree ]; + boot.blacklistedKernelModules = [ "thinkpad_acpi" ]; + systemd.services.ModemManager.enable = true; hardware.pulseaudio.extraConfig = '' -- cgit 1.4.1 From 2b02b1ab144c1c59cbd8b8f1dbfd1c00044e8237 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Sep 2017 10:25:03 +0200 Subject: shell: Let's try xonsh for a while --- modules/shell.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/shell.nix b/modules/shell.nix index dd511cd5..3ea43adc 100644 --- a/modules/shell.nix +++ b/modules/shell.nix @@ -5,6 +5,9 @@ promptInit = ""; }; programs.bash.enableCompletion = true; + programs.xonsh = { + enable = true; + }; environment.systemPackages = with pkgs; [ vim -- cgit 1.4.1 From b48da7c8cafca69b44b2d39f36761647f393e069 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Sep 2017 10:25:22 +0200 Subject: Xserver: Add missing fonts --- modules/xserver.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/xserver.nix b/modules/xserver.nix index 9b03cf4b..2cef678b 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -68,12 +68,16 @@ hack-font liberation_ttf mononoki + (nerdfonts.override { + withFont = "Monoid"; + }) opensans-ttf paratype-pt-mono paratype-pt-sans paratype-pt-serif roboto roboto-mono + roboto-slab source-code-pro source-sans-pro source-serif-pro -- cgit 1.4.1 From 496b4ed379afe7f1e0563243a0a5efe0857fe3bb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Sep 2017 10:36:42 +0200 Subject: Create nested module hierarchy --- marvin.nix | 9 +-------- modules/i3.nix | 4 ++++ modules/laptop.nix | 4 ++++ modules/t470s.nix | 5 +++++ modules/thinkpad.nix | 4 ++++ modules/user-interface.nix | 4 ++++ modules/x250.nix | 5 +++++ satoshipad.nix | 7 ------- 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/marvin.nix b/marvin.nix index 7d6e7986..c3508fbe 100644 --- a/marvin.nix +++ b/marvin.nix @@ -3,8 +3,6 @@ { imports = [ ./hardware-configuration.nix ./modules/systemd-boot.nix - ./modules/laptop.nix - ./modules/thinkpad.nix ./modules/audio.nix ./modules/adb.nix ./modules/syncthing.nix @@ -14,13 +12,9 @@ ./modules/berlin.nix ./modules/colemak.nix ./modules/trackball.nix - ./modules/xserver.nix ./modules/british-english.nix - ./modules/bare-metal.nix - ./modules/intel-gpu.nix ./modules/x250.nix ./modules/user.nix - ./modules/user-interface.nix ./modules/dev.nix ./modules/lisp.nix ./modules/javascript.nix @@ -28,8 +22,7 @@ ./modules/accounting.nix ./modules/passwords.nix ./modules/network-manager.nix - ./modules/nix.nix - ./modules/window-manager.nix + ./modules/nix.nix ./modules/i3.nix ]; diff --git a/modules/i3.nix b/modules/i3.nix index 07bf64a2..3bba3bbb 100644 --- a/modules/i3.nix +++ b/modules/i3.nix @@ -9,4 +9,8 @@ i3status i3lock-color ]; + + imports = [ + ./window-manager.nix + ]; } diff --git a/modules/laptop.nix b/modules/laptop.nix index f0c88e7d..c50c28e4 100644 --- a/modules/laptop.nix +++ b/modules/laptop.nix @@ -70,4 +70,8 @@ systemd.services.nixos-upgrade.unitConfig.ConditionACPower = true; systemd.services.nix-gc.unitConfig.ConditionACPower = true; + + imports = [ + ./user-interface.nix + ]; } diff --git a/modules/t470s.nix b/modules/t470s.nix index 34d7f9e3..394df773 100644 --- a/modules/t470s.nix +++ b/modules/t470s.nix @@ -16,4 +16,9 @@ environment.systemPackages = with pkgs; [ nvme-cli ]; + + imports = [ + ./intel-gpu.nix + ./thinkpad.nix + ]; } diff --git a/modules/thinkpad.nix b/modules/thinkpad.nix index 009e3f08..38133d76 100644 --- a/modules/thinkpad.nix +++ b/modules/thinkpad.nix @@ -28,4 +28,8 @@ STOP_CHARGE_THRESH_BAT1=80 ''; }; + + imports = [ + ./bare-metal.nix + ]; } diff --git a/modules/user-interface.nix b/modules/user-interface.nix index d8a2b6a4..09cb2bc6 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -76,4 +76,8 @@ in services.urxvtd = { enable = true; }; + + imports = [ + ./xserver.nix + ]; } diff --git a/modules/x250.nix b/modules/x250.nix index a6509bf1..e163ec4f 100644 --- a/modules/x250.nix +++ b/modules/x250.nix @@ -31,4 +31,9 @@ SATA_LINKPWR_ON_BAT=medium_power SATA_LINKPWR_BLACKLIST="host1" ''; + + imports = [ + ./intel-gpu.nix + ./thinkpad.nix + ]; } diff --git a/satoshipad.nix b/satoshipad.nix index 6393c497..bc927248 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -5,8 +5,6 @@ ./hardware-configuration.nix ./modules/base.nix ./modules/grub2.nix - ./modules/laptop.nix - ./modules/thinkpad.nix ./modules/audio.nix ./modules/adb.nix ./modules/syncthing.nix @@ -17,14 +15,10 @@ ./modules/berlin.nix ./modules/colemak.nix ./modules/trackball.nix - ./modules/xserver.nix ./modules/british-english.nix - ./modules/bare-metal.nix ./modules/printing.nix - ./modules/intel-gpu.nix ./modules/t470s.nix ./modules/user.nix - ./modules/user-interface.nix ./modules/dev.nix ./modules/lisp.nix ./modules/javascript.nix @@ -36,7 +30,6 @@ ./modules/zeroconf.nix ./modules/nix.nix ./modules/i3.nix - ./modules/window-manager.nix ./modules/gnome.nix ./private/default.nix ]; -- cgit 1.4.1 From 0f2c55992677e78d5d2908d0648e410ef9b27436 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Sep 2017 13:59:19 +0200 Subject: Organise modules into folders --- marvin.nix | 45 ++++++++-------- modules/accounting.nix | 10 ---- modules/adb.nix | 9 ---- modules/audio.nix | 12 ----- modules/bare-metal.nix | 18 ------- modules/berlin.nix | 8 --- modules/british-english.nix | 4 -- modules/colemak.nix | 17 ------ modules/configuration/berlin.nix | 8 +++ modules/configuration/british-english.nix | 4 ++ modules/configuration/nix.nix | 25 +++++++++ modules/configuration/user.nix | 11 ++++ modules/connman.nix | 14 ----- modules/dev.nix | 19 ------- modules/development/base.nix | 19 +++++++ modules/development/javascript.nix | 15 ++++++ modules/development/lisp.nix | 11 ++++ modules/dotfiles.nix | 13 ----- modules/gnome.nix | 24 --------- modules/grub2.nix | 13 ----- modules/hardware/adb.nix | 9 ++++ modules/hardware/audio.nix | 12 +++++ modules/hardware/bare-metal.nix | 18 +++++++ modules/hardware/colemak.nix | 17 ++++++ modules/hardware/connman.nix | 14 +++++ modules/hardware/grub2.nix | 13 +++++ modules/hardware/hidpi.nix | 9 ++++ modules/hardware/intel-gpu.nix | 14 +++++ modules/hardware/laptop.nix | 77 +++++++++++++++++++++++++++ modules/hardware/network-manager.nix | 10 ++++ modules/hardware/nitrokey.nix | 26 +++++++++ modules/hardware/printing.nix | 8 +++ modules/hardware/synaptics.nix | 27 ++++++++++ modules/hardware/systemd-boot.nix | 10 ++++ modules/hardware/thinkpad.nix | 36 +++++++++++++ modules/hardware/trackball.nix | 13 +++++ modules/hidpi.nix | 9 ---- modules/i3.nix | 16 ------ modules/infrastructure.nix | 9 ---- modules/intel-gpu.nix | 14 ----- modules/javascript.nix | 15 ------ modules/laptop.nix | 77 --------------------------- modules/lisp.nix | 11 ---- modules/machines/t470s.nix | 25 +++++++++ modules/machines/x250.nix | 37 +++++++++++++ modules/network-manager.nix | 10 ---- modules/nitrokey.nix | 26 --------- modules/nix.nix | 25 --------- modules/passwords.nix | 8 --- modules/printing.nix | 8 --- modules/programs/accounting.nix | 10 ++++ modules/programs/dotfiles.nix | 13 +++++ modules/programs/gnome.nix | 24 +++++++++ modules/programs/i3.nix | 16 ++++++ modules/programs/infrastructure.nix | 9 ++++ modules/programs/passwords.nix | 8 +++ modules/programs/shell.nix | 29 ++++++++++ modules/programs/window-manager.nix | 18 +++++++ modules/services/syncthing.nix | 12 +++++ modules/services/xserver.nix | 88 +++++++++++++++++++++++++++++++ modules/services/zeroconf.nix | 7 +++ modules/shell.nix | 29 ---------- modules/synaptics.nix | 27 ---------- modules/syncthing.nix | 12 ----- modules/systemd-boot.nix | 10 ---- modules/t470s.nix | 24 --------- modules/thinkpad.nix | 35 ------------ modules/trackball.nix | 13 ----- modules/user-interface.nix | 2 +- modules/user.nix | 11 ---- modules/window-manager.nix | 18 ------- modules/x250.nix | 39 -------------- modules/xserver.nix | 88 ------------------------------- modules/zeroconf.nix | 7 --- satoshipad.nix | 53 +++++++++---------- 75 files changed, 752 insertions(+), 752 deletions(-) delete mode 100644 modules/accounting.nix delete mode 100644 modules/adb.nix delete mode 100644 modules/audio.nix delete mode 100644 modules/bare-metal.nix delete mode 100644 modules/berlin.nix delete mode 100644 modules/british-english.nix delete mode 100644 modules/colemak.nix create mode 100644 modules/configuration/berlin.nix create mode 100644 modules/configuration/british-english.nix create mode 100644 modules/configuration/nix.nix create mode 100644 modules/configuration/user.nix delete mode 100644 modules/connman.nix delete mode 100644 modules/dev.nix create mode 100644 modules/development/base.nix create mode 100644 modules/development/javascript.nix create mode 100644 modules/development/lisp.nix delete mode 100644 modules/dotfiles.nix delete mode 100644 modules/gnome.nix delete mode 100644 modules/grub2.nix create mode 100644 modules/hardware/adb.nix create mode 100644 modules/hardware/audio.nix create mode 100644 modules/hardware/bare-metal.nix create mode 100644 modules/hardware/colemak.nix create mode 100644 modules/hardware/connman.nix create mode 100644 modules/hardware/grub2.nix create mode 100644 modules/hardware/hidpi.nix create mode 100644 modules/hardware/intel-gpu.nix create mode 100644 modules/hardware/laptop.nix create mode 100644 modules/hardware/network-manager.nix create mode 100644 modules/hardware/nitrokey.nix create mode 100644 modules/hardware/printing.nix create mode 100644 modules/hardware/synaptics.nix create mode 100644 modules/hardware/systemd-boot.nix create mode 100644 modules/hardware/thinkpad.nix create mode 100644 modules/hardware/trackball.nix delete mode 100644 modules/hidpi.nix delete mode 100644 modules/i3.nix delete mode 100644 modules/infrastructure.nix delete mode 100644 modules/intel-gpu.nix delete mode 100644 modules/javascript.nix delete mode 100644 modules/laptop.nix delete mode 100644 modules/lisp.nix create mode 100644 modules/machines/t470s.nix create mode 100644 modules/machines/x250.nix delete mode 100644 modules/network-manager.nix delete mode 100644 modules/nitrokey.nix delete mode 100644 modules/nix.nix delete mode 100644 modules/passwords.nix delete mode 100644 modules/printing.nix create mode 100644 modules/programs/accounting.nix create mode 100644 modules/programs/dotfiles.nix create mode 100644 modules/programs/gnome.nix create mode 100644 modules/programs/i3.nix create mode 100644 modules/programs/infrastructure.nix create mode 100644 modules/programs/passwords.nix create mode 100644 modules/programs/shell.nix create mode 100644 modules/programs/window-manager.nix create mode 100644 modules/services/syncthing.nix create mode 100644 modules/services/xserver.nix create mode 100644 modules/services/zeroconf.nix delete mode 100644 modules/shell.nix delete mode 100644 modules/synaptics.nix delete mode 100644 modules/syncthing.nix delete mode 100644 modules/systemd-boot.nix delete mode 100644 modules/t470s.nix delete mode 100644 modules/thinkpad.nix delete mode 100644 modules/trackball.nix delete mode 100644 modules/user.nix delete mode 100644 modules/window-manager.nix delete mode 100644 modules/x250.nix delete mode 100644 modules/xserver.nix delete mode 100644 modules/zeroconf.nix diff --git a/marvin.nix b/marvin.nix index c3508fbe..55a97fd7 100644 --- a/marvin.nix +++ b/marvin.nix @@ -2,28 +2,29 @@ { imports = [ ./hardware-configuration.nix - ./modules/systemd-boot.nix - ./modules/audio.nix - ./modules/adb.nix - ./modules/syncthing.nix - ./modules/nitrokey.nix - ./modules/shell.nix - ./modules/dotfiles.nix - ./modules/berlin.nix - ./modules/colemak.nix - ./modules/trackball.nix - ./modules/british-english.nix - ./modules/x250.nix - ./modules/user.nix - ./modules/dev.nix - ./modules/lisp.nix - ./modules/javascript.nix - ./modules/infrastructure.nix - ./modules/accounting.nix - ./modules/passwords.nix - ./modules/network-manager.nix - ./modules/nix.nix - ./modules/i3.nix + + ./modules/configuration/berlin.nix + ./modules/configuration/british-english.nix + ./modules/configuration/nix.nix + ./modules/configuration/user.nix + ./modules/development/base.nix + ./modules/development/javascript.nix + ./modules/development/lisp.nix + ./modules/hardware/adb.nix + ./modules/hardware/audio.nix + ./modules/hardware/colemak.nix + ./modules/hardware/network-manager.nix + ./modules/hardware/nitrokey.nix + ./modules/hardware/systemd-boot.nix + ./modules/hardware/trackball.nix + ./modules/machines/x250.nix + ./modules/programs/accounting.nix + ./modules/programs/dotfiles.nix + ./modules/programs/i3.nix + ./modules/programs/infrastructure.nix + ./modules/programs/passwords.nix + ./modules/programs/shell.nix + ./modules/services/syncthing.nix ]; environment.systemPackages = with pkgs; [ diff --git a/modules/accounting.nix b/modules/accounting.nix deleted file mode 100644 index 5882436f..00000000 --- a/modules/accounting.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - aqbanking - ledger - bean-add - beancount - fava - ]; -} diff --git a/modules/adb.nix b/modules/adb.nix deleted file mode 100644 index 8b511f55..00000000 --- a/modules/adb.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ programs.adb.enable = true; - users.groups.adbusers = {}; - - services.udev = { - packages = [ pkgs.android-udev-rules ]; - }; -} diff --git a/modules/audio.nix b/modules/audio.nix deleted file mode 100644 index f5046574..00000000 --- a/modules/audio.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, ... }: - -{ hardware.pulseaudio = { - enable = true; - support32Bit = true; - }; - - environment.systemPackages = with pkgs; [ - pamixer - pavucontrol - ]; -} diff --git a/modules/bare-metal.nix b/modules/bare-metal.nix deleted file mode 100644 index b5e0fc7b..00000000 --- a/modules/bare-metal.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - fuse_exfat - cryptsetup - dmidecode - hdparm - pciutils - usbutils - ]; - - boot.kernelPackages = pkgs.linuxPackages_4_12; - - boot.tmpOnTmpfs = true; - - fileSystems."/".options = [ "noatime" "nodiratime" ]; - fileSystems."/home".options = [ "noatime" "nodiratime" ]; -} diff --git a/modules/berlin.nix b/modules/berlin.nix deleted file mode 100644 index 246510c4..00000000 --- a/modules/berlin.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ time.timeZone = "Europe/Berlin"; - services.redshift = { - latitude = "52.586"; - longitude = "13.300"; - }; -} diff --git a/modules/british-english.nix b/modules/british-english.nix deleted file mode 100644 index 3ff93678..00000000 --- a/modules/british-english.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ config, pkgs, ... }: - -{ i18n.defaultLocale = "en_GB.UTF-8"; -} diff --git a/modules/colemak.nix b/modules/colemak.nix deleted file mode 100644 index 3b1c0582..00000000 --- a/modules/colemak.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, pkgs, ... }: - -{ i18n.consoleKeyMap = "colemak/en-latin9"; - services.kmscon = { - extraConfig = '' - xkb-model=pc104 - xkb-layout=us - xkb-variant=colemak - xkb-options="altwin:prtsc_rwin" - ''; - }; - services.xserver = { - layout = "us,us"; - xkbVariant = "colemak,"; - xkbOptions = "grp:shifts_toggle,altwin:prtsc_rwin"; - }; -} diff --git a/modules/configuration/berlin.nix b/modules/configuration/berlin.nix new file mode 100644 index 00000000..246510c4 --- /dev/null +++ b/modules/configuration/berlin.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ time.timeZone = "Europe/Berlin"; + services.redshift = { + latitude = "52.586"; + longitude = "13.300"; + }; +} diff --git a/modules/configuration/british-english.nix b/modules/configuration/british-english.nix new file mode 100644 index 00000000..3ff93678 --- /dev/null +++ b/modules/configuration/british-english.nix @@ -0,0 +1,4 @@ +{ config, pkgs, ... }: + +{ i18n.defaultLocale = "en_GB.UTF-8"; +} diff --git a/modules/configuration/nix.nix b/modules/configuration/nix.nix new file mode 100644 index 00000000..504942ec --- /dev/null +++ b/modules/configuration/nix.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ... }: + +{ nix = { + buildCores = 0; + + daemonNiceLevel = 10; + daemonIONiceLevel = 4; + + autoOptimiseStore = true; + gc = { + automatic = true; + options = "--delete-older-than 30d"; + }; + }; + + system.autoUpgrade = { + enable = true; + }; + systemd.services.nixos-upgrade = { + environment.NIXPKGS_ALLOW_UNFREE = "1"; + script = '' + ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} + ''; + }; +} diff --git a/modules/configuration/user.nix b/modules/configuration/user.nix new file mode 100644 index 00000000..1b2b6747 --- /dev/null +++ b/modules/configuration/user.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ users.extraUsers.alan = { + description = "Alan Pearce"; + isNormalUser = true; + extraGroups = [ "audio" "wheel" "adbusers" "docker" ]; + shell = "/run/current-system/sw/bin/zsh"; + home = "/home/alan"; + uid = 1000; + }; +} diff --git a/modules/connman.nix b/modules/connman.nix deleted file mode 100644 index 0361f9cb..00000000 --- a/modules/connman.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, pkgs, ... }: - -{ networking.connman = { - enable = true; - enableVPN = false; - }; - networking.wireless.enable = true; - - environment.systemPackages = with pkgs; [ - cmst - connman-notify - connman_dmenu - ]; -} diff --git a/modules/dev.nix b/modules/dev.nix deleted file mode 100644 index abe5f969..00000000 --- a/modules/dev.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - mercurial - gitAndTools.git-extras - gitAndTools.hub - - editorconfig-core-c - - ag - ripgrep - - httpie - http-prompt - mitmproxy - - nodePackages.js-yaml - ]; -} diff --git a/modules/development/base.nix b/modules/development/base.nix new file mode 100644 index 00000000..abe5f969 --- /dev/null +++ b/modules/development/base.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + mercurial + gitAndTools.git-extras + gitAndTools.hub + + editorconfig-core-c + + ag + ripgrep + + httpie + http-prompt + mitmproxy + + nodePackages.js-yaml + ]; +} diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix new file mode 100644 index 00000000..cc5b89e8 --- /dev/null +++ b/modules/development/javascript.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ environment.systemPackages = with pkgs; [ + nodejs-8_x + pkgsUnstable.flow + pkgsUnstable.nodePackages.yarn + pkgsUnstable.nodePackages.tern + pkgsUnstable.nodePackages.node2nix + pkgsUnstable.nodePackages.nodemon + ]; +} diff --git a/modules/development/lisp.nix b/modules/development/lisp.nix new file mode 100644 index 00000000..ffaa7115 --- /dev/null +++ b/modules/development/lisp.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + ccl + sbcl + lispPackages.quicklisp + + dust + pixie + ]; +} diff --git a/modules/dotfiles.nix b/modules/dotfiles.nix deleted file mode 100644 index eed22233..00000000 --- a/modules/dotfiles.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in -{ environment.systemPackages = with pkgs; [ - git - stow - fzf - pkgsUnstable.ghq - ]; -} diff --git a/modules/gnome.nix b/modules/gnome.nix deleted file mode 100644 index bd785453..00000000 --- a/modules/gnome.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -{ services = { - gnome3 = { - gnome-documents.enable = false; - gnome-user-share.enable = false; - gnome-online-accounts.enable = false; - seahorse.enable = false; - tracker.enable = false; - }; - telepathy.enable = false; - - xserver = { - desktopManager.gnome3 = { - enable = true; - extraGSettingsOverrides = '' - [org.gnome.desktop.input-sources] - sources=[('xkb','${config.services.xserver.layout + (optionalString (config.services.xserver.xkbVariant != "") ("+" + config.services.xserver.xkbVariant))}')] - ''; - }; - }; - }; -} diff --git a/modules/grub2.nix b/modules/grub2.nix deleted file mode 100644 index 70e86e71..00000000 --- a/modules/grub2.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ boot.loader = { - grub = { - enable = true; - splashImage = null; - version = 2; - device = "nodev"; - efiSupport = true; - }; - efi.canTouchEfiVariables = true; - }; -} diff --git a/modules/hardware/adb.nix b/modules/hardware/adb.nix new file mode 100644 index 00000000..8b511f55 --- /dev/null +++ b/modules/hardware/adb.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ programs.adb.enable = true; + users.groups.adbusers = {}; + + services.udev = { + packages = [ pkgs.android-udev-rules ]; + }; +} diff --git a/modules/hardware/audio.nix b/modules/hardware/audio.nix new file mode 100644 index 00000000..f5046574 --- /dev/null +++ b/modules/hardware/audio.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ hardware.pulseaudio = { + enable = true; + support32Bit = true; + }; + + environment.systemPackages = with pkgs; [ + pamixer + pavucontrol + ]; +} diff --git a/modules/hardware/bare-metal.nix b/modules/hardware/bare-metal.nix new file mode 100644 index 00000000..b5e0fc7b --- /dev/null +++ b/modules/hardware/bare-metal.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + fuse_exfat + cryptsetup + dmidecode + hdparm + pciutils + usbutils + ]; + + boot.kernelPackages = pkgs.linuxPackages_4_12; + + boot.tmpOnTmpfs = true; + + fileSystems."/".options = [ "noatime" "nodiratime" ]; + fileSystems."/home".options = [ "noatime" "nodiratime" ]; +} diff --git a/modules/hardware/colemak.nix b/modules/hardware/colemak.nix new file mode 100644 index 00000000..3b1c0582 --- /dev/null +++ b/modules/hardware/colemak.nix @@ -0,0 +1,17 @@ +{ config, pkgs, ... }: + +{ i18n.consoleKeyMap = "colemak/en-latin9"; + services.kmscon = { + extraConfig = '' + xkb-model=pc104 + xkb-layout=us + xkb-variant=colemak + xkb-options="altwin:prtsc_rwin" + ''; + }; + services.xserver = { + layout = "us,us"; + xkbVariant = "colemak,"; + xkbOptions = "grp:shifts_toggle,altwin:prtsc_rwin"; + }; +} diff --git a/modules/hardware/connman.nix b/modules/hardware/connman.nix new file mode 100644 index 00000000..0361f9cb --- /dev/null +++ b/modules/hardware/connman.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ networking.connman = { + enable = true; + enableVPN = false; + }; + networking.wireless.enable = true; + + environment.systemPackages = with pkgs; [ + cmst + connman-notify + connman_dmenu + ]; +} diff --git a/modules/hardware/grub2.nix b/modules/hardware/grub2.nix new file mode 100644 index 00000000..70e86e71 --- /dev/null +++ b/modules/hardware/grub2.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ boot.loader = { + grub = { + enable = true; + splashImage = null; + version = 2; + device = "nodev"; + efiSupport = true; + }; + efi.canTouchEfiVariables = true; + }; +} diff --git a/modules/hardware/hidpi.nix b/modules/hardware/hidpi.nix new file mode 100644 index 00000000..1f4644c5 --- /dev/null +++ b/modules/hardware/hidpi.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ i18n = { + consoleFont = "ter-v24b"; + consolePackages = with pkgs; [ + terminus_font + ]; + }; +} diff --git a/modules/hardware/intel-gpu.nix b/modules/hardware/intel-gpu.nix new file mode 100644 index 00000000..b44ddadf --- /dev/null +++ b/modules/hardware/intel-gpu.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ hardware.opengl.extraPackages = with pkgs; [ + vaapiIntel + ]; + + boot.earlyVconsoleSetup = true; + boot.initrd.kernelModules = [ + "i915" + ]; + boot.kernelModules = [ + "i915" + ]; +} diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix new file mode 100644 index 00000000..55dcbd17 --- /dev/null +++ b/modules/hardware/laptop.nix @@ -0,0 +1,77 @@ +{ config, pkgs, lib, ... }: + +{ boot.kernelModules = [ "coretemp" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + x86_energy_perf_policy + ]; + + hardware = { + bluetooth.enable = true; + }; + + environment.systemPackages = with pkgs; [ + powerstat + powertop + + arandr + autorandr + disper + ]; + + # powerManagement.resumeCommands = '' + # AUTORANDR="autorandr -c" + + # detect_display() + # { + # for X in /tmp/.X11-unix/X*; do + # D="''${X##/tmp/.X11-unix/X}" + # user=$(who | awk -vD="$D" '$5 ~ "\\(:"D"\\)$" {print $1}') + # if [ x"$user" != x"" ]; then + # export DISPLAY=":$D" + # /bin/su -c "''${AUTORANDR}" "$user" + # fi + # done + # } + + # case "$1" in + # thaw|resume) + # detect_display + # ;; + # esac + # ''; + + programs.light.enable = true; + + services.logind.extraConfig = '' + IdleAction=suspend + IdleActionSec=600 + ''; + + services.physlock.enable = false; + + services.tlp = { + enable = true; + extraConfig = '' + CPU_SCALING_GOVERNOR_ON_BAT=powersave + ''; + }; + + services.udev.extraRules = '' + # ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/alan/.Xauthority", RUN+="${pkgs.autorandr}/bin/autorandr -c" + ''; + + services.xserver = { + libinput = { + enable = lib.mkDefault true; + naturalScrolling = true; + disableWhileTyping = true; + }; + }; + + systemd.services.nixos-upgrade.unitConfig.ConditionACPower = true; + systemd.services.nix-gc.unitConfig.ConditionACPower = true; + + imports = [ + ../user-interface.nix + ]; +} diff --git a/modules/hardware/network-manager.nix b/modules/hardware/network-manager.nix new file mode 100644 index 00000000..b85b8f41 --- /dev/null +++ b/modules/hardware/network-manager.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ networking.networkmanager = { + enable = true; + }; + + environment.systemPackages = with pkgs; [ + networkmanagerapplet + ]; +} diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix new file mode 100644 index 00000000..ac85e352 --- /dev/null +++ b/modules/hardware/nitrokey.nix @@ -0,0 +1,26 @@ +{ config, nixpkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ programs.ssh.startAgent = false; + + services.pcscd.enable = true; + + services.tor = { + enable = true; + client = { + enable = true; + socksListenAddress = "9050 IPv6Traffic"; + }; + torsocks = { + enable = true; + }; + }; + + environment.systemPackages = [ + pkgsUnstable.gnupg + pkgsUnstable.nitrokey-app + ]; +} diff --git a/modules/hardware/printing.nix b/modules/hardware/printing.nix new file mode 100644 index 00000000..beba72ed --- /dev/null +++ b/modules/hardware/printing.nix @@ -0,0 +1,8 @@ +{ config, pkgs, lib, ... }: + +{ services.printing.enable = true; + + imports = [ + ../services/zeroconf.nix + ]; +} diff --git a/modules/hardware/synaptics.nix b/modules/hardware/synaptics.nix new file mode 100644 index 00000000..9f075cce --- /dev/null +++ b/modules/hardware/synaptics.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: + +{ services.xserver = { + libinput.enable = false; + synaptics = { + enable = true; + + accelFactor = "0.04"; + + minSpeed = "0.3"; + maxSpeed = "0.6"; + + palmDetect = true; + palmMinWidth = 5; + palmMinZ = 20; + + twoFingerScroll = true; + vertTwoFingerScroll = true; + horizTwoFingerScroll = true; + additionalOptions = '' + Option "RBCornerButton" "3" + Option "VertScrollDelta" "-111" + Option "HorizScrollDelta" "-111" + ''; + }; + }; +} diff --git a/modules/hardware/systemd-boot.nix b/modules/hardware/systemd-boot.nix new file mode 100644 index 00000000..80e79fdc --- /dev/null +++ b/modules/hardware/systemd-boot.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ boot.loader.systemd-boot = { + enable = true; + editor = false; # Don't allow modification + }; + boot.loader.efi.canTouchEfiVariables = true; + boot.vesa = true; + boot.earlyVconsoleSetup = true; +} diff --git a/modules/hardware/thinkpad.nix b/modules/hardware/thinkpad.nix new file mode 100644 index 00000000..1e97f06c --- /dev/null +++ b/modules/hardware/thinkpad.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: + +{ boot.kernelModules = [ "tp_smapi" ]; + boot.blacklistedKernelModules = [ "thinkpad_ec" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + # acpi_call + tp_smapi + ]; + + hardware.trackpoint = { + enable = true; + emulateWheel = true; + }; + + services.thinkfan = { + enable = true; + sensor = "/sys/class/thermal/thermal_zone0/temp"; + }; + + services.tlp = { + enable = true; + extraConfig = '' + # Newer Thinkpads have a battery firmware + # it conflicts with TLP if stop thresholds are set + START_CHARGE_THRESH_BAT0=70 + STOP_CHARGE_THRESH_BAT0=80 + START_CHARGE_THRESH_BAT1=70 + STOP_CHARGE_THRESH_BAT1=80 + ''; + }; + + imports = [ + ./bare-metal.nix + ./laptop.nix + ]; +} diff --git a/modules/hardware/trackball.nix b/modules/hardware/trackball.nix new file mode 100644 index 00000000..9aa5abc0 --- /dev/null +++ b/modules/hardware/trackball.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ services.xserver.config = '' + Section "InputClass" + Identifier "Trackball (No Acceleration)" + MatchIsPointer "yes" + MatchIsTouchpad "no" + MatchProduct "Trackball" + Option "AccelerationProfile" "-1" + Option "AccelerationScheme" "none" + EndSection + ''; +} diff --git a/modules/hidpi.nix b/modules/hidpi.nix deleted file mode 100644 index 1f4644c5..00000000 --- a/modules/hidpi.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ i18n = { - consoleFont = "ter-v24b"; - consolePackages = with pkgs; [ - terminus_font - ]; - }; -} diff --git a/modules/i3.nix b/modules/i3.nix deleted file mode 100644 index 3bba3bbb..00000000 --- a/modules/i3.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver.windowManager.i3 = { - enable = true; - package = pkgs.i3-gaps; - }; - - environment.systemPackages = with pkgs; [ - i3status - i3lock-color - ]; - - imports = [ - ./window-manager.nix - ]; -} diff --git a/modules/infrastructure.nix b/modules/infrastructure.nix deleted file mode 100644 index b41816e2..00000000 --- a/modules/infrastructure.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - ansible - hugo - - nixops - ]; -} diff --git a/modules/intel-gpu.nix b/modules/intel-gpu.nix deleted file mode 100644 index b44ddadf..00000000 --- a/modules/intel-gpu.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, pkgs, ... }: - -{ hardware.opengl.extraPackages = with pkgs; [ - vaapiIntel - ]; - - boot.earlyVconsoleSetup = true; - boot.initrd.kernelModules = [ - "i915" - ]; - boot.kernelModules = [ - "i915" - ]; -} diff --git a/modules/javascript.nix b/modules/javascript.nix deleted file mode 100644 index cc5b89e8..00000000 --- a/modules/javascript.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, pkgs, ... }: - -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in -{ environment.systemPackages = with pkgs; [ - nodejs-8_x - pkgsUnstable.flow - pkgsUnstable.nodePackages.yarn - pkgsUnstable.nodePackages.tern - pkgsUnstable.nodePackages.node2nix - pkgsUnstable.nodePackages.nodemon - ]; -} diff --git a/modules/laptop.nix b/modules/laptop.nix deleted file mode 100644 index c50c28e4..00000000 --- a/modules/laptop.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ boot.kernelModules = [ "coretemp" ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ - x86_energy_perf_policy - ]; - - hardware = { - bluetooth.enable = true; - }; - - environment.systemPackages = with pkgs; [ - powerstat - powertop - - arandr - autorandr - disper - ]; - - # powerManagement.resumeCommands = '' - # AUTORANDR="autorandr -c" - - # detect_display() - # { - # for X in /tmp/.X11-unix/X*; do - # D="''${X##/tmp/.X11-unix/X}" - # user=$(who | awk -vD="$D" '$5 ~ "\\(:"D"\\)$" {print $1}') - # if [ x"$user" != x"" ]; then - # export DISPLAY=":$D" - # /bin/su -c "''${AUTORANDR}" "$user" - # fi - # done - # } - - # case "$1" in - # thaw|resume) - # detect_display - # ;; - # esac - # ''; - - programs.light.enable = true; - - services.logind.extraConfig = '' - IdleAction=suspend - IdleActionSec=600 - ''; - - services.physlock.enable = false; - - services.tlp = { - enable = true; - extraConfig = '' - CPU_SCALING_GOVERNOR_ON_BAT=powersave - ''; - }; - - services.udev.extraRules = '' - # ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/alan/.Xauthority", RUN+="${pkgs.autorandr}/bin/autorandr -c" - ''; - - services.xserver = { - libinput = { - enable = lib.mkDefault true; - naturalScrolling = true; - disableWhileTyping = true; - }; - }; - - systemd.services.nixos-upgrade.unitConfig.ConditionACPower = true; - systemd.services.nix-gc.unitConfig.ConditionACPower = true; - - imports = [ - ./user-interface.nix - ]; -} diff --git a/modules/lisp.nix b/modules/lisp.nix deleted file mode 100644 index ffaa7115..00000000 --- a/modules/lisp.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - ccl - sbcl - lispPackages.quicklisp - - dust - pixie - ]; -} diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix new file mode 100644 index 00000000..21614f0e --- /dev/null +++ b/modules/machines/t470s.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ... }: + +{ hardware.usbWwan.enable = true; + hardware.firmware = with pkgs; [ + firmwareLinuxNonfree + ]; + + boot.blacklistedKernelModules = [ "thinkpad_acpi" ]; + + systemd.services.ModemManager.enable = true; + + hardware.pulseaudio.extraConfig = '' + load-module module-alsa-sink device=hw:0,7 + ''; + + environment.systemPackages = with pkgs; [ + nvme-cli + ]; + + imports = [ + ../hardware/intel-gpu.nix + ../hardware/hidpi.nix + ../hardware/thinkpad.nix + ]; +} diff --git a/modules/machines/x250.nix b/modules/machines/x250.nix new file mode 100644 index 00000000..c527f4dc --- /dev/null +++ b/modules/machines/x250.nix @@ -0,0 +1,37 @@ +{ config, pkgs, ... }: + +{ boot.extraModulePackages = with config.boot.kernelPackages; [ + acpi_call + ]; + + hardware.firmware = with pkgs; [ + firmwareLinuxNonfree + ]; + + services.xserver.monitorSection = '' + DisplaySize 277 156 + ''; + + services.tlp.extraConfig = '' + # Newer Thinkpads have a battery firmware + # it conflicts with TLP if stop thresholds are set + START_CHARGE_THRESH_BAT0=70 + # STOP_CHARGE_THRESH_BAT0=80 + START_CHARGE_THRESH_BAT1=70 + # STOP_CHARGE_THRESH_BAT1=80 + + DISK_APM_LEVEL_ON_AC="254 254" + DISK_APM_LEVEL_ON_BAT="128 128" + + # One or both of these lines stops disk corruption + # when re-attaching to AC whilst on. + SATA_LINKPWR_ON_BAT=medium_power + SATA_LINKPWR_BLACKLIST="host1" + ''; + + imports = [ + ../hardware/synaptics.nix + ../hardware/intel-gpu.nix + ../hardware/thinkpad.nix + ]; +} diff --git a/modules/network-manager.nix b/modules/network-manager.nix deleted file mode 100644 index b85b8f41..00000000 --- a/modules/network-manager.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: - -{ networking.networkmanager = { - enable = true; - }; - - environment.systemPackages = with pkgs; [ - networkmanagerapplet - ]; -} diff --git a/modules/nitrokey.nix b/modules/nitrokey.nix deleted file mode 100644 index ac85e352..00000000 --- a/modules/nitrokey.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, nixpkgs, ... }: - -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in -{ programs.ssh.startAgent = false; - - services.pcscd.enable = true; - - services.tor = { - enable = true; - client = { - enable = true; - socksListenAddress = "9050 IPv6Traffic"; - }; - torsocks = { - enable = true; - }; - }; - - environment.systemPackages = [ - pkgsUnstable.gnupg - pkgsUnstable.nitrokey-app - ]; -} diff --git a/modules/nix.nix b/modules/nix.nix deleted file mode 100644 index 504942ec..00000000 --- a/modules/nix.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, pkgs, ... }: - -{ nix = { - buildCores = 0; - - daemonNiceLevel = 10; - daemonIONiceLevel = 4; - - autoOptimiseStore = true; - gc = { - automatic = true; - options = "--delete-older-than 30d"; - }; - }; - - system.autoUpgrade = { - enable = true; - }; - systemd.services.nixos-upgrade = { - environment.NIXPKGS_ALLOW_UNFREE = "1"; - script = '' - ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} - ''; - }; -} diff --git a/modules/passwords.nix b/modules/passwords.nix deleted file mode 100644 index 8c9d7cff..00000000 --- a/modules/passwords.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - keepassx-community - pass - pwgen - ]; -} diff --git a/modules/printing.nix b/modules/printing.nix deleted file mode 100644 index 3172f33b..00000000 --- a/modules/printing.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ services.printing.enable = true; - - imports = [ - ./zeroconf.nix - ]; -} diff --git a/modules/programs/accounting.nix b/modules/programs/accounting.nix new file mode 100644 index 00000000..5882436f --- /dev/null +++ b/modules/programs/accounting.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + aqbanking + ledger + bean-add + beancount + fava + ]; +} diff --git a/modules/programs/dotfiles.nix b/modules/programs/dotfiles.nix new file mode 100644 index 00000000..eed22233 --- /dev/null +++ b/modules/programs/dotfiles.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ environment.systemPackages = with pkgs; [ + git + stow + fzf + pkgsUnstable.ghq + ]; +} diff --git a/modules/programs/gnome.nix b/modules/programs/gnome.nix new file mode 100644 index 00000000..bd785453 --- /dev/null +++ b/modules/programs/gnome.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: + +with lib; +{ services = { + gnome3 = { + gnome-documents.enable = false; + gnome-user-share.enable = false; + gnome-online-accounts.enable = false; + seahorse.enable = false; + tracker.enable = false; + }; + telepathy.enable = false; + + xserver = { + desktopManager.gnome3 = { + enable = true; + extraGSettingsOverrides = '' + [org.gnome.desktop.input-sources] + sources=[('xkb','${config.services.xserver.layout + (optionalString (config.services.xserver.xkbVariant != "") ("+" + config.services.xserver.xkbVariant))}')] + ''; + }; + }; + }; +} diff --git a/modules/programs/i3.nix b/modules/programs/i3.nix new file mode 100644 index 00000000..3bba3bbb --- /dev/null +++ b/modules/programs/i3.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: + +{ services.xserver.windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + }; + + environment.systemPackages = with pkgs; [ + i3status + i3lock-color + ]; + + imports = [ + ./window-manager.nix + ]; +} diff --git a/modules/programs/infrastructure.nix b/modules/programs/infrastructure.nix new file mode 100644 index 00000000..b41816e2 --- /dev/null +++ b/modules/programs/infrastructure.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + ansible + hugo + + nixops + ]; +} diff --git a/modules/programs/passwords.nix b/modules/programs/passwords.nix new file mode 100644 index 00000000..8c9d7cff --- /dev/null +++ b/modules/programs/passwords.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + keepassx-community + pass + pwgen + ]; +} diff --git a/modules/programs/shell.nix b/modules/programs/shell.nix new file mode 100644 index 00000000..3ea43adc --- /dev/null +++ b/modules/programs/shell.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ programs.zsh = { + enable = true; + promptInit = ""; + }; + programs.bash.enableCompletion = true; + programs.xonsh = { + enable = true; + }; + + environment.systemPackages = with pkgs; [ + vim + pv + file + htop + lsof + iftop + iotop + nmap + netperf + moreutils + psmisc + tree + zip + unzip + telnet + ]; +} diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix new file mode 100644 index 00000000..c1593745 --- /dev/null +++ b/modules/programs/window-manager.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ services.xserver.displayManager = { + lightdm = { + enable = true; + }; + }; + + environment.systemPackages = with pkgs; [ + dmenu + dunst + libnotify # for notify-send + sxhkd + scrot + + perlPackages.FileMimeInfo # xdg-utils uses this when no DE + ]; +} diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix new file mode 100644 index 00000000..5a3e1d6e --- /dev/null +++ b/modules/services/syncthing.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ services.syncthing = { + enable = true; + user = "alan"; + group = "users"; + openDefaultPorts = true; + systemService = true; + useInotify = true; + dataDir = "/home/alan/.config/syncthing"; + }; +} diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix new file mode 100644 index 00000000..2cef678b --- /dev/null +++ b/modules/services/xserver.nix @@ -0,0 +1,88 @@ +{ config, pkgs, ... }: + +{ services.xserver = { + enable = true; + enableCtrlAltBackspace = true; + exportConfiguration = true; + }; + + services.dbus.socketActivated = true; + + environment.sessionVariables = { + XCURSOR_PATH = [ + "${config.system.path}/share/icons" + "$HOME/.icons" + "$HOME/.nix-profile/share/icons/" + ]; + }; + + environment.systemPackages = with pkgs; [ + xorg.xmodmap + xorg.xinit + xorg.xev + xorg.xdpyinfo + xclip + xfontsel + + vanilla-dmz + + hicolor_icon_theme + adapta-gtk-theme + flat-plat + paper-gtk-theme + paper-icon-theme + + arc-icon-theme + tango-icon-theme + + gtk-engine-murrine + gtk_engines + ]; + + fonts = { + enableFontDir = true; + enableDefaultFonts = true; + fontconfig = { + defaultFonts = { + monospace = [ "Liberation Mono" ]; + sansSerif = [ "Liberation Sans" ]; + serif = [ "Liberation Serif" ]; + }; + ultimate = { + enable = true; + # presets: + # ultimate1 ultimate2 ultimate3 ultimate4 ultimate5 osx windowsxp + preset = "ultimate3"; + }; + }; + fonts = with pkgs; [ + cantarell_fonts + carlito + dejavu_fonts + fantasque-sans-mono + fira + fira-code + fira-mono + font-droid + font-awesome-ttf + hack-font + liberation_ttf + mononoki + (nerdfonts.override { + withFont = "Monoid"; + }) + opensans-ttf + paratype-pt-mono + paratype-pt-sans + paratype-pt-serif + roboto + roboto-mono + roboto-slab + source-code-pro + source-sans-pro + source-serif-pro + terminus_font + xorg.fontxfree86type1 + ]; + }; +} diff --git a/modules/services/zeroconf.nix b/modules/services/zeroconf.nix new file mode 100644 index 00000000..aa4b47e8 --- /dev/null +++ b/modules/services/zeroconf.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ services.avahi = { + enable = true; + nssmdns = true; + }; +} diff --git a/modules/shell.nix b/modules/shell.nix deleted file mode 100644 index 3ea43adc..00000000 --- a/modules/shell.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, pkgs, ... }: - -{ programs.zsh = { - enable = true; - promptInit = ""; - }; - programs.bash.enableCompletion = true; - programs.xonsh = { - enable = true; - }; - - environment.systemPackages = with pkgs; [ - vim - pv - file - htop - lsof - iftop - iotop - nmap - netperf - moreutils - psmisc - tree - zip - unzip - telnet - ]; -} diff --git a/modules/synaptics.nix b/modules/synaptics.nix deleted file mode 100644 index 9f075cce..00000000 --- a/modules/synaptics.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver = { - libinput.enable = false; - synaptics = { - enable = true; - - accelFactor = "0.04"; - - minSpeed = "0.3"; - maxSpeed = "0.6"; - - palmDetect = true; - palmMinWidth = 5; - palmMinZ = 20; - - twoFingerScroll = true; - vertTwoFingerScroll = true; - horizTwoFingerScroll = true; - additionalOptions = '' - Option "RBCornerButton" "3" - Option "VertScrollDelta" "-111" - Option "HorizScrollDelta" "-111" - ''; - }; - }; -} diff --git a/modules/syncthing.nix b/modules/syncthing.nix deleted file mode 100644 index 5a3e1d6e..00000000 --- a/modules/syncthing.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, ... }: - -{ services.syncthing = { - enable = true; - user = "alan"; - group = "users"; - openDefaultPorts = true; - systemService = true; - useInotify = true; - dataDir = "/home/alan/.config/syncthing"; - }; -} diff --git a/modules/systemd-boot.nix b/modules/systemd-boot.nix deleted file mode 100644 index 80e79fdc..00000000 --- a/modules/systemd-boot.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: - -{ boot.loader.systemd-boot = { - enable = true; - editor = false; # Don't allow modification - }; - boot.loader.efi.canTouchEfiVariables = true; - boot.vesa = true; - boot.earlyVconsoleSetup = true; -} diff --git a/modules/t470s.nix b/modules/t470s.nix deleted file mode 100644 index 394df773..00000000 --- a/modules/t470s.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, pkgs, ... }: - -{ hardware.usbWwan.enable = true; - hardware.firmware = with pkgs; [ - firmwareLinuxNonfree - ]; - - boot.blacklistedKernelModules = [ "thinkpad_acpi" ]; - - systemd.services.ModemManager.enable = true; - - hardware.pulseaudio.extraConfig = '' - load-module module-alsa-sink device=hw:0,7 - ''; - - environment.systemPackages = with pkgs; [ - nvme-cli - ]; - - imports = [ - ./intel-gpu.nix - ./thinkpad.nix - ]; -} diff --git a/modules/thinkpad.nix b/modules/thinkpad.nix deleted file mode 100644 index 38133d76..00000000 --- a/modules/thinkpad.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, pkgs, ... }: - -{ boot.kernelModules = [ "tp_smapi" ]; - boot.blacklistedKernelModules = [ "thinkpad_ec" ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ - # acpi_call - tp_smapi - ]; - - hardware.trackpoint = { - enable = true; - emulateWheel = true; - }; - - services.thinkfan = { - enable = true; - sensor = "/sys/class/thermal/thermal_zone0/temp"; - }; - - services.tlp = { - enable = true; - extraConfig = '' - # Newer Thinkpads have a battery firmware - # it conflicts with TLP if stop thresholds are set - START_CHARGE_THRESH_BAT0=70 - STOP_CHARGE_THRESH_BAT0=80 - START_CHARGE_THRESH_BAT1=70 - STOP_CHARGE_THRESH_BAT1=80 - ''; - }; - - imports = [ - ./bare-metal.nix - ]; -} diff --git a/modules/trackball.nix b/modules/trackball.nix deleted file mode 100644 index 9aa5abc0..00000000 --- a/modules/trackball.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver.config = '' - Section "InputClass" - Identifier "Trackball (No Acceleration)" - MatchIsPointer "yes" - MatchIsTouchpad "no" - MatchProduct "Trackball" - Option "AccelerationProfile" "-1" - Option "AccelerationScheme" "none" - EndSection - ''; -} diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 09cb2bc6..67989a97 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -78,6 +78,6 @@ in }; imports = [ - ./xserver.nix + ./services/xserver.nix ]; } diff --git a/modules/user.nix b/modules/user.nix deleted file mode 100644 index 1b2b6747..00000000 --- a/modules/user.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: - -{ users.extraUsers.alan = { - description = "Alan Pearce"; - isNormalUser = true; - extraGroups = [ "audio" "wheel" "adbusers" "docker" ]; - shell = "/run/current-system/sw/bin/zsh"; - home = "/home/alan"; - uid = 1000; - }; -} diff --git a/modules/window-manager.nix b/modules/window-manager.nix deleted file mode 100644 index c1593745..00000000 --- a/modules/window-manager.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver.displayManager = { - lightdm = { - enable = true; - }; - }; - - environment.systemPackages = with pkgs; [ - dmenu - dunst - libnotify # for notify-send - sxhkd - scrot - - perlPackages.FileMimeInfo # xdg-utils uses this when no DE - ]; -} diff --git a/modules/x250.nix b/modules/x250.nix deleted file mode 100644 index e163ec4f..00000000 --- a/modules/x250.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, pkgs, ... }: - -{ imports = [ - ./synaptics.nix - ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ - acpi_call - ]; - - hardware.firmware = with pkgs; [ - firmwareLinuxNonfree - ]; - - services.xserver.monitorSection = '' - DisplaySize 277 156 - ''; - - services.tlp.extraConfig = '' - # Newer Thinkpads have a battery firmware - # it conflicts with TLP if stop thresholds are set - START_CHARGE_THRESH_BAT0=70 - # STOP_CHARGE_THRESH_BAT0=80 - START_CHARGE_THRESH_BAT1=70 - # STOP_CHARGE_THRESH_BAT1=80 - - DISK_APM_LEVEL_ON_AC="254 254" - DISK_APM_LEVEL_ON_BAT="128 128" - - # One or both of these lines stops disk corruption - # when re-attaching to AC whilst on. - SATA_LINKPWR_ON_BAT=medium_power - SATA_LINKPWR_BLACKLIST="host1" - ''; - - imports = [ - ./intel-gpu.nix - ./thinkpad.nix - ]; -} diff --git a/modules/xserver.nix b/modules/xserver.nix deleted file mode 100644 index 2cef678b..00000000 --- a/modules/xserver.nix +++ /dev/null @@ -1,88 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver = { - enable = true; - enableCtrlAltBackspace = true; - exportConfiguration = true; - }; - - services.dbus.socketActivated = true; - - environment.sessionVariables = { - XCURSOR_PATH = [ - "${config.system.path}/share/icons" - "$HOME/.icons" - "$HOME/.nix-profile/share/icons/" - ]; - }; - - environment.systemPackages = with pkgs; [ - xorg.xmodmap - xorg.xinit - xorg.xev - xorg.xdpyinfo - xclip - xfontsel - - vanilla-dmz - - hicolor_icon_theme - adapta-gtk-theme - flat-plat - paper-gtk-theme - paper-icon-theme - - arc-icon-theme - tango-icon-theme - - gtk-engine-murrine - gtk_engines - ]; - - fonts = { - enableFontDir = true; - enableDefaultFonts = true; - fontconfig = { - defaultFonts = { - monospace = [ "Liberation Mono" ]; - sansSerif = [ "Liberation Sans" ]; - serif = [ "Liberation Serif" ]; - }; - ultimate = { - enable = true; - # presets: - # ultimate1 ultimate2 ultimate3 ultimate4 ultimate5 osx windowsxp - preset = "ultimate3"; - }; - }; - fonts = with pkgs; [ - cantarell_fonts - carlito - dejavu_fonts - fantasque-sans-mono - fira - fira-code - fira-mono - font-droid - font-awesome-ttf - hack-font - liberation_ttf - mononoki - (nerdfonts.override { - withFont = "Monoid"; - }) - opensans-ttf - paratype-pt-mono - paratype-pt-sans - paratype-pt-serif - roboto - roboto-mono - roboto-slab - source-code-pro - source-sans-pro - source-serif-pro - terminus_font - xorg.fontxfree86type1 - ]; - }; -} diff --git a/modules/zeroconf.nix b/modules/zeroconf.nix deleted file mode 100644 index aa4b47e8..00000000 --- a/modules/zeroconf.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, ... }: - -{ services.avahi = { - enable = true; - nssmdns = true; - }; -} diff --git a/satoshipad.nix b/satoshipad.nix index bc927248..56ee7b45 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -3,35 +3,34 @@ { imports = [ ./hardware-configuration.nix + ./private/default.nix + ./modules/base.nix - ./modules/grub2.nix - ./modules/audio.nix - ./modules/adb.nix - ./modules/syncthing.nix - ./modules/hidpi.nix - ./modules/nitrokey.nix - ./modules/shell.nix - ./modules/dotfiles.nix - ./modules/berlin.nix - ./modules/colemak.nix - ./modules/trackball.nix - ./modules/british-english.nix - ./modules/printing.nix - ./modules/t470s.nix - ./modules/user.nix - ./modules/dev.nix - ./modules/lisp.nix - ./modules/javascript.nix + ./modules/configuration/berlin.nix + ./modules/configuration/british-english.nix + ./modules/configuration/nix.nix + ./modules/configuration/user.nix + ./modules/development/base.nix + ./modules/development/javascript.nix + ./modules/development/lisp.nix + ./modules/hardware/adb.nix + ./modules/hardware/audio.nix + ./modules/hardware/colemak.nix + ./modules/hardware/grub2.nix + ./modules/hardware/network-manager.nix + ./modules/hardware/nitrokey.nix + ./modules/hardware/printing.nix + ./modules/hardware/trackball.nix + ./modules/machines/t470s.nix + ./modules/programs/accounting.nix + ./modules/programs/dotfiles.nix + ./modules/programs/gnome.nix + ./modules/programs/i3.nix + ./modules/programs/infrastructure.nix + ./modules/programs/passwords.nix + ./modules/programs/shell.nix ./modules/satoshipay.nix - ./modules/infrastructure.nix - ./modules/accounting.nix - ./modules/passwords.nix - ./modules/network-manager.nix - ./modules/zeroconf.nix - ./modules/nix.nix - ./modules/i3.nix - ./modules/gnome.nix - ./private/default.nix + ./modules/services/syncthing.nix ]; boot.initrd.luks.devices = [ -- cgit 1.4.1 From 6504e7c6f928b75250a9d2202f205cd73f46a299 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 26 Sep 2017 13:22:10 +0200 Subject: T470s: Remove thinkpad_acpi module from blacklist It's required for fan control. --- modules/machines/t470s.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 21614f0e..16ae3bb8 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -5,8 +5,6 @@ firmwareLinuxNonfree ]; - boot.blacklistedKernelModules = [ "thinkpad_acpi" ]; - systemd.services.ModemManager.enable = true; hardware.pulseaudio.extraConfig = '' -- cgit 1.4.1 From 302b7dd0a5b2e3f2a94364d33c532be990622bff Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 26 Sep 2017 13:22:52 +0200 Subject: user-interface: Remove emacs service command override It seemed to be responsible for the systemd/dbus user session failures. --- modules/user-interface.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 67989a97..5e082f62 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -63,7 +63,6 @@ in defaultEditor = true; package = emacsPackage; }; - systemd.user.services.emacs.serviceConfig.ExecStart = lib.mkForce "${pkgs.bash}/bin/bash -c 'source ${config.system.build.setEnvironment}; exec ${emacsPackage}/bin/emacs --daemon --debug-init'"; services.redshift = { enable = true; -- cgit 1.4.1 From 89b17b2c81a63b8ada689053b4ac98ac46548c86 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 28 Sep 2017 17:12:33 +0200 Subject: xserver: Change fonts The "Source" fonts seem to look quite nice at normal DPI and semi-high DPI. --- modules/services/xserver.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 2cef678b..e7b2680c 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -44,9 +44,9 @@ enableDefaultFonts = true; fontconfig = { defaultFonts = { - monospace = [ "Liberation Mono" ]; - sansSerif = [ "Liberation Sans" ]; - serif = [ "Liberation Serif" ]; + monospace = [ "Source Code Pro" ]; + sansSerif = [ "Source Sans Pro" ]; + serif = [ "Source Serif Pro" ]; }; ultimate = { enable = true; -- cgit 1.4.1 From 7eb6b620c517df0923cf0661f4f44dae54a106e6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 30 Sep 2017 11:54:26 +0200 Subject: Satoshipay: Use official Slack instead of ScudCloud --- modules/satoshipay.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 81fe8a7e..a44cbb08 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -18,7 +18,7 @@ in google-chrome docker_compose electrum - pkgsUnstable.scudcloud + pkgsUnstable.slack ]; services.mongodb = { -- cgit 1.4.1 From b41cc81b514f24561720b18e425fd24f9466a1b4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 30 Sep 2017 11:54:48 +0200 Subject: User-interface: Use open-source "firefox" --- modules/user-interface.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 5e082f62..9212a419 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -20,7 +20,7 @@ in programs.info.enable = true; environment.systemPackages = with pkgs; [ - firefox-bin + firefox pcmanfm epdfview -- cgit 1.4.1 From 7af44ef3e3297bcd8784787e281d1cb365da4a59 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 30 Sep 2017 11:55:20 +0200 Subject: shell: Install mtr for diagnosing network issues --- modules/programs/shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/programs/shell.nix b/modules/programs/shell.nix index 3ea43adc..54d54e32 100644 --- a/modules/programs/shell.nix +++ b/modules/programs/shell.nix @@ -20,6 +20,7 @@ nmap netperf moreutils + mtr psmisc tree zip -- cgit 1.4.1 From 2701e96b83ab2b1a1df4edda1f321ea8325aaec4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 30 Sep 2017 19:56:45 +0200 Subject: printing: Use CUPS socket instead of service --- modules/hardware/printing.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hardware/printing.nix b/modules/hardware/printing.nix index beba72ed..32aa4038 100644 --- a/modules/hardware/printing.nix +++ b/modules/hardware/printing.nix @@ -1,6 +1,8 @@ { config, pkgs, lib, ... }: { services.printing.enable = true; + systemd.services.cups.wantedBy = lib.mkForce []; + systemd.sockets.cups.wantedBy = [ "sockets.target" ]; imports = [ ../services/zeroconf.nix -- cgit 1.4.1 From 9caaadc2ca4fcde9778130e45e6ecba075fdba21 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 30 Sep 2017 19:58:22 +0200 Subject: javascript: Install phantomjs2 --- modules/development/javascript.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index cc5b89e8..64807c65 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -6,6 +6,7 @@ let in { environment.systemPackages = with pkgs; [ nodejs-8_x + pkgsUnstable.phantomjs2 pkgsUnstable.flow pkgsUnstable.nodePackages.yarn pkgsUnstable.nodePackages.tern -- cgit 1.4.1 From dffdf0798a50f7377c9901ae01c4ee576b2dfb37 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 30 Sep 2017 19:58:45 +0200 Subject: accounting: Use newer software versions --- modules/programs/accounting.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/programs/accounting.nix b/modules/programs/accounting.nix index 5882436f..bcd33b8f 100644 --- a/modules/programs/accounting.nix +++ b/modules/programs/accounting.nix @@ -1,10 +1,14 @@ { config, pkgs, ... }: +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in { environment.systemPackages = with pkgs; [ aqbanking ledger - bean-add - beancount - fava + pkgsUnstable.bean-add + pkgsUnstable.beancount + pkgsUnstable.fava ]; } -- cgit 1.4.1 From acfa8110cdf4dde9532d33442a4ad18f5a6196c6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 1 Oct 2017 20:43:27 +0200 Subject: Thinkpad: Replace outdated tp_smapi module with acpi_call --- modules/hardware/thinkpad.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/hardware/thinkpad.nix b/modules/hardware/thinkpad.nix index 1e97f06c..755b433e 100644 --- a/modules/hardware/thinkpad.nix +++ b/modules/hardware/thinkpad.nix @@ -1,10 +1,9 @@ { config, pkgs, ... }: -{ boot.kernelModules = [ "tp_smapi" ]; +{ boot.kernelModules = [ ]; boot.blacklistedKernelModules = [ "thinkpad_ec" ]; boot.extraModulePackages = with config.boot.kernelPackages; [ - # acpi_call - tp_smapi + acpi_call ]; hardware.trackpoint = { -- cgit 1.4.1 From 2edba7e1a76d3970bddd9baf6319c0b68b9c9f36 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 2 Oct 2017 19:59:50 +0200 Subject: Laptop: Use remote build server --- modules/hardware/laptop.nix | 1 + modules/remote-build.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 modules/remote-build.nix diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index 55dcbd17..a09b12d7 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -73,5 +73,6 @@ imports = [ ../user-interface.nix + ../remote-build.nix ]; } diff --git a/modules/remote-build.nix b/modules/remote-build.nix new file mode 100644 index 00000000..7c1906f1 --- /dev/null +++ b/modules/remote-build.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ nix.distributedBuilds = true; + nix.buildMachines = [{ + hostName = "oak.alanpearce.eu"; + sshUser = "nix-ssh"; + sshKey = "/root/.ssh/id_ed25519"; + system = "x86_64-linux"; + maxJobs = 2; + supportedFeatures = ["kvm"]; + mandatoryFeatures = []; + }]; +} -- cgit 1.4.1 From c49c165255f5138eacdd30fd3bd737f7bc735458 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Oct 2017 14:36:36 +0200 Subject: Base: Remove mitmproxy I've never actually used it and it's broken on 17.09 anyway --- modules/development/base.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/development/base.nix b/modules/development/base.nix index abe5f969..954bde9e 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -12,7 +12,6 @@ httpie http-prompt - mitmproxy nodePackages.js-yaml ]; -- cgit 1.4.1 From a131b5e7e408f5dbd1a6c6facebba3fbc3ede54a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Oct 2017 16:28:14 +0200 Subject: bare-metal: update kernel version --- modules/hardware/bare-metal.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hardware/bare-metal.nix b/modules/hardware/bare-metal.nix index b5e0fc7b..38e0bc50 100644 --- a/modules/hardware/bare-metal.nix +++ b/modules/hardware/bare-metal.nix @@ -9,7 +9,7 @@ usbutils ]; - boot.kernelPackages = pkgs.linuxPackages_4_12; + boot.kernelPackages = pkgs.linuxPackages_4_13; boot.tmpOnTmpfs = true; -- cgit 1.4.1 From ade92d2d093b5f4f535cefeff11713c82c15dae5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Oct 2017 16:28:49 +0200 Subject: xserver: fix XCURSOR_PATH for NixOS 17.09 I assume it handles it itself. Cursors seem fine. --- modules/services/xserver.nix | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index e7b2680c..7c664343 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -8,14 +8,6 @@ services.dbus.socketActivated = true; - environment.sessionVariables = { - XCURSOR_PATH = [ - "${config.system.path}/share/icons" - "$HOME/.icons" - "$HOME/.nix-profile/share/icons/" - ]; - }; - environment.systemPackages = with pkgs; [ xorg.xmodmap xorg.xinit -- cgit 1.4.1 From 0cdb66dc99af6cfb54a8369d08ac6b288e6afcd2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Oct 2017 16:29:42 +0200 Subject: satoshipad: Update system state version --- satoshipad.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 56ee7b45..1b2ce21a 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -47,5 +47,5 @@ nix.gc.dates = "12:00"; system.autoUpgrade.dates = "12:24"; - system.stateVersion = "17.03"; + system.stateVersion = "17.09"; } -- cgit 1.4.1 From 34a3a77898d747eadf7549be53fe75be0d444a46 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Oct 2017 16:38:25 +0200 Subject: nitrokey: Enable user hardware access --- modules/configuration/user.nix | 2 +- modules/hardware/nitrokey.nix | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/configuration/user.nix b/modules/configuration/user.nix index 1b2b6747..75ba17f2 100644 --- a/modules/configuration/user.nix +++ b/modules/configuration/user.nix @@ -3,7 +3,7 @@ { users.extraUsers.alan = { description = "Alan Pearce"; isNormalUser = true; - extraGroups = [ "audio" "wheel" "adbusers" "docker" ]; + extraGroups = [ "audio" "wheel" "adbusers" "docker" "nitrokey" ]; shell = "/run/current-system/sw/bin/zsh"; home = "/home/alan"; uid = 1000; diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix index ac85e352..7de38578 100644 --- a/modules/hardware/nitrokey.nix +++ b/modules/hardware/nitrokey.nix @@ -6,6 +6,10 @@ let in { programs.ssh.startAgent = false; + hardware.nitrokey = { + enable = true; + }; + services.pcscd.enable = true; services.tor = { -- cgit 1.4.1 From 2b98d3e0025d44acc57bd35a08a9b7e424b39ed3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Oct 2017 16:39:28 +0200 Subject: nitrokey: Enable gnupg user agent services --- modules/hardware/nitrokey.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix index 7de38578..a0a27b0f 100644 --- a/modules/hardware/nitrokey.nix +++ b/modules/hardware/nitrokey.nix @@ -6,6 +6,14 @@ let in { programs.ssh.startAgent = false; + programs.gnupg = { + agent = { + enable = true; + enableSSHSupport = true; + }; + dirmngr.enable = true; + }; + hardware.nitrokey = { enable = true; }; -- cgit 1.4.1 From 80b85b53fa336a659f1706c4ccf7bd17b8d239fb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Oct 2017 16:39:44 +0200 Subject: user-interface: Enable browserpass --- modules/user-interface.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 9212a419..56490cc8 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -16,7 +16,7 @@ let }); }; in -{ # programs.browserpass.enable = true; +{ programs.browserpass.enable = true; programs.info.enable = true; environment.systemPackages = with pkgs; [ -- cgit 1.4.1 From b07d40fbf94b5c6d4590728b06d1f94b75c329cb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Oct 2017 18:12:55 +0200 Subject: bare-metal: Always use latest kernel --- modules/hardware/bare-metal.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hardware/bare-metal.nix b/modules/hardware/bare-metal.nix index 38e0bc50..c816e18e 100644 --- a/modules/hardware/bare-metal.nix +++ b/modules/hardware/bare-metal.nix @@ -9,7 +9,7 @@ usbutils ]; - boot.kernelPackages = pkgs.linuxPackages_4_13; + boot.kernelPackages = pkgs.linuxPackages_latest; boot.tmpOnTmpfs = true; -- cgit 1.4.1 From ff281a8b306013e1de30d21e7ed432d97aeb24f0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Oct 2017 20:16:53 +0200 Subject: Emacs: Install mocha.el --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 30b21c2d..8aa5c63e 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -118,6 +118,7 @@ in lua-mode magit markdown-mode + mocha move-text multiple-cursors nginx-mode -- cgit 1.4.1 From 8b32d975e34295dd91d5e60a5485d6a3d02b1f3f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Oct 2017 14:35:04 +0200 Subject: dev: Install jq Should be useful for httpie and http-prompt --- modules/development/base.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/development/base.nix b/modules/development/base.nix index 954bde9e..370b5d69 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -12,6 +12,7 @@ httpie http-prompt + jq nodePackages.js-yaml ]; -- cgit 1.4.1 From e925b271cc5d44a5c9d69fded9bee3fe52ecf45c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Oct 2017 14:35:37 +0200 Subject: satoshipay: Install robomongo --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index a44cbb08..b43a3807 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -18,6 +18,7 @@ in google-chrome docker_compose electrum + robomongo pkgsUnstable.slack ]; -- cgit 1.4.1 From c6c40059f965f9347577697b10708ef7ba079a35 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 7 Oct 2017 14:51:12 +0200 Subject: Disable gnome on satoshipad --- satoshipad.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 1b2ce21a..0f24e1bb 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -24,7 +24,6 @@ ./modules/machines/t470s.nix ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix - ./modules/programs/gnome.nix ./modules/programs/i3.nix ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix -- cgit 1.4.1 From fcd3f9566389b2258b18b9683f91ffbe4a1f3401 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 11 Oct 2017 21:00:59 +0200 Subject: marvin: Update stateVersion --- marvin.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marvin.nix b/marvin.nix index 55a97fd7..9c7ba8c8 100644 --- a/marvin.nix +++ b/marvin.nix @@ -36,5 +36,5 @@ domain = "alanpearce.eu"; }; - system.stateVersion = "17.03"; + system.stateVersion = "17.09"; } -- cgit 1.4.1 From de5c27c0f6abe32f1b8c397b4af2131fe4940e03 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 13 Oct 2017 12:47:27 +0200 Subject: Emacs: install org-plus-contrib --- packages/emacs.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 8aa5c63e..fd557860 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -160,6 +160,8 @@ in ]) ++ (with epkgs.elpaPackages; [ rainbow-mode ]) ++ [ + # I just need the one org-package + epkgs.orgPackages.org-plus-contrib # defined above hook-helpers dired-du -- cgit 1.4.1 From 68694b3e3f61d04ca61c71c6d70e4a965219683b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 18 Oct 2017 09:55:46 +0200 Subject: Add hosts for work --- modules/satoshipay.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index b43a3807..12633969 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -36,4 +36,8 @@ in ]; networking.domain = "satoshipay.io"; + + networking.extraHosts = '' + 127.0.0.1 blogger.local wallet.satoshipay.local api.satoshipay.local ws.satoshipay.local + ''; } -- cgit 1.4.1 From 90ee1170898bcef3975e9f6adff5a86530ec2506 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 18 Oct 2017 12:34:00 +0200 Subject: xserver: Use a different fontconfig preset --- modules/services/xserver.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 7c664343..2432715a 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -44,7 +44,7 @@ enable = true; # presets: # ultimate1 ultimate2 ultimate3 ultimate4 ultimate5 osx windowsxp - preset = "ultimate3"; + preset = "windowsxp"; }; }; fonts = with pkgs; [ -- cgit 1.4.1 From 140c75b83a3074c69c562fd0d788a00cad25b8e3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 18 Oct 2017 12:41:14 +0200 Subject: Reduce number of unstable packages installed --- modules/hardware/nitrokey.nix | 12 ++++-------- modules/programs/accounting.nix | 10 +++------- modules/programs/dotfiles.nix | 6 +----- modules/satoshipay.nix | 2 +- modules/user-interface.nix | 2 +- 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix index a0a27b0f..ec25d8e0 100644 --- a/modules/hardware/nitrokey.nix +++ b/modules/hardware/nitrokey.nix @@ -1,9 +1,5 @@ -{ config, nixpkgs, ... }: +{ config, pkgs, ... }: -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in { programs.ssh.startAgent = false; programs.gnupg = { @@ -31,8 +27,8 @@ in }; }; - environment.systemPackages = [ - pkgsUnstable.gnupg - pkgsUnstable.nitrokey-app + environment.systemPackages = with pkgs; [ + gnupg + nitrokey-app ]; } diff --git a/modules/programs/accounting.nix b/modules/programs/accounting.nix index bcd33b8f..5882436f 100644 --- a/modules/programs/accounting.nix +++ b/modules/programs/accounting.nix @@ -1,14 +1,10 @@ { config, pkgs, ... }: -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in { environment.systemPackages = with pkgs; [ aqbanking ledger - pkgsUnstable.bean-add - pkgsUnstable.beancount - pkgsUnstable.fava + bean-add + beancount + fava ]; } diff --git a/modules/programs/dotfiles.nix b/modules/programs/dotfiles.nix index eed22233..467665ff 100644 --- a/modules/programs/dotfiles.nix +++ b/modules/programs/dotfiles.nix @@ -1,13 +1,9 @@ { config, pkgs, ... }: -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in { environment.systemPackages = with pkgs; [ git stow fzf - pkgsUnstable.ghq + ghq ]; } diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 12633969..ac9d5f21 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -32,7 +32,7 @@ in systemd.services.redis.wantedBy = lib.mkForce []; services.printing.drivers = with pkgs; [ - pkgsUnstable.cups-toshiba-estudio + cups-toshiba-estudio ]; networking.domain = "satoshipay.io"; diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 56490cc8..b3c175fa 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -43,7 +43,7 @@ in aspell aspellDicts.en - pkgsUnstable.alacritty + alacritty st trash-cli -- cgit 1.4.1 From 13457b85ec45c7d8d7b4648e4352d9ef2451d5e7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 18 Oct 2017 12:41:31 +0200 Subject: javascript: Use only unstable packages --- modules/development/javascript.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 64807c65..dae4d843 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -4,13 +4,13 @@ let pkgsUnstable = import {}; # pkgsUnstable = pkgs; in -{ environment.systemPackages = with pkgs; [ +{ environment.systemPackages = with pkgsUnstable; [ nodejs-8_x - pkgsUnstable.phantomjs2 - pkgsUnstable.flow - pkgsUnstable.nodePackages.yarn - pkgsUnstable.nodePackages.tern - pkgsUnstable.nodePackages.node2nix - pkgsUnstable.nodePackages.nodemon + phantomjs2 + flow + nodePackages.yarn + nodePackages.tern + nodePackages.node2nix + nodePackages.nodemon ]; } -- cgit 1.4.1 From 90267cf07027564be14043edf72bbe622efc76d8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 18 Oct 2017 12:42:14 +0200 Subject: javascript: Remove flow --- modules/development/javascript.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index dae4d843..8e494c68 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -7,7 +7,6 @@ in { environment.systemPackages = with pkgsUnstable; [ nodejs-8_x phantomjs2 - flow nodePackages.yarn nodePackages.tern nodePackages.node2nix -- cgit 1.4.1 From ee10aadfcfaf1aaf4e0394210ba0629920881406 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 22 Oct 2017 19:38:21 +0200 Subject: Add base configuration for prefect --- modules/hardware/mouse.nix | 12 ++++++++++++ modules/hardware/nvidia-gpu.nix | 6 ++++++ prefect.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 modules/hardware/mouse.nix create mode 100644 modules/hardware/nvidia-gpu.nix create mode 100644 prefect.nix diff --git a/modules/hardware/mouse.nix b/modules/hardware/mouse.nix new file mode 100644 index 00000000..b30d4124 --- /dev/null +++ b/modules/hardware/mouse.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ services.xserver.config = '' + Section "InputClass" + Identifier "Mouse (No Acceleration)" + MatchIsPointer "yes" + MatchIsTouchpad "no" + Option "AccelerationProfile" "-1" + Option "AccelerationScheme" "none" + EndSection + ''; +} diff --git a/modules/hardware/nvidia-gpu.nix b/modules/hardware/nvidia-gpu.nix new file mode 100644 index 00000000..2c49e964 --- /dev/null +++ b/modules/hardware/nvidia-gpu.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ services.xserver.videoDrivers = [ "nvidia" ]; + hardware.opengl.driSupport32Bit = true; + nixpkgs.config.allowUnfree = true; +} diff --git a/prefect.nix b/prefect.nix new file mode 100644 index 00000000..1c786a7d --- /dev/null +++ b/prefect.nix @@ -0,0 +1,41 @@ +{ config, pkgs, ... }: + +{ imports = [ + ./hardware-configuration.nix + + ./modules/configuration/berlin.nix + ./modules/configuration/british-english.nix + ./modules/configuration/nix.nix + ./modules/configuration/user.nix + ./modules/development/base.nix + ./modules/development/javascript.nix + ./modules/development/lisp.nix + ./modules/hardware/adb.nix + ./modules/hardware/audio.nix + ./modules/hardware/bare-metal.nix + ./modules/user-interface.nix + ./modules/hardware/colemak.nix + ./modules/hardware/nitrokey.nix + ./modules/hardware/mouse.nix + ./modules/hardware/systemd-boot.nix + ./modules/hardware/nvidia-gpu.nix + ./modules/programs/accounting.nix + ./modules/programs/dotfiles.nix + ./modules/programs/i3.nix + ./modules/programs/infrastructure.nix + ./modules/programs/passwords.nix + ./modules/programs/shell.nix + ./modules/services/syncthing.nix + ]; + + environment.systemPackages = with pkgs; [ + chromium + ]; + + networking = { + hostName = "prefect"; + domain = "alanpearce.eu"; + }; + + system.stateVersion = "17.09"; +} -- cgit 1.4.1 From 9dc583391639a6ac5be09bc70068aebafde2cf7e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 23 Oct 2017 14:26:59 +0200 Subject: Emacs: Install define-word package --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index fd557860..95adfd13 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -75,6 +75,7 @@ in counsel-projectile crux cyphejor + define-word dired-narrow dired-subtree discover-my-major -- cgit 1.4.1 From 8d54fb14b26f971cda287a70980c766c506035f3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 23 Oct 2017 14:27:35 +0200 Subject: satoshipad: switch to systemd-boot --- satoshipad.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 0f24e1bb..c2a981a1 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -16,7 +16,7 @@ ./modules/hardware/adb.nix ./modules/hardware/audio.nix ./modules/hardware/colemak.nix - ./modules/hardware/grub2.nix + ./modules/hardware/systemd-boot.nix ./modules/hardware/network-manager.nix ./modules/hardware/nitrokey.nix ./modules/hardware/printing.nix -- cgit 1.4.1 From 405a26ad786e511ec16fe892b6f43ac64aebf449 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 25 Oct 2017 12:41:21 +0200 Subject: Emacs: Add docker-compose mode --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 95adfd13..39cb4a6a 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -80,6 +80,7 @@ in dired-subtree discover-my-major dockerfile-mode + docker-compose-mode dtrt-indent dumb-jump easy-hugo -- cgit 1.4.1 From 43f89c30d09beac4b7dee577dd6bb55f6986eb19 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 25 Oct 2017 12:42:10 +0200 Subject: Laptop: Enable autorandr via module --- modules/hardware/laptop.nix | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index a09b12d7..3024daee 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -18,30 +18,10 @@ disper ]; - # powerManagement.resumeCommands = '' - # AUTORANDR="autorandr -c" - - # detect_display() - # { - # for X in /tmp/.X11-unix/X*; do - # D="''${X##/tmp/.X11-unix/X}" - # user=$(who | awk -vD="$D" '$5 ~ "\\(:"D"\\)$" {print $1}') - # if [ x"$user" != x"" ]; then - # export DISPLAY=":$D" - # /bin/su -c "''${AUTORANDR}" "$user" - # fi - # done - # } - - # case "$1" in - # thaw|resume) - # detect_display - # ;; - # esac - # ''; - programs.light.enable = true; + services.autorandr.enable = true; + services.logind.extraConfig = '' IdleAction=suspend IdleActionSec=600 @@ -56,10 +36,6 @@ ''; }; - services.udev.extraRules = '' - # ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/alan/.Xauthority", RUN+="${pkgs.autorandr}/bin/autorandr -c" - ''; - services.xserver = { libinput = { enable = lib.mkDefault true; -- cgit 1.4.1 From 6b27e743d57c3305a84267e654220f65eab724a3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 26 Oct 2017 14:55:24 +0200 Subject: Auto-prune docker images --- modules/satoshipay.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index ac9d5f21..a56deab4 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -9,6 +9,10 @@ in enable = true; enableOnBoot = false; liveRestore = false; + + autoPrune = { + enable = true; + }; }; }; -- cgit 1.4.1 From 496cfc51e4c157481d9911bf6993a930579c78b9 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 28 Oct 2017 11:58:46 +0200 Subject: Enable Trezor on marvin --- marvin.nix | 1 + modules/hardware/trezor.nix | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 modules/hardware/trezor.nix diff --git a/marvin.nix b/marvin.nix index 9c7ba8c8..df798d49 100644 --- a/marvin.nix +++ b/marvin.nix @@ -17,6 +17,7 @@ ./modules/hardware/nitrokey.nix ./modules/hardware/systemd-boot.nix ./modules/hardware/trackball.nix + ./modules/hardware/trezor.nix ./modules/machines/x250.nix ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix diff --git a/modules/hardware/trezor.nix b/modules/hardware/trezor.nix new file mode 100644 index 00000000..ad938e9a --- /dev/null +++ b/modules/hardware/trezor.nix @@ -0,0 +1,4 @@ +{ config, pkgs, ... }: + +{ services.trezord.enable = true; +} -- cgit 1.4.1 From 8d9e0b7f223662ca77e4eae65380ac6eb9d9e86b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 4 Nov 2017 18:04:53 +0100 Subject: Emacs: Install spaceline --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 39cb4a6a..fe49e458 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -147,6 +147,7 @@ in slime smart-tabs-mode smex + spaceline suggest swiper tern -- cgit 1.4.1 From 334a760e340ac9e57f15afe5c61f21509e7c0fa4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 4 Nov 2017 18:51:13 +0100 Subject: Remove st It doesn't work well with changing DPI --- config/st-config.h | 461 ------------------------------------------ config/st-scrollback-0.7.diff | 387 ----------------------------------- modules/user-interface.nix | 5 - 3 files changed, 853 deletions(-) delete mode 100644 config/st-config.h delete mode 100644 config/st-scrollback-0.7.diff diff --git a/config/st-config.h b/config/st-config.h deleted file mode 100644 index 11e17954..00000000 --- a/config/st-config.h +++ /dev/null @@ -1,461 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* - * appearance - * - * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html - */ -static char font[] = "Liberation Mono:pixelsize=16:antialias=true:autohint=false"; -static int borderpx = 2; -#define histsize 2000 - -/* - * What program is execed by st depends of these precedence rules: - * 1: program passed with -e - * 2: utmp option - * 3: SHELL environment variable - * 4: value of shell in /etc/passwd - * 5: value of shell in config.h - */ -static char shell[] = "/bin/sh"; -static char *utmp = NULL; -static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400"; - -/* identification sequence returned in DA and DECID */ -static char vtiden[] = "\033[?6c"; - -/* Kerning / character bounding-box multipliers */ -static float cwscale = 1.0; -static float chscale = 1.0; - -/* - * word delimiter string - * - * More advanced example: " `'\"()[]{}" - */ -static char worddelimiters[] = " "; - -/* selection timeouts (in milliseconds) */ -static unsigned int doubleclicktimeout = 300; -static unsigned int tripleclicktimeout = 600; - -/* alt screens */ -static int allowaltscreen = 1; - -/* frames per second st should at maximum draw to the screen */ -static unsigned int xfps = 120; -static unsigned int actionfps = 30; - -/* - * blinking timeout (set to 0 to disable blinking) for the terminal blinking - * attribute. - */ -static unsigned int blinktimeout = 800; - -/* - * thickness of underline and bar cursors - */ -static unsigned int cursorthickness = 2; - -/* - * bell volume. It must be a value between -100 and 100. Use 0 for disabling - * it - */ -static int bellvolume = 0; - -/* default TERM value */ -static char termname[] = "st-meta-256color"; - -/* - * spaces per tab - * - * When you are changing this value, don't forget to adapt the »it« value in - * the st.info and appropriately install the st.info in the environment where - * you use this st version. - * - * it#$tabspaces, - * - * Secondly make sure your kernel is not expanding tabs. When running `stty - * -a` »tab0« should appear. You can tell the terminal to not expand tabs by - * running following command: - * - * stty tabs - */ -static unsigned int tabspaces = 8; - -/* Terminal colors (16 first used in escape sequence) */ -static const char *colorname[] = { - /* solarized light */ - /* "#eee8d5", /\* 0: black *\/ */ - /* "#dc322f", /\* 1: red *\/ */ - /* "#859900", /\* 2: green *\/ */ - /* "#b58900", /\* 3: yellow *\/ */ - /* "#268bd2", /\* 4: blue *\/ */ - /* "#d33682", /\* 5: magenta *\/ */ - /* "#2aa198", /\* 6: cyan *\/ */ - /* "#073642", /\* 7: white *\/ */ - /* "#fdf6e3", /\* 8: brblack *\/ */ - /* "#cb4b16", /\* 9: brred *\/ */ - /* "#93a1a1", /\* 10: brgreen *\/ */ - /* "#839496", /\* 11: bryellow *\/ */ - /* "#657b83", /\* 12: brblue *\/ */ - /* "#6c71c4", /\* 13: brmagenta*\/ */ - /* "#586e75", /\* 14: brcyan *\/ */ - /* "#002b36", /\* 15: brwhite *\/ */ - - "#000000", /* 0: black */ - "#9e1828", /* 1: red */ - "#5cb247", /* 2: green */ - "#968a38", /* 3: yellow */ - "#4161a0", /* 4: blue */ - "#9b768e", /* 5: magenta */ - "#419189", /* 6: cyan */ - "#bebebe", /* 7: white */ - "#666666", /* 8: brblack */ - "#cf6171", /* 9: brred */ - "#c5f779", /* 10: brgreen */ - "#fff796", /* 11: bryellow */ - "#4186be", /* 12: brblue */ - "#cf9ebe", /* 13: brmagenta*/ - "#71bebe", /* 14: brcyan */ - "#ffffff", /* 15: brwhite */ -}; - - -/* - * Default colors (colorname index) - * foreground, background, cursor - */ -static unsigned int defaultfg = 0; -static unsigned int defaultbg = 15; -static unsigned int defaultcs = 8; - -/* - * Default colors (colorname index) - * foreground, background, cursor, reverse cursor - */ -static unsigned int defaultrcs = 257; - -/* - * Default shape of cursor - * 2: Block ("█") - * 4: Underline ("_") - * 6: Bar ("|") - * 7: Snowman ("☃") - */ -static unsigned int cursorshape = 2; - -/* - * Default colour and shape of the mouse cursor - */ -static unsigned int mouseshape = XC_xterm; -static unsigned int mousefg = 7; -static unsigned int mousebg = 0; - -/* - * Colors used, when the specific fg == defaultfg. So in reverse mode this - * will reverse too. Another logic would only make the simple feature too - * complex. - */ -static unsigned int defaultitalic = 11; -static unsigned int defaultunderline = 7; - -/* - * Internal mouse shortcuts. - * Beware that overloading Button1 will disable the selection. - */ -static MouseShortcut mshortcuts[] = { - /* button mask string */ - { Button4, XK_ANY_MOD, "\031" }, - { Button5, XK_ANY_MOD, "\005" }, -}; - -/* Internal keyboard shortcuts. */ -#define MODKEY Mod1Mask - -static Shortcut shortcuts[] = { - /* mask keysym function argument */ - { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, - { ControlMask, XK_Print, toggleprinter, {.i = 0} }, - { ShiftMask, XK_Print, printscreen, {.i = 0} }, - { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, - { MODKEY|ShiftMask, XK_Prior, xzoom, {.f = +1} }, - { MODKEY|ShiftMask, XK_Next, xzoom, {.f = -1} }, - { MODKEY|ShiftMask, XK_Home, xzoomreset, {.f = 0} }, - { ShiftMask, XK_Insert, selpaste, {.i = 0} }, - { MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} }, - { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, - { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, - { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, - { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, - { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, - -}; - -/* - * Special keys (change & recompile st.info accordingly) - * - * Mask value: - * * Use XK_ANY_MOD to match the key no matter modifiers state - * * Use XK_NO_MOD to match the key alone (no modifiers) - * appkey value: - * * 0: no value - * * > 0: keypad application mode enabled - * * = 2: term.numlock = 1 - * * < 0: keypad application mode disabled - * appcursor value: - * * 0: no value - * * > 0: cursor application mode enabled - * * < 0: cursor application mode disabled - * crlf value - * * 0: no value - * * > 0: crlf mode is enabled - * * < 0: crlf mode is disabled - * - * Be careful with the order of the definitions because st searches in - * this table sequentially, so any XK_ANY_MOD must be in the last - * position for a key. - */ - -/* - * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) - * to be mapped below, add them to this array. - */ -static KeySym mappedkeys[] = { -1 }; - -/* - * State bits to ignore when matching key or button events. By default, - * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. - */ -static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; - -/* - * Override mouse-select while mask is active (when MODE_MOUSE is set). - * Note that if you want to use ShiftMask with selmasks, set this to an other - * modifier, set to 0 to not use it. - */ -static uint forceselmod = ShiftMask; - -/* - * This is the huge key array which defines all compatibility to the Linux - * world. Please decide about changes wisely. - */ -static Key key[] = { - /* keysym mask string appkey appcursor crlf */ - { XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0}, - { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, - { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, - { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, - { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0}, - { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, - { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, - { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0, 0}, - { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, - { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, - { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0, 0}, - { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, - { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, - { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0, 0}, - { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, - { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, - { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, - { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, - { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0}, - { XK_KP_End, ControlMask, "\033[J", -1, 0, 0}, - { XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0}, - { XK_KP_End, ShiftMask, "\033[K", -1, 0, 0}, - { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0, 0}, - { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, - { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, - { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, - { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, - { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0, 0}, - { XK_KP_Insert, ControlMask, "\033[L", -1, 0, 0}, - { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, - { XK_KP_Delete, ControlMask, "\033[M", -1, 0, 0}, - { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, - { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0, 0}, - { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, - { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0}, - { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0, -1}, - { XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1}, - { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0, 0}, - { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0, 0}, - { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0, 0}, - { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0, 0}, - { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0, 0}, - { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0, 0}, - { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0, 0}, - { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0, 0}, - { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0, 0}, - { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0, 0}, - { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0}, - { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0}, - { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0}, - { XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0}, - { XK_Up, ControlMask, "\033[1;5A", 0, 0, 0}, - { XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0}, - { XK_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, - { XK_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, - { XK_Down, ShiftMask, "\033[1;2B", 0, 0, 0}, - { XK_Down, ControlMask, "\033[1;5B", 0, 0, 0}, - { XK_Down, Mod1Mask, "\033[1;3B", 0, 0, 0}, - { XK_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, - { XK_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, - { XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0}, - { XK_Left, ControlMask, "\033[1;5D", 0, 0, 0}, - { XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0}, - { XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, - { XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, - { XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0}, - { XK_Right, ControlMask, "\033[1;5C", 0, 0, 0}, - { XK_Right, Mod1Mask, "\033[1;3C", 0, 0, 0}, - { XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, - { XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, - { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0}, - { XK_Return, Mod1Mask, "\033\r", 0, 0, -1}, - { XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1}, - { XK_Return, XK_ANY_MOD, "\r", 0, 0, -1}, - { XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1}, - { XK_Insert, ShiftMask, "\033[4l", -1, 0, 0}, - { XK_Insert, ShiftMask, "\033[2;2~", +1, 0, 0}, - { XK_Insert, ControlMask, "\033[L", -1, 0, 0}, - { XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0}, - { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0}, - { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0}, - { XK_Delete, ControlMask, "\033[M", -1, 0, 0}, - { XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0}, - { XK_Delete, ShiftMask, "\033[2K", -1, 0, 0}, - { XK_Delete, ShiftMask, "\033[3;2~", +1, 0, 0}, - { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0}, - { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0}, - { XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0}, - { XK_BackSpace, Mod1Mask, "\033\177", 0, 0, 0}, - { XK_Home, ShiftMask, "\033[2J", 0, -1, 0}, - { XK_Home, ShiftMask, "\033[1;2H", 0, +1, 0}, - { XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0}, - { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0}, - { XK_End, ControlMask, "\033[J", -1, 0, 0}, - { XK_End, ControlMask, "\033[1;5F", +1, 0, 0}, - { XK_End, ShiftMask, "\033[K", -1, 0, 0}, - { XK_End, ShiftMask, "\033[1;2F", +1, 0, 0}, - { XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, - { XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0}, - { XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, - { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, - { XK_Next, ControlMask, "\033[6;5~", 0, 0, 0}, - { XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, - { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, - { XK_F1, XK_NO_MOD, "\033OP" , 0, 0, 0}, - { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0, 0}, - { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0, 0}, - { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0, 0}, - { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0, 0}, - { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0, 0}, - { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0, 0}, - { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0, 0}, - { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0, 0}, - { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0, 0}, - { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0, 0}, - { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0, 0}, - { XK_F3, XK_NO_MOD, "\033OR" , 0, 0, 0}, - { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0, 0}, - { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0, 0}, - { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0, 0}, - { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0, 0}, - { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0}, - { XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0}, - { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0}, - { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0, 0}, - { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0}, - { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0}, - { XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0}, - { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0, 0}, - { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0, 0}, - { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0, 0}, - { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0, 0}, - { XK_F6, XK_NO_MOD, "\033[17~", 0, 0, 0}, - { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0, 0}, - { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0, 0}, - { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0, 0}, - { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0, 0}, - { XK_F7, XK_NO_MOD, "\033[18~", 0, 0, 0}, - { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0, 0}, - { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0, 0}, - { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0, 0}, - { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0, 0}, - { XK_F8, XK_NO_MOD, "\033[19~", 0, 0, 0}, - { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0, 0}, - { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0, 0}, - { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0, 0}, - { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0, 0}, - { XK_F9, XK_NO_MOD, "\033[20~", 0, 0, 0}, - { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0, 0}, - { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0, 0}, - { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0, 0}, - { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0, 0}, - { XK_F10, XK_NO_MOD, "\033[21~", 0, 0, 0}, - { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0, 0}, - { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0, 0}, - { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0, 0}, - { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0, 0}, - { XK_F11, XK_NO_MOD, "\033[23~", 0, 0, 0}, - { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0, 0}, - { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0, 0}, - { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0, 0}, - { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0, 0}, - { XK_F12, XK_NO_MOD, "\033[24~", 0, 0, 0}, - { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0, 0}, - { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0, 0}, - { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0, 0}, - { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0, 0}, - { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0, 0}, - { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0, 0}, - { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0, 0}, - { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0, 0}, - { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0, 0}, - { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0, 0}, - { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0, 0}, - { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0, 0}, - { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0, 0}, - { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0, 0}, - { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0, 0}, - { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0, 0}, - { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0, 0}, - { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0, 0}, - { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0, 0}, - { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0, 0}, - { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0, 0}, - { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0, 0}, - { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0, 0}, - { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0, 0}, - { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0, 0}, - { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0, 0}, - { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0, 0}, -}; - -/* - * Selection types' masks. - * Use the same masks as usual. - * Button1Mask is always unset, to make masks match between ButtonPress. - * ButtonRelease and MotionNotify. - * If no match is found, regular selection is used. - */ -static uint selmasks[] = { - [SEL_RECTANGULAR] = Mod1Mask, -}; - -/* - * Printable characters in ASCII, used to estimate the advance width - * of single wide characters. - */ -static char ascii_printable[] = - " !\"#$%&'()*+,-./0123456789:;<=>?" - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" - "`abcdefghijklmnopqrstuvwxyz{|}~"; diff --git a/config/st-scrollback-0.7.diff b/config/st-scrollback-0.7.diff deleted file mode 100644 index 3f23f872..00000000 --- a/config/st-scrollback-0.7.diff +++ /dev/null @@ -1,387 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index b41747f..eae969e 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -7,6 +7,7 @@ - */ - static char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; - static int borderpx = 2; -+#define histsize 2000 - - /* - * What program is execed by st depends of these precedence rules: -@@ -172,6 +173,8 @@ static Shortcut shortcuts[] = { - { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, - { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, - { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, -+ { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, -+ { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, - }; - - /* -diff --git a/st.c b/st.c -index 2594c65..233d301 100644 ---- a/st.c -+++ b/st.c -@@ -86,6 +86,8 @@ char *argv0; - #define TRUERED(x) (((x) & 0xff0000) >> 8) - #define TRUEGREEN(x) (((x) & 0xff00)) - #define TRUEBLUE(x) (((x) & 0xff) << 8) -+#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - term.scr \ -+ + histsize + 1) % histsize] : term.line[(y) - term.scr]) - - - enum glyph_attribute { -@@ -228,26 +230,6 @@ typedef struct { - int narg; /* nb of args */ - } STREscape; - --/* Internal representation of the screen */ --typedef struct { -- int row; /* nb row */ -- int col; /* nb col */ -- Line *line; /* screen */ -- Line *alt; /* alternate screen */ -- int *dirty; /* dirtyness of lines */ -- XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ -- TCursor c; /* cursor */ -- int top; /* top scroll limit */ -- int bot; /* bottom scroll limit */ -- int mode; /* terminal mode flags */ -- int esc; /* escape state flags */ -- char trantbl[4]; /* charset table translation */ -- int charset; /* current charset */ -- int icharset; /* selected charset for sequence */ -- int numlock; /* lock numbers in keyboard */ -- int *tabs; --} Term; -- - /* Purely graphic info */ - typedef struct { - Display *dpy; -@@ -327,6 +309,8 @@ typedef struct { - /* function definitions used in config.h */ - static void clipcopy(const Arg *); - static void clippaste(const Arg *); -+static void kscrolldown(const Arg *); -+static void kscrollup(const Arg *); - static void numlock(const Arg *); - static void selpaste(const Arg *); - static void xzoom(const Arg *); -@@ -340,6 +324,29 @@ static void sendbreak(const Arg *); - /* Config.h for applying patches and the configuration. */ - #include "config.h" - -+/* Internal representation of the screen */ -+typedef struct { -+ int row; /* nb row */ -+ int col; /* nb col */ -+ Line *line; /* screen */ -+ Line *alt; /* alternate screen */ -+ Line hist[histsize]; /* history buffer */ -+ int histi; /* history index */ -+ int scr; /* scroll back */ -+ int *dirty; /* dirtyness of lines */ -+ XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ -+ TCursor c; /* cursor */ -+ int top; /* top scroll limit */ -+ int bot; /* bottom scroll limit */ -+ int mode; /* terminal mode flags */ -+ int esc; /* escape state flags */ -+ char trantbl[4]; /* charset table translation */ -+ int charset; /* current charset */ -+ int icharset; /* selected charset for sequence */ -+ int numlock; /* lock numbers in keyboard */ -+ int *tabs; -+} Term; -+ - /* Font structure */ - typedef struct { - int height; -@@ -399,8 +406,8 @@ static void tputtab(int); - static void tputc(Rune); - static void treset(void); - static void tresize(int, int); --static void tscrollup(int, int); --static void tscrolldown(int, int); -+static void tscrollup(int, int, int); -+static void tscrolldown(int, int, int); - static void tsetattr(int *, int); - static void tsetchar(Rune, Glyph *, int, int); - static void tsetscroll(int, int); -@@ -731,10 +738,10 @@ tlinelen(int y) - { - int i = term.col; - -- if (term.line[y][i - 1].mode & ATTR_WRAP) -+ if (TLINE(y)[i - 1].mode & ATTR_WRAP) - return i; - -- while (i > 0 && term.line[y][i - 1].u == ' ') -+ while (i > 0 && TLINE(y)[i - 1].u == ' ') - --i; - - return i; -@@ -796,7 +803,7 @@ selsnap(int *x, int *y, int direction) - * Snap around if the word wraps around at the end or - * beginning of a line. - */ -- prevgp = &term.line[*y][*x]; -+ prevgp = &TLINE(*y)[*x]; - prevdelim = ISDELIM(prevgp->u); - for (;;) { - newx = *x + direction; -@@ -811,14 +818,14 @@ selsnap(int *x, int *y, int direction) - yt = *y, xt = *x; - else - yt = newy, xt = newx; -- if (!(term.line[yt][xt].mode & ATTR_WRAP)) -+ if (!(TLINE(yt)[xt].mode & ATTR_WRAP)) - break; - } - - if (newx >= tlinelen(newy)) - break; - -- gp = &term.line[newy][newx]; -+ gp = &TLINE(newy)[newx]; - delim = ISDELIM(gp->u); - if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim - || (delim && gp->u != prevgp->u))) -@@ -839,14 +846,14 @@ selsnap(int *x, int *y, int direction) - *x = (direction < 0) ? 0 : term.col - 1; - if (direction < 0) { - for (; *y > 0; *y += direction) { -- if (!(term.line[*y-1][term.col-1].mode -+ if (!(TLINE(*y-1)[term.col-1].mode - & ATTR_WRAP)) { - break; - } - } - } else if (direction > 0) { - for (; *y < term.row-1; *y += direction) { -- if (!(term.line[*y][term.col-1].mode -+ if (!(TLINE(*y)[term.col-1].mode - & ATTR_WRAP)) { - break; - } -@@ -1012,13 +1019,13 @@ getsel(void) - } - - if (sel.type == SEL_RECTANGULAR) { -- gp = &term.line[y][sel.nb.x]; -+ gp = &TLINE(y)[sel.nb.x]; - lastx = sel.ne.x; - } else { -- gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; -+ gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0]; - lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; - } -- last = &term.line[y][MIN(lastx, linelen-1)]; -+ last = &TLINE(y)[MIN(lastx, linelen-1)]; - while (last >= gp && last->u == ' ') - --last; - -@@ -1490,6 +1497,9 @@ ttyread(void) - /* keep any uncomplete utf8 char for the next call */ - memmove(buf, ptr, buflen); - -+ if (term.scr > 0 && term.scr < histsize-1) -+ term.scr++; -+ - return ret; - } - -@@ -1499,6 +1509,9 @@ ttywrite(const char *s, size_t n) - fd_set wfd, rfd; - ssize_t r; - size_t lim = 256; -+ Arg arg = (Arg){ .i = term.scr }; -+ -+ kscrolldown(&arg); - - /* - * Remember that we are using a pty, which might be a modem line. -@@ -1690,13 +1703,53 @@ tswapscreen(void) - } - - void --tscrolldown(int orig, int n) -+kscrolldown(const Arg* a) -+{ -+ int n = a->i; -+ -+ if (n < 0) -+ n = term.row + n; -+ -+ if (n > term.scr) -+ n = term.scr; -+ -+ if (term.scr > 0) { -+ term.scr -= n; -+ selscroll(0, -n); -+ tfulldirt(); -+ } -+} -+ -+void -+kscrollup(const Arg* a) -+{ -+ int n = a->i; -+ -+ if (n < 0) -+ n = term.row + n; -+ -+ if (term.scr <= histsize - n) { -+ term.scr += n; -+ selscroll(0, n); -+ tfulldirt(); -+ } -+} -+ -+void -+tscrolldown(int orig, int n, int copyhist) - { - int i; - Line temp; - - LIMIT(n, 0, term.bot-orig+1); - -+ if (copyhist) { -+ term.histi = (term.histi - 1 + histsize) % histsize; -+ temp = term.hist[term.histi]; -+ term.hist[term.histi] = term.line[term.bot]; -+ term.line[term.bot] = temp; -+ } -+ - tsetdirt(orig, term.bot-n); - tclearregion(0, term.bot-n+1, term.col-1, term.bot); - -@@ -1710,13 +1763,20 @@ tscrolldown(int orig, int n) - } - - void --tscrollup(int orig, int n) -+tscrollup(int orig, int n, int copyhist) - { - int i; - Line temp; - - LIMIT(n, 0, term.bot-orig+1); - -+ if (copyhist) { -+ term.histi = (term.histi + 1) % histsize; -+ temp = term.hist[term.histi]; -+ term.hist[term.histi] = term.line[orig]; -+ term.line[orig] = temp; -+ } -+ - tclearregion(0, orig, term.col-1, orig+n-1); - tsetdirt(orig+n, term.bot); - -@@ -1765,7 +1825,7 @@ tnewline(int first_col) - int y = term.c.y; - - if (y == term.bot) { -- tscrollup(term.top, 1); -+ tscrollup(term.top, 1, 1); - } else { - y++; - } -@@ -1930,14 +1990,14 @@ void - tinsertblankline(int n) - { - if (BETWEEN(term.c.y, term.top, term.bot)) -- tscrolldown(term.c.y, n); -+ tscrolldown(term.c.y, n, 0); - } - - void - tdeleteline(int n) - { - if (BETWEEN(term.c.y, term.top, term.bot)) -- tscrollup(term.c.y, n); -+ tscrollup(term.c.y, n, 0); - } - - int32_t -@@ -2371,11 +2431,11 @@ csihandle(void) - break; - case 'S': /* SU -- Scroll line up */ - DEFAULT(csiescseq.arg[0], 1); -- tscrollup(term.top, csiescseq.arg[0]); -+ tscrollup(term.top, csiescseq.arg[0], 0); - break; - case 'T': /* SD -- Scroll line down */ - DEFAULT(csiescseq.arg[0], 1); -- tscrolldown(term.top, csiescseq.arg[0]); -+ tscrolldown(term.top, csiescseq.arg[0], 0); - break; - case 'L': /* IL -- Insert blank lines */ - DEFAULT(csiescseq.arg[0], 1); -@@ -2871,7 +2931,7 @@ eschandle(uchar ascii) - return 0; - case 'D': /* IND -- Linefeed */ - if (term.c.y == term.bot) { -- tscrollup(term.top, 1); -+ tscrollup(term.top, 1, 1); - } else { - tmoveto(term.c.x, term.c.y+1); - } -@@ -2884,7 +2944,7 @@ eschandle(uchar ascii) - break; - case 'M': /* RI -- Reverse index */ - if (term.c.y == term.top) { -- tscrolldown(term.top, 1); -+ tscrolldown(term.top, 1, 1); - } else { - tmoveto(term.c.x, term.c.y-1); - } -@@ -3047,7 +3107,7 @@ tputc(Rune u) - void - tresize(int col, int row) - { -- int i; -+ int i, j; - int minrow = MIN(row, term.row); - int mincol = MIN(col, term.col); - int *bp; -@@ -3087,6 +3147,14 @@ tresize(int col, int row) - term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); - term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); - -+ for (i = 0; i < histsize; i++) { -+ term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph)); -+ for (j = mincol; j < col; j++) { -+ term.hist[i][j] = term.c.attr; -+ term.hist[i][j].u = ' '; -+ } -+ } -+ - /* resize each row to new width, zero-pad if needed */ - for (i = 0; i < minrow; i++) { - term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); -@@ -3976,11 +4044,11 @@ drawregion(int x1, int y1, int x2, int y2) - term.dirty[y] = 0; - - specs = term.specbuf; -- numspecs = xmakeglyphfontspecs(specs, &term.line[y][x1], x2 - x1, x1, y); -+ numspecs = xmakeglyphfontspecs(specs, &TLINE(y)[x1], x2 - x1, x1, y); - - i = ox = 0; - for (x = x1; x < x2 && i < numspecs; x++) { -- new = term.line[y][x]; -+ new = TLINE(y)[x]; - if (new.mode == ATTR_WDUMMY) - continue; - if (ena_sel && selected(x, y)) -@@ -4000,7 +4068,8 @@ drawregion(int x1, int y1, int x2, int y2) - if (i > 0) - xdrawglyphfontspecs(specs, base, i, ox, y); - } -- xdrawcursor(); -+ if (term.scr == 0) -+ xdrawcursor(); - } - - void diff --git a/modules/user-interface.nix b/modules/user-interface.nix index b3c175fa..e0cd3e1e 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -51,11 +51,6 @@ in nixpkgs.config.allowUnfree = true; - nixpkgs.config.st = { - patches = [ ../config/st-scrollback-0.7.diff ]; - conf = builtins.readFile ../config/st-config.h; - }; - services.devmon.enable = true; services.emacs = { -- cgit 1.4.1 From b923275f93004b5dcd696899790d7af7781e0295 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 7 Nov 2017 11:00:45 +0100 Subject: Use same nixpkgs configuration for unstable channel --- modules/configuration/nix.nix | 9 ++++++++- modules/development/javascript.nix | 6 +----- modules/satoshipay.nix | 6 +----- modules/user-interface.nix | 4 +--- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/modules/configuration/nix.nix b/modules/configuration/nix.nix index 504942ec..bed00b7a 100644 --- a/modules/configuration/nix.nix +++ b/modules/configuration/nix.nix @@ -13,11 +13,18 @@ }; }; + nixpkgs.config = { + packageOverrides = pkgs: { + unstable = import { + config = config.nixpkgs.config; + }; + }; + }; + system.autoUpgrade = { enable = true; }; systemd.services.nixos-upgrade = { - environment.NIXPKGS_ALLOW_UNFREE = "1"; script = '' ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} ''; diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 8e494c68..ebca0f4c 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -1,10 +1,6 @@ { config, pkgs, ... }: -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in -{ environment.systemPackages = with pkgsUnstable; [ +{ environment.systemPackages = with pkgs.unstable; [ nodejs-8_x phantomjs2 nodePackages.yarn diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index a56deab4..81f9d43b 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -1,9 +1,5 @@ { config, pkgs, lib, ... }: -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in { virtualisation = { docker = { enable = true; @@ -23,7 +19,7 @@ in docker_compose electrum robomongo - pkgsUnstable.slack + unstable.slack ]; services.mongodb = { diff --git a/modules/user-interface.nix b/modules/user-interface.nix index e0cd3e1e..e4f87100 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -1,11 +1,9 @@ { config, pkgs, lib, ... }: let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; emacsPackage = import ../packages/emacs.nix { inherit (pkgs) stdenv; - pkgs = pkgsUnstable; + pkgs = pkgs.unstable; emacs = pkgs.lib.overrideDerivation (pkgs.emacs.override { withGTK2 = false; withGTK3 = true; -- cgit 1.4.1 From 3efd4f870af8fea046a843e23ffba3df67402890 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 7 Nov 2017 15:58:19 +0100 Subject: javascript: Use system node version for yarn --- modules/development/javascript.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index ebca0f4c..526a8cd8 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -3,7 +3,7 @@ { environment.systemPackages = with pkgs.unstable; [ nodejs-8_x phantomjs2 - nodePackages.yarn + yarn nodePackages.tern nodePackages.node2nix nodePackages.nodemon -- cgit 1.4.1 From 7cf7ff65a1f3f2c626ffe7495bbef4ac4549abe0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 8 Nov 2017 13:33:45 +0100 Subject: window-manager: Add auto-lock after 5 minutes --- modules/programs/window-manager.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index c1593745..3f584979 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -1,8 +1,15 @@ { config, pkgs, ... }: -{ services.xserver.displayManager = { +{ services.xserver = { + displayManager = { lightdm = { + enable = true; + }; + }; + xautolock = { enable = true; + locker = "${pkgs.i3lock-color}"; + time = 5; }; }; -- cgit 1.4.1 From b7f9088955ebbc58eeaef17f6036cb20b702371c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 8 Nov 2017 13:34:01 +0100 Subject: Emacs: Install docker-tramp --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index fe49e458..52c3a40a 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -80,6 +80,7 @@ in dired-subtree discover-my-major dockerfile-mode + docker-tramp docker-compose-mode dtrt-indent dumb-jump -- cgit 1.4.1 From 8e9beabee821f2fcaaaa7efb77f7709d837e4f45 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 12 Nov 2017 15:49:09 +0100 Subject: shell: Add some "modern" utilities --- modules/programs/shell.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/programs/shell.nix b/modules/programs/shell.nix index 54d54e32..dc85ccce 100644 --- a/modules/programs/shell.nix +++ b/modules/programs/shell.nix @@ -12,6 +12,9 @@ environment.systemPackages = with pkgs; [ vim pv + fd + entr + exa file htop lsof @@ -26,5 +29,7 @@ zip unzip telnet + + haskellPackages.una ]; } -- cgit 1.4.1 From 1bcf140b207e55cefa809d2d83e1580a9d1c3110 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 12 Nov 2017 15:49:24 +0100 Subject: satoshipay: install kubernetes tools --- modules/satoshipay.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 81f9d43b..12bfc109 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -18,6 +18,8 @@ google-chrome docker_compose electrum + minikube + kubernetes robomongo unstable.slack ]; -- cgit 1.4.1 From 0d66c3d6f315238e63256c347d6c6f2afbc830a3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 16 Nov 2017 14:08:29 +0100 Subject: user-interface: Remove unused terminals --- modules/user-interface.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index e4f87100..4f6bc34a 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -41,9 +41,6 @@ in aspell aspellDicts.en - alacritty - st - trash-cli ]; -- cgit 1.4.1 From 5afeaa7e5c677e8ffd921078556f0e66b7957cd6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 16 Nov 2017 14:08:53 +0100 Subject: emacs: Use moved redshank derivation --- packages/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 52c3a40a..59c9bf38 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -137,7 +137,6 @@ in projectile projectile-ripgrep quickrun - redshank relative-buffers restclient ripgrep @@ -164,6 +163,7 @@ in ]) ++ (with epkgs.elpaPackages; [ rainbow-mode ]) ++ [ + epkgs.redshank # I just need the one org-package epkgs.orgPackages.org-plus-contrib # defined above -- cgit 1.4.1 From 97651c7e372cab9000bcdd36166bb34fd5712129 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 16 Nov 2017 14:09:13 +0100 Subject: emacs: Replace custom packages with in-tree derivations --- packages/emacs.nix | 44 ++------------------------------------------ 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 59c9bf38..103bb4a2 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -7,45 +7,6 @@ let myEmacs = emacs; emacsWithPackages = (pkgs.emacsPackagesNgGen myEmacs).emacsWithPackages; - - elpaBuild = import { - inherit (pkgs) fetchurl lib stdenv texinfo; - emacs = myEmacs; - }; - - hook-helpers = pkgs.callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild { - pname = "hook-helpers"; - version = "1.1"; - src = fetchurl { - url = "http://elpa.gnu.org/packages/hook-helpers-1.1.tar"; - sha256 = "0xvabl0lfc0ijr98clsyh0bqk2fdi1ncl0knn58j2p30gn9958i5"; - }; - packageRequires = []; - meta = { - homepage = https://savannah.nongnu.org/projects/hook-helpers-el/; - license = lib.licenses.free; - }; - }) { - inherit elpaBuild; - inherit (pkgs) fetchurl lib; - }; - - dired-du = pkgs.callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild { - pname = "dired-du"; - version = "0.5"; - src = fetchurl { - url = "http://elpa.gnu.org/packages/dired-du-0.5.tar"; - sha256 = "09yj37p2fa5f81fqrzwghjkyy2ydsf4rbkfwpn2yyvzd5nd97bpl"; - }; - packageRequires = []; - meta = { - homepage = https://github.com/calancha/dired-du; - license = lib.licenses.free; - }; - }) { - inherit elpaBuild; - inherit (pkgs) fetchurl lib; - }; in emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [ diminish @@ -166,8 +127,7 @@ in epkgs.redshank # I just need the one org-package epkgs.orgPackages.org-plus-contrib - # defined above - hook-helpers - dired-du + epkgs.hook-helpers + epkgs.dired-du # From main packages set ]) -- cgit 1.4.1 From bbbb12fb192c95a3cd64c28291c7804dd4731b75 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 16 Nov 2017 15:59:55 +0100 Subject: Emacs: Install magithub --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 103bb4a2..8b92650a 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -81,6 +81,7 @@ in ledger-mode lua-mode magit + magithub markdown-mode mocha move-text -- cgit 1.4.1 From 4773e323ed24f05c1b465623f9ae4ee71e59c0b6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 16 Nov 2017 16:03:23 +0100 Subject: shell: Replace una with unar unar has a man page. --- modules/programs/shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/shell.nix b/modules/programs/shell.nix index dc85ccce..33ee27da 100644 --- a/modules/programs/shell.nix +++ b/modules/programs/shell.nix @@ -30,6 +30,6 @@ unzip telnet - haskellPackages.una + unar ]; } -- cgit 1.4.1 From 2a2817b7af09588e484226326a81bcb3ab5581cb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 24 Nov 2017 15:36:54 +0100 Subject: i3: Run dunst and sxhkd --- modules/programs/i3.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/programs/i3.nix b/modules/programs/i3.nix index 3bba3bbb..76dc66dc 100644 --- a/modules/programs/i3.nix +++ b/modules/programs/i3.nix @@ -3,6 +3,10 @@ { services.xserver.windowManager.i3 = { enable = true; package = pkgs.i3-gaps; + extraSessionCommands = '' + ${pkgs.dunst}/bin/dunst & + ${pkgs.sxhkd}/bin/sxhkd & + ''; }; environment.systemPackages = with pkgs; [ -- cgit 1.4.1 From db4e74ecb787f059023eb31c177b16b8a605a69e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 24 Nov 2017 15:40:15 +0100 Subject: Emacs: Install eacl --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 8b92650a..42851821 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -45,6 +45,7 @@ in docker-compose-mode dtrt-indent dumb-jump + eacl easy-hugo editorconfig elisp-slime-nav -- cgit 1.4.1 From 38fdac731ba36659dd59c66236d2a98e63e7e8f0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 24 Nov 2017 21:49:45 +0100 Subject: Re-enable physlock on laptops --- modules/hardware/laptop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index 3024daee..c08f6b96 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -27,7 +27,7 @@ IdleActionSec=600 ''; - services.physlock.enable = false; + services.physlock.enable = true; services.tlp = { enable = true; -- cgit 1.4.1 From e0bba25d20419ad3e3500107924d7baab39385eb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 24 Nov 2017 21:55:15 +0100 Subject: Satoshipay: Install meteor --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 12bfc109..73ffbf1c 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -17,6 +17,7 @@ environment.systemPackages = with pkgs; [ google-chrome docker_compose + meteor electrum minikube kubernetes -- cgit 1.4.1 From b89c607f1af55e503fa6447f11b4a6f856ea4927 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 24 Nov 2017 21:55:26 +0100 Subject: Javascript: Install build toolchain for native modules --- modules/development/javascript.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 526a8cd8..bf81cee4 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -7,5 +7,11 @@ nodePackages.tern nodePackages.node2nix nodePackages.nodemon + nodePackages.eslint_d + + autoconf + automake + gcc + gnumake ]; } -- cgit 1.4.1 From cb14f3e13c554e5de7ad1b160aecd8bf31bd4498 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 24 Nov 2017 22:57:13 +0100 Subject: Install rofi and rofi-pass --- modules/programs/passwords.nix | 1 + modules/programs/window-manager.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/programs/passwords.nix b/modules/programs/passwords.nix index 8c9d7cff..c93b1ff8 100644 --- a/modules/programs/passwords.nix +++ b/modules/programs/passwords.nix @@ -2,6 +2,7 @@ { environment.systemPackages = with pkgs; [ keepassx-community + rofi-pass pass pwgen ]; diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index 3f584979..2143bd67 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -17,6 +17,7 @@ dmenu dunst libnotify # for notify-send + rofi sxhkd scrot -- cgit 1.4.1 From 88c03ae91b895cc244c26c35a7623845aedbda40 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 25 Nov 2017 00:36:11 +0100 Subject: Use newer firefox --- modules/user-interface.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 4f6bc34a..ed4fe246 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -18,7 +18,7 @@ in programs.info.enable = true; environment.systemPackages = with pkgs; [ - firefox + unstable.firefox pcmanfm epdfview -- cgit 1.4.1 From be0ba2b9ad726750b0567493442e6e5d4ae40993 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 25 Nov 2017 00:36:22 +0100 Subject: Configure firefox build --- modules/user-interface.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index ed4fe246..6d96278d 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -16,6 +16,10 @@ let in { programs.browserpass.enable = true; programs.info.enable = true; + nixpkgs.config.firefox = { + enableBrowserpass = true; + enableOfficialBranding = true; + }; environment.systemPackages = with pkgs; [ unstable.firefox -- cgit 1.4.1 From ce30c254fe19f61eefcbceb713fd4b23b9efafa6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 25 Nov 2017 20:49:06 +0100 Subject: lisp: Install cl-launch --- modules/development/lisp.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/development/lisp.nix b/modules/development/lisp.nix index ffaa7115..349dcf33 100644 --- a/modules/development/lisp.nix +++ b/modules/development/lisp.nix @@ -4,6 +4,7 @@ ccl sbcl lispPackages.quicklisp + cl-launch dust pixie -- cgit 1.4.1 From d1fe2d3e7af79bada5792ab73e66095d73fe5ea0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 25 Nov 2017 21:01:27 +0100 Subject: lisp: Install asdf --- modules/development/lisp.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/development/lisp.nix b/modules/development/lisp.nix index 349dcf33..dc521feb 100644 --- a/modules/development/lisp.nix +++ b/modules/development/lisp.nix @@ -4,6 +4,7 @@ ccl sbcl lispPackages.quicklisp + asdf cl-launch dust -- cgit 1.4.1 From 55180c37c7f05695ef7c4073eca334ae5fdf7ace Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 29 Nov 2017 11:55:06 +0100 Subject: Fix indentation --- modules/programs/window-manager.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index 2143bd67..3f4e3055 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -2,10 +2,10 @@ { services.xserver = { displayManager = { - lightdm = { - enable = true; - }; - }; + lightdm = { + enable = true; + }; + }; xautolock = { enable = true; locker = "${pkgs.i3lock-color}"; -- cgit 1.4.1 From ed348b500c4ba09fdd7975d064072e6338aed379 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 29 Nov 2017 15:25:55 +0100 Subject: window-manager: Set root window properties Use hsetroot and xsetroot to work across compositors --- modules/programs/window-manager.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index 3f4e3055..50484ae1 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -5,6 +5,10 @@ lightdm = { enable = true; }; + sessionCommands = '' + ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr -solid '#4d4d4c' & + ${pkgs.hsetroot}/bin/hsetroot -solid '#4d4d4c' + ''; }; xautolock = { enable = true; -- cgit 1.4.1 From 84f021a4e619d6299c6e455885c945c30e34f015 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 4 Dec 2017 17:09:28 +0100 Subject: satoshipay: Install virtualbox (host) --- modules/satoshipay.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 73ffbf1c..7bb74fff 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -10,6 +10,10 @@ enable = true; }; }; + virtualbox.host = { + enable = true; + headless = true; + }; }; nixpkgs.config.allowUnfree = true; -- cgit 1.4.1 From 6e65aed1e286bbbf06e30b80f6aa77de1a2e5928 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 4 Dec 2017 17:13:38 +0100 Subject: intel-gpu: Enable intel_agp early in boot process --- modules/hardware/intel-gpu.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hardware/intel-gpu.nix b/modules/hardware/intel-gpu.nix index b44ddadf..cc580010 100644 --- a/modules/hardware/intel-gpu.nix +++ b/modules/hardware/intel-gpu.nix @@ -7,8 +7,10 @@ boot.earlyVconsoleSetup = true; boot.initrd.kernelModules = [ "i915" + "intel_agp" ]; boot.kernelModules = [ "i915" + "intel_agp" ]; } -- cgit 1.4.1 From 3a20509e2fd9ca2441d370a1c81b724ef84be990 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 4 Dec 2017 17:14:17 +0100 Subject: Install wine --- modules/programs/wine.nix | 6 ++++++ satoshipad.nix | 1 + 2 files changed, 7 insertions(+) create mode 100644 modules/programs/wine.nix diff --git a/modules/programs/wine.nix b/modules/programs/wine.nix new file mode 100644 index 00000000..98dd60a2 --- /dev/null +++ b/modules/programs/wine.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + wineStable + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index c2a981a1..ee124fb6 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -28,6 +28,7 @@ ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix ./modules/programs/shell.nix + ./modules/programs/wine.nix ./modules/satoshipay.nix ./modules/services/syncthing.nix ]; -- cgit 1.4.1 From 186c927d0fc00b25629e2816ca78be05e56c2271 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 7 Dec 2017 16:11:01 +0100 Subject: User-interface: Use default build configuration for Emacs --- modules/user-interface.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 6d96278d..c85b7925 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -4,10 +4,7 @@ let emacsPackage = import ../packages/emacs.nix { inherit (pkgs) stdenv; pkgs = pkgs.unstable; - emacs = pkgs.lib.overrideDerivation (pkgs.emacs.override { - withGTK2 = false; - withGTK3 = true; - }) (attrs: { + emacs = pkgs.lib.overrideDerivation (pkgs.emacs) (attrs: { postInstall = attrs.postInstall + '' rm $out/share/applications/emacs.desktop ''; -- cgit 1.4.1 From 18c8166b4feaae28e604cd2958e3696c49b77b69 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 12 Dec 2017 15:45:27 +0100 Subject: Add Steam module Move OpenGL 32-bit support here as it's not specific to Intel GPUs --- modules/hardware/nvidia-gpu.nix | 1 - modules/programs/steam.nix | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 modules/programs/steam.nix diff --git a/modules/hardware/nvidia-gpu.nix b/modules/hardware/nvidia-gpu.nix index 2c49e964..9fc34169 100644 --- a/modules/hardware/nvidia-gpu.nix +++ b/modules/hardware/nvidia-gpu.nix @@ -1,6 +1,5 @@ { config, pkgs, ... }: { services.xserver.videoDrivers = [ "nvidia" ]; - hardware.opengl.driSupport32Bit = true; nixpkgs.config.allowUnfree = true; } diff --git a/modules/programs/steam.nix b/modules/programs/steam.nix new file mode 100644 index 00000000..d4bad7a0 --- /dev/null +++ b/modules/programs/steam.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + steam + ]; + hardware.opengl.driSupport32Bit = true; + hardware.pulseaudio.support32Bit = true; +} -- cgit 1.4.1 From fc361bf760dc3ea9ef657d4f16ecce7bbc5b4660 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 14 Dec 2017 15:18:18 +0100 Subject: nix: Fix double auto-upgrade --- modules/configuration/nix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/configuration/nix.nix b/modules/configuration/nix.nix index bed00b7a..e20a6fcb 100644 --- a/modules/configuration/nix.nix +++ b/modules/configuration/nix.nix @@ -25,7 +25,7 @@ enable = true; }; systemd.services.nixos-upgrade = { - script = '' + script = pkgs.lib.mkForce '' ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} ''; }; -- cgit 1.4.1 From 2656b3860b57bf3d4524049238f62aad7860fcf7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 20 Dec 2017 13:35:47 +0100 Subject: Emacs: Add php-mode Just in case. --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 42851821..7cdb1fd5 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -104,6 +104,7 @@ in restclient ripgrep rjsx-mode + php-mode scala-mode scss-mode shrink-whitespace -- cgit 1.4.1 From 9f2a5c1a47674015a5252ee07d09bec2a627045e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 21 Dec 2017 21:09:52 +0100 Subject: t470s: Use alternative X acceleration method --- modules/machines/t470s.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 16ae3bb8..30d304e5 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -11,6 +11,11 @@ load-module module-alsa-sink device=hw:0,7 ''; + # Try a different acceleration method; maybe it helps with screen corruption + services.xserver.deviceSection = '' + Option "AccelMethod" "uxa" + ''; + environment.systemPackages = with pkgs; [ nvme-cli ]; -- cgit 1.4.1 From 4fe35f037b3249042fc072d255fe3134322293ac Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 21 Dec 2017 21:11:18 +0100 Subject: satoshipay: Disable virtualbox Doesn't build after kernel update, not critical anyway --- modules/satoshipay.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 7bb74fff..c199614d 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -11,7 +11,7 @@ }; }; virtualbox.host = { - enable = true; + enable = false; headless = true; }; }; -- cgit 1.4.1 From 590f508681facee9ec586351036d0a15b54707d7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 3 Jan 2018 18:29:33 +0000 Subject: Allow Steam ports in firewall settings --- modules/programs/steam.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/programs/steam.nix b/modules/programs/steam.nix index d4bad7a0..00236788 100644 --- a/modules/programs/steam.nix +++ b/modules/programs/steam.nix @@ -5,4 +5,15 @@ ]; hardware.opengl.driSupport32Bit = true; hardware.pulseaudio.support32Bit = true; + + networking.firewall = { + allowedUDPPorts = [ + 27031 + 27036 + ]; + allowedTCPPorts = [ + 27036 + 27037 + ]; + }; } -- cgit 1.4.1 From ce3d3f9d20ceeea8a4b40f2641f48e9acddeb59e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Jan 2018 10:10:01 +0000 Subject: Add config module for England --- modules/configuration/england.nix | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 modules/configuration/england.nix diff --git a/modules/configuration/england.nix b/modules/configuration/england.nix new file mode 100644 index 00000000..b2f799cd --- /dev/null +++ b/modules/configuration/england.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ time.timeZone = "Europe/London"; + services.redshift = { + latitude = "52.2394"; + longitude = "-0.9416"; + }; +} -- cgit 1.4.1 From 2cd6b18bb541f1f5a16139fda1e295cb9d7c2136 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Jan 2018 10:10:15 +0000 Subject: Install Steam on Satoshipad --- satoshipad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/satoshipad.nix b/satoshipad.nix index ee124fb6..77a3ee73 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -28,6 +28,7 @@ ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix ./modules/programs/shell.nix + ./modules/programs/steam.nix ./modules/programs/wine.nix ./modules/satoshipay.nix ./modules/services/syncthing.nix -- cgit 1.4.1 From 4abe538715e30c666643115916b2431a0999a4c8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 7 Jan 2018 18:57:40 +0100 Subject: base: Install nix-index to help find packages --- modules/base.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/base.nix b/modules/base.nix index ee59c61e..9e94a5a2 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -2,6 +2,10 @@ { boot.loader.timeout = 1; + environment.systemPackages = with pkgs; [ + nix-index + ]; + networking.extraHosts = '' 127.0.0.1 ${config.networking.hostName} ::1 ${config.networking.hostName} -- cgit 1.4.1 From 16faf2dfe1adc3ace279df372b5b28a33ad71e65 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 7 Jan 2018 18:58:20 +0100 Subject: t470s: Add a monitor section to try to help with hanging after idle --- modules/machines/t470s.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 30d304e5..d9bca7ce 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -16,6 +16,15 @@ Option "AccelMethod" "uxa" ''; + services.xserver.monitorSection = '' + DisplaySize 310 176 + + Option "StandbyTime" "0" + Option "SuspendTime" "300" + Option "OffTime" "600" + Option "BlankTime" "0" + ''; + environment.systemPackages = with pkgs; [ nvme-cli ]; -- cgit 1.4.1 From 785d458da6515acd183bbfc16ec7d5190a57611e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 7 Jan 2018 18:58:46 +0100 Subject: UI: Enable compton --- modules/user-interface.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index c85b7925..996f7a86 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -47,6 +47,10 @@ in nixpkgs.config.allowUnfree = true; + services.compton = { + enable = true; + }; + services.devmon.enable = true; services.emacs = { -- cgit 1.4.1 From 3c71e30f7461dfb88317a1c6996b98bf63b73218 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 7 Jan 2018 18:58:58 +0100 Subject: network-manager: Enable dnsmasq integration --- modules/hardware/network-manager.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hardware/network-manager.nix b/modules/hardware/network-manager.nix index b85b8f41..3f9f0433 100644 --- a/modules/hardware/network-manager.nix +++ b/modules/hardware/network-manager.nix @@ -2,6 +2,7 @@ { networking.networkmanager = { enable = true; + useDnsmasq = true; }; environment.systemPackages = with pkgs; [ -- cgit 1.4.1 From 99e0eb055264edf46a03eb24783d2ddb4e9e2ea8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 12 Jan 2018 14:53:08 +0100 Subject: Emacs: Remove lua-mode Breaking the build --- packages/emacs.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 7cdb1fd5..7c6afe22 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -80,7 +80,6 @@ in js2-refactor json-mode ledger-mode - lua-mode magit magithub markdown-mode -- cgit 1.4.1 From 838688f0d32edc305b8d56039b01b85ffada0e5a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 12 Jan 2018 14:53:39 +0100 Subject: satoshipay: Remove virtualbox --- modules/satoshipay.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index c199614d..73ffbf1c 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -10,10 +10,6 @@ enable = true; }; }; - virtualbox.host = { - enable = false; - headless = true; - }; }; nixpkgs.config.allowUnfree = true; -- cgit 1.4.1 From fe8ecb77db5d0cc75704992d94064c760e0f3153 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Feb 2018 11:33:28 +0100 Subject: Update microcode for bare-metal Intel CPUs --- modules/hardware/bare-metal.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hardware/bare-metal.nix b/modules/hardware/bare-metal.nix index c816e18e..b3c9d359 100644 --- a/modules/hardware/bare-metal.nix +++ b/modules/hardware/bare-metal.nix @@ -10,6 +10,7 @@ ]; boot.kernelPackages = pkgs.linuxPackages_latest; + hardware.cpu.intel.updateMicrocode = true; boot.tmpOnTmpfs = true; -- cgit 1.4.1 From 4da8ff047e8f21bfc6d77d8b48b88c54d2132c17 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Feb 2018 11:33:47 +0100 Subject: scrot -> maim --- modules/programs/window-manager.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index 50484ae1..ff3fc3ed 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -23,7 +23,7 @@ libnotify # for notify-send rofi sxhkd - scrot + maim perlPackages.FileMimeInfo # xdg-utils uses this when no DE ]; -- cgit 1.4.1 From 9595205f66be30c25da8d336c672c82b78d99e60 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Feb 2018 11:34:01 +0100 Subject: Emacs: Add support for typescript --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 7c6afe22..34b0ca4c 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -115,6 +115,7 @@ in swiper tern toml-mode + typescript-mode undo-tree visual-regexp volatile-highlights -- cgit 1.4.1 From c69589291f0199bd6ea755a6e857c9d0008ba93c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Feb 2018 11:34:28 +0100 Subject: Add KDE module --- modules/programs/kde.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 modules/programs/kde.nix diff --git a/modules/programs/kde.nix b/modules/programs/kde.nix new file mode 100644 index 00000000..e9d99fd6 --- /dev/null +++ b/modules/programs/kde.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +with lib; +{ services = { + xserver = { + desktopManager = { + plasma5.enable = true; + }; + displayManager = { + sddm.enable = true; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + kde-gtk-config + ]; +} -- cgit 1.4.1 From c4c502a39489719b3922daab42f3a25014c069e2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Feb 2018 11:35:21 +0100 Subject: Update Intel GPU configuration --- modules/hardware/intel-gpu.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/hardware/intel-gpu.nix b/modules/hardware/intel-gpu.nix index cc580010..593a06f0 100644 --- a/modules/hardware/intel-gpu.nix +++ b/modules/hardware/intel-gpu.nix @@ -2,14 +2,18 @@ { hardware.opengl.extraPackages = with pkgs; [ vaapiIntel + vaapiVdpau + libvdpau-va-gl ]; + services.xserver.videoDrivers = [ "intel" ]; + boot.earlyVconsoleSetup = true; boot.initrd.kernelModules = [ "i915" "intel_agp" ]; - boot.kernelModules = [ + boot.kernelModules = pkgs.lib.mkBefore [ "i915" "intel_agp" ]; -- cgit 1.4.1 From 568d96fb4a9dc06720797eecd3c072958ff5e3ab Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Feb 2018 11:59:09 +0100 Subject: Enable LSP (javascript) --- modules/development/javascript.nix | 1 + packages/emacs.nix | 3 +++ 2 files changed, 4 insertions(+) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index bf81cee4..4dd81401 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -7,6 +7,7 @@ nodePackages.tern nodePackages.node2nix nodePackages.nodemon + nodePackages.javascript-typescript-langserver nodePackages.eslint_d autoconf diff --git a/packages/emacs.nix b/packages/emacs.nix index 34b0ca4c..14dbe472 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -29,6 +29,7 @@ in command-log-mode company company-go + company-lsp company-restclient company-tern company-web @@ -80,6 +81,8 @@ in js2-refactor json-mode ledger-mode + lsp-javascript-typescript + lsp-mode magit magithub markdown-mode -- cgit 1.4.1 From 6d82bde46380fdd872deab911418ac7eb73ba76c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Feb 2018 12:01:32 +0100 Subject: SatoshiPay: Update DB tools --- modules/satoshipay.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 73ffbf1c..c3c5a0d6 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -21,7 +21,8 @@ electrum minikube kubernetes - robomongo + redis-desktop-manager + unstable.robo3t unstable.slack ]; -- cgit 1.4.1 From aeafcecb015ed55f0619324350f62cc23ad1df1d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Feb 2018 15:26:44 +0100 Subject: SatoshiPad: uninstall steam --- satoshipad.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 77a3ee73..ee124fb6 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -28,7 +28,6 @@ ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix ./modules/programs/shell.nix - ./modules/programs/steam.nix ./modules/programs/wine.nix ./modules/satoshipay.nix ./modules/services/syncthing.nix -- cgit 1.4.1 From 3ead1135bf3dfcc4e9e67a1f1bd80ebc1a6b8a5d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Feb 2018 15:26:52 +0100 Subject: Satoshipad: Install KDE --- satoshipad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/satoshipad.nix b/satoshipad.nix index ee124fb6..9fb54547 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -24,6 +24,7 @@ ./modules/machines/t470s.nix ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix + ./modules/programs/kde.nix ./modules/programs/i3.nix ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix -- cgit 1.4.1 From e328dcd231071fab991feecc747102c8eef5d086 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 4 Feb 2018 10:44:22 +0100 Subject: satoshipay: Enable IPv6 in docker --- modules/satoshipay.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index c3c5a0d6..0e5ce97f 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -6,6 +6,8 @@ enableOnBoot = false; liveRestore = false; + extraOptions = "--ipv6 --fixed-cidr-v6 fd69:2074:9fcd:b0fd::/64"; + autoPrune = { enable = true; }; -- cgit 1.4.1 From b1d95be08bebcb8c1cdf3133b812c861247f8f1d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 7 Feb 2018 10:50:13 +0100 Subject: Emacs: install more packages --- packages/emacs.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 14dbe472..65391320 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -107,6 +107,7 @@ in ripgrep rjsx-mode php-mode + prog-fill scala-mode scss-mode shrink-whitespace @@ -123,6 +124,8 @@ in visual-regexp volatile-highlights web-mode + monotropic-theme + eink-theme white-theme wgrep-ag which-key -- cgit 1.4.1 From 092fb00879d9593e41acf085141ebe2574421da4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 13 Feb 2018 13:35:25 +0100 Subject: Move some startup programs to sessionCommands --- modules/hardware/colemak.nix | 4 ++++ modules/hardware/laptop.nix | 3 +++ modules/programs/window-manager.nix | 1 + 3 files changed, 8 insertions(+) diff --git a/modules/hardware/colemak.nix b/modules/hardware/colemak.nix index 3b1c0582..29a03c87 100644 --- a/modules/hardware/colemak.nix +++ b/modules/hardware/colemak.nix @@ -13,5 +13,9 @@ layout = "us,us"; xkbVariant = "colemak,"; xkbOptions = "grp:shifts_toggle,altwin:prtsc_rwin"; + displayManager.sessionCommands = '' + # Needed for pass/rofi-pass autotype + ${pkgs.xlibs.setxkbmap}/bin/setxkbmap us -variant colemak + ''; }; } diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index c08f6b96..1c5d5e39 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -42,6 +42,9 @@ naturalScrolling = true; disableWhileTyping = true; }; + displayManager.sessionCommands = '' + ${pkgs.autorandr}/bin/autorandr --change --force + ''; }; systemd.services.nixos-upgrade.unitConfig.ConditionACPower = true; diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index ff3fc3ed..9c92f47d 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -8,6 +8,7 @@ sessionCommands = '' ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr -solid '#4d4d4c' & ${pkgs.hsetroot}/bin/hsetroot -solid '#4d4d4c' + ${pkgs.networkmanagerapplet}/bin/nm-applet & ''; }; xautolock = { -- cgit 1.4.1 From 4f244d35cc42aba068b7076f5007f3b1cbdbed5b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 15 Feb 2018 16:40:01 +0100 Subject: Re-enable virtualbox at SatoshiPay --- modules/satoshipay.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 0e5ce97f..7b0dc5ef 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -12,6 +12,12 @@ enable = true; }; }; + + virtualbox = { + host = { + enable = true; + }; + }; }; nixpkgs.config.allowUnfree = true; -- cgit 1.4.1 From 4b5e567eb77613872173a4b82ff2d0227e6f2fea Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Feb 2018 18:05:13 +0100 Subject: Disable lightdm --- modules/programs/window-manager.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index 9c92f47d..09b0a28f 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -3,7 +3,7 @@ { services.xserver = { displayManager = { lightdm = { - enable = true; + enable = false; }; sessionCommands = '' ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr -solid '#4d4d4c' & -- cgit 1.4.1 From 871d5afd5e78b8f5e7ae293095526ec99568ed6b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Feb 2018 18:05:36 +0100 Subject: Comment-out currently missing emacs packages --- packages/emacs.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 65391320..41621de9 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -107,7 +107,7 @@ in ripgrep rjsx-mode php-mode - prog-fill + # prog-fill scala-mode scss-mode shrink-whitespace @@ -124,7 +124,7 @@ in visual-regexp volatile-highlights web-mode - monotropic-theme + # monotropic-theme eink-theme white-theme wgrep-ag -- cgit 1.4.1 From 2b7010c2385ba4b5c705ff58d5d7d73949c757aa Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 28 Feb 2018 09:50:19 +0100 Subject: colemak: Allow switching back to QWERTY --- modules/hardware/colemak.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hardware/colemak.nix b/modules/hardware/colemak.nix index 29a03c87..b8218e67 100644 --- a/modules/hardware/colemak.nix +++ b/modules/hardware/colemak.nix @@ -15,7 +15,7 @@ xkbOptions = "grp:shifts_toggle,altwin:prtsc_rwin"; displayManager.sessionCommands = '' # Needed for pass/rofi-pass autotype - ${pkgs.xlibs.setxkbmap}/bin/setxkbmap us -variant colemak + ${pkgs.xlibs.setxkbmap}/bin/setxkbmap us,us -variant colemak, ''; }; } -- cgit 1.4.1 From d8ce8317b0dba0c6db5bf05e8dbc06b35f5b4fb8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 28 Feb 2018 09:50:51 +0100 Subject: satoshipay: Use a mongo "replica set" --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 7b0dc5ef..501ba497 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -36,6 +36,7 @@ services.mongodb = { enable = true; + replSetName = "rs0"; }; systemd.services.mongodb.wantedBy = lib.mkForce []; services.redis = { -- cgit 1.4.1 From d07e8227744d14b4353f2dd801a9f344bd905642 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 1 Mar 2018 09:33:10 +0100 Subject: Emacs: Add discover packages for js2 and clj refactoring modes --- packages/emacs.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 41621de9..8e148610 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -41,6 +41,8 @@ in dired-narrow dired-subtree discover-my-major + discover-js2-refactor + discover-clj-refactor dockerfile-mode docker-tramp docker-compose-mode -- cgit 1.4.1 From 631468b7420408479a4d6f905a8da96d3ec350c7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 4 Mar 2018 15:51:13 +0100 Subject: Install weechat --- modules/user-interface.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 996f7a86..b723dbed 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -35,6 +35,8 @@ in mu msmtp + weechat + calibre mpv -- cgit 1.4.1 From 6cc2b2d23b4d9b59e6ca016eaaadfb3f6a5dc48c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 4 Mar 2018 15:51:31 +0100 Subject: Emacs: Install ivy-hydra --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 8e148610..b18a417c 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -78,6 +78,7 @@ in helpful imenu-anywhere indium + ivy-hydra jinja2-mode js2-mode js2-refactor -- cgit 1.4.1 From 66d2f0330023b14abd15f7da407f6cff9e7fd890 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 6 Mar 2018 13:01:12 +0100 Subject: Use qwerty on satoshipad --- modules/hardware/qwerty.nix | 14 ++++++++++++++ satoshipad.nix | 1 + 2 files changed, 15 insertions(+) create mode 100644 modules/hardware/qwerty.nix diff --git a/modules/hardware/qwerty.nix b/modules/hardware/qwerty.nix new file mode 100644 index 00000000..3783b3a9 --- /dev/null +++ b/modules/hardware/qwerty.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ services.kmscon = { + extraConfig = '' + xkb-model=pc104 + xkb-layout=us + xkb-options="altwin:prtsc_rwin" + ''; + }; + services.xserver = { + layout = "us"; + xkbOptions = "altwin:prtsc_rwin"; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index 9fb54547..226908fd 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -20,6 +20,7 @@ ./modules/hardware/network-manager.nix ./modules/hardware/nitrokey.nix ./modules/hardware/printing.nix + ./modules/hardware/qwerty.nix ./modules/hardware/trackball.nix ./modules/machines/t470s.nix ./modules/programs/accounting.nix -- cgit 1.4.1 From 22ddb031c9cade16fd5c77ba240ae1f2e0d2d443 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 7 Mar 2018 17:44:29 +0100 Subject: Remove colemak on satoshipad --- satoshipad.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 226908fd..ad934e2a 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -15,7 +15,6 @@ ./modules/development/lisp.nix ./modules/hardware/adb.nix ./modules/hardware/audio.nix - ./modules/hardware/colemak.nix ./modules/hardware/systemd-boot.nix ./modules/hardware/network-manager.nix ./modules/hardware/nitrokey.nix -- cgit 1.4.1 From 3b51c35515bfa8a74cbe6437465d8a9263b106a5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 8 Mar 2018 18:39:19 +0100 Subject: Use US intl layout for QWERTY --- modules/hardware/qwerty.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hardware/qwerty.nix b/modules/hardware/qwerty.nix index 3783b3a9..d220cb27 100644 --- a/modules/hardware/qwerty.nix +++ b/modules/hardware/qwerty.nix @@ -4,11 +4,13 @@ extraConfig = '' xkb-model=pc104 xkb-layout=us + xkb-variant=intl-unicode xkb-options="altwin:prtsc_rwin" ''; }; services.xserver = { layout = "us"; + xkbVariant = "intl-unicode"; xkbOptions = "altwin:prtsc_rwin"; }; } -- cgit 1.4.1 From 267a09991b8344356f307f3bc8bc84cc5fff0884 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 8 Mar 2018 18:40:17 +0100 Subject: marvin: use qwerty --- marvin.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marvin.nix b/marvin.nix index df798d49..62a0b660 100644 --- a/marvin.nix +++ b/marvin.nix @@ -12,7 +12,7 @@ ./modules/development/lisp.nix ./modules/hardware/adb.nix ./modules/hardware/audio.nix - ./modules/hardware/colemak.nix + ./modules/hardware/qwerty.nix ./modules/hardware/network-manager.nix ./modules/hardware/nitrokey.nix ./modules/hardware/systemd-boot.nix -- cgit 1.4.1 From 0326d3a143e58601300504608cca8af5a92b176f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 8 Mar 2018 18:40:28 +0100 Subject: kde: force-disable physlock --- modules/programs/kde.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/programs/kde.nix b/modules/programs/kde.nix index e9d99fd6..652eb2a6 100644 --- a/modules/programs/kde.nix +++ b/modules/programs/kde.nix @@ -10,6 +10,8 @@ with lib; sddm.enable = true; }; }; + + physlock.enable = lib.mkForce false; }; environment.systemPackages = with pkgs; [ -- cgit 1.4.1 From 404f3ad2d3a8bd5961c4e55ae621f87e40f9c7dc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 8 Mar 2018 18:40:40 +0100 Subject: marvin: try KDE --- marvin.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/marvin.nix b/marvin.nix index 62a0b660..92ba5db4 100644 --- a/marvin.nix +++ b/marvin.nix @@ -22,6 +22,7 @@ ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix ./modules/programs/i3.nix + ./modules/programs/kde.nix ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix ./modules/programs/shell.nix -- cgit 1.4.1 From a009fe64101b47e520b5d98d41d1066e7e6fb0dc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 19 Mar 2018 15:08:36 +0100 Subject: xserver: Change installed fonts --- modules/services/xserver.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 2432715a..d842d4c8 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -49,15 +49,21 @@ }; fonts = with pkgs; [ cantarell_fonts - carlito dejavu_fonts fantasque-sans-mono + dina-font + envypn-font + emacs-all-the-icons-fonts fira fira-code fira-mono - font-droid + go-font + gohufont font-awesome-ttf hack-font + inconsolata + iosevka + league-of-moveable-type liberation_ttf mononoki (nerdfonts.override { @@ -67,14 +73,15 @@ paratype-pt-mono paratype-pt-sans paratype-pt-serif - roboto - roboto-mono - roboto-slab + profont + proggyfonts source-code-pro source-sans-pro source-serif-pro terminus_font + tewi-font xorg.fontxfree86type1 + uni-vga ]; }; } -- cgit 1.4.1 From 942123bce188dc6ff278d43a0dc61c6a5a8f0f12 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 19 Mar 2018 15:08:53 +0100 Subject: Emacs: Remove some discover- modes --- packages/emacs.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index b18a417c..83aef71e 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -41,8 +41,6 @@ in dired-narrow dired-subtree discover-my-major - discover-js2-refactor - discover-clj-refactor dockerfile-mode docker-tramp docker-compose-mode -- cgit 1.4.1 From 17f200293bdb6a673844f5b7f014f0dcd9438e0a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 21 Mar 2018 12:20:48 +0100 Subject: Include kompose in SatoshiPay stack --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 501ba497..a49bbba6 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -30,6 +30,7 @@ minikube kubernetes redis-desktop-manager + unstable.kompose unstable.robo3t unstable.slack ]; -- cgit 1.4.1 From 53f4bcf710f8515e2cee2a0c4bcb52b0c261c73d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Apr 2018 13:25:52 +0200 Subject: Remove some fonts --- modules/services/xserver.nix | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index d842d4c8..792714bf 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -48,7 +48,6 @@ }; }; fonts = with pkgs; [ - cantarell_fonts dejavu_fonts fantasque-sans-mono dina-font @@ -58,12 +57,7 @@ fira-code fira-mono go-font - gohufont font-awesome-ttf - hack-font - inconsolata - iosevka - league-of-moveable-type liberation_ttf mononoki (nerdfonts.override { @@ -79,9 +73,7 @@ source-sans-pro source-serif-pro terminus_font - tewi-font xorg.fontxfree86type1 - uni-vga ]; }; } -- cgit 1.4.1 From 1fbab7eb7e43ccbaea352edcf6f4cdc4f240dea6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 11:42:53 +0200 Subject: Update satoshipad to 18.03 --- modules/services/syncthing.nix | 1 - modules/services/xserver.nix | 1 - satoshipad.nix | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix index 5a3e1d6e..b6a12861 100644 --- a/modules/services/syncthing.nix +++ b/modules/services/syncthing.nix @@ -6,7 +6,6 @@ group = "users"; openDefaultPorts = true; systemService = true; - useInotify = true; dataDir = "/home/alan/.config/syncthing"; }; } diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 792714bf..718a98d5 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -20,7 +20,6 @@ hicolor_icon_theme adapta-gtk-theme - flat-plat paper-gtk-theme paper-icon-theme diff --git a/satoshipad.nix b/satoshipad.nix index ad934e2a..77fc2abb 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -48,5 +48,5 @@ nix.gc.dates = "12:00"; system.autoUpgrade.dates = "12:24"; - system.stateVersion = "17.09"; + system.stateVersion = "18.03"; } -- cgit 1.4.1 From 21d7524134997c8c70327d9150648ee4b33a7b52 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 13:25:07 +0200 Subject: Ensure sound is actually enabled --- modules/hardware/audio.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hardware/audio.nix b/modules/hardware/audio.nix index f5046574..f229da67 100644 --- a/modules/hardware/audio.nix +++ b/modules/hardware/audio.nix @@ -5,6 +5,8 @@ support32Bit = true; }; + sound.enable = true; + environment.systemPackages = with pkgs; [ pamixer pavucontrol -- cgit 1.4.1 From 6a77d78e346c386f10e9eedaa6615673d5cebf9b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 13:25:25 +0200 Subject: Remove KDE on satoshipad --- satoshipad.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 77fc2abb..a9b8f944 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -24,7 +24,6 @@ ./modules/machines/t470s.nix ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix - ./modules/programs/kde.nix ./modules/programs/i3.nix ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix -- cgit 1.4.1 From 9a33bb7c6c9d33d223875f45155c8646e371539c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 13:26:11 +0200 Subject: Don't always use the latest kernel --- modules/hardware/bare-metal.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hardware/bare-metal.nix b/modules/hardware/bare-metal.nix index b3c9d359..eacc9f40 100644 --- a/modules/hardware/bare-metal.nix +++ b/modules/hardware/bare-metal.nix @@ -9,7 +9,6 @@ usbutils ]; - boot.kernelPackages = pkgs.linuxPackages_latest; hardware.cpu.intel.updateMicrocode = true; boot.tmpOnTmpfs = true; -- cgit 1.4.1 From 0c99ea7bd9a3aee99b732d5a49a7bb7f183bd2df Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 13:26:26 +0200 Subject: Slow down background updates --- modules/configuration/nix.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/configuration/nix.nix b/modules/configuration/nix.nix index e20a6fcb..75c3486d 100644 --- a/modules/configuration/nix.nix +++ b/modules/configuration/nix.nix @@ -23,6 +23,7 @@ system.autoUpgrade = { enable = true; + flags = [ "--max-jobs" "2" ]; }; systemd.services.nixos-upgrade = { script = pkgs.lib.mkForce '' -- cgit 1.4.1 From 906838d6f08e42d0e840808fffb8952abc859d5f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 13:26:45 +0200 Subject: Remove dejavu fonts --- modules/services/xserver.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 718a98d5..4b559ea0 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -47,7 +47,6 @@ }; }; fonts = with pkgs; [ - dejavu_fonts fantasque-sans-mono dina-font envypn-font -- cgit 1.4.1 From d2f24270cae82631df86479a2d3aee5a63290ff3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 14:16:59 +0200 Subject: Add support for flashing model 01 --- modules/configuration/user.nix | 2 +- modules/hardware/keyboardio-model01.nix | 7 +++++++ satoshipad.nix | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 modules/hardware/keyboardio-model01.nix diff --git a/modules/configuration/user.nix b/modules/configuration/user.nix index 75ba17f2..1d4a1837 100644 --- a/modules/configuration/user.nix +++ b/modules/configuration/user.nix @@ -3,7 +3,7 @@ { users.extraUsers.alan = { description = "Alan Pearce"; isNormalUser = true; - extraGroups = [ "audio" "wheel" "adbusers" "docker" "nitrokey" ]; + extraGroups = [ "audio" "wheel" "adbusers" "docker" "nitrokey" "dialout" ]; shell = "/run/current-system/sw/bin/zsh"; home = "/home/alan"; uid = 1000; diff --git a/modules/hardware/keyboardio-model01.nix b/modules/hardware/keyboardio-model01.nix new file mode 100644 index 00000000..33a3fd65 --- /dev/null +++ b/modules/hardware/keyboardio-model01.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ services.udev.extraRules = '' + SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2300", SYMLINK+="model01", ENV{ID_MM_DEVICE_IGNORE}:="1", ENV{ID_MM_CANDIDATE}:="0" + SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2301", SYMLINK+="model01", ENV{ID_MM_DEVICE_IGNORE}:="1", ENV{ID_MM_CANDIDATE}:="0" + ''; +} diff --git a/satoshipad.nix b/satoshipad.nix index a9b8f944..54ce5bd2 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -16,6 +16,7 @@ ./modules/hardware/adb.nix ./modules/hardware/audio.nix ./modules/hardware/systemd-boot.nix + ./modules/hardware/keyboardio-model01.nix ./modules/hardware/network-manager.nix ./modules/hardware/nitrokey.nix ./modules/hardware/printing.nix -- cgit 1.4.1 From 0ff4862021f26671e210a2fed96fe041830855cd Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 14:22:55 +0200 Subject: Add arduino core to model 01 setup --- modules/hardware/keyboardio-model01.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/hardware/keyboardio-model01.nix b/modules/hardware/keyboardio-model01.nix index 33a3fd65..7a624f56 100644 --- a/modules/hardware/keyboardio-model01.nix +++ b/modules/hardware/keyboardio-model01.nix @@ -4,4 +4,10 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2300", SYMLINK+="model01", ENV{ID_MM_DEVICE_IGNORE}:="1", ENV{ID_MM_CANDIDATE}:="0" SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2301", SYMLINK+="model01", ENV{ID_MM_DEVICE_IGNORE}:="1", ENV{ID_MM_CANDIDATE}:="0" ''; + + environment.systemPackages = with pkgs; [ + arduino_core + ]; + + environment.variables.ARDUINO_PATH = "${pkgs.arduino_core}/share/arduino"; } -- cgit 1.4.1 From d33859198b4bce559df559ea641aa0955e9886b6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 17:13:27 +0200 Subject: Use normal firefox-bin --- modules/user-interface.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index b723dbed..1ad087f7 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -13,13 +13,9 @@ let in { programs.browserpass.enable = true; programs.info.enable = true; - nixpkgs.config.firefox = { - enableBrowserpass = true; - enableOfficialBranding = true; - }; environment.systemPackages = with pkgs; [ - unstable.firefox + firefox-bin pcmanfm epdfview -- cgit 1.4.1 From 72d2193ef8766cd4603a53b602629e774febd51f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Apr 2018 17:13:45 +0200 Subject: Tweak font rendering --- modules/services/xserver.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 4b559ea0..3030a545 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -43,7 +43,7 @@ enable = true; # presets: # ultimate1 ultimate2 ultimate3 ultimate4 ultimate5 osx windowsxp - preset = "windowsxp"; + preset = "ultimate2"; }; }; fonts = with pkgs; [ -- cgit 1.4.1 From d74d376fcb4f325bcfe91de750f5b07ce4f8d487 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 11 Apr 2018 14:37:00 +0200 Subject: user-interface: switch to firefox for browserpass integration --- modules/user-interface.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 1ad087f7..43ab86c3 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -13,9 +13,10 @@ let in { programs.browserpass.enable = true; programs.info.enable = true; + nixpkgs.config.firefox.enableOfficialBranding = true; environment.systemPackages = with pkgs; [ - firefox-bin + firefox pcmanfm epdfview -- cgit 1.4.1 From 14cee12227e127e7e0e309d02c901ce065f07958 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 11 Apr 2018 14:41:06 +0200 Subject: Remove remote-build configuration --- modules/hardware/laptop.nix | 1 - modules/remote-build.nix | 13 ------------- 2 files changed, 14 deletions(-) delete mode 100644 modules/remote-build.nix diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index 1c5d5e39..bd083081 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -52,6 +52,5 @@ imports = [ ../user-interface.nix - ../remote-build.nix ]; } diff --git a/modules/remote-build.nix b/modules/remote-build.nix deleted file mode 100644 index 7c1906f1..00000000 --- a/modules/remote-build.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ nix.distributedBuilds = true; - nix.buildMachines = [{ - hostName = "oak.alanpearce.eu"; - sshUser = "nix-ssh"; - sshKey = "/root/.ssh/id_ed25519"; - system = "x86_64-linux"; - maxJobs = 2; - supportedFeatures = ["kvm"]; - mandatoryFeatures = []; - }]; -} -- cgit 1.4.1 From 1f8ce38579da6a67122ed1ead1ce1a4151da296c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 11 Apr 2018 17:18:10 +0200 Subject: xserver: switch themes --- modules/services/xserver.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 3030a545..630e639d 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -18,8 +18,8 @@ vanilla-dmz + arc-theme hicolor_icon_theme - adapta-gtk-theme paper-gtk-theme paper-icon-theme -- cgit 1.4.1 From bfa791e315f6974339afea747e4ad76fc0027544 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 14 Apr 2018 21:33:28 +0200 Subject: Use system packages for emacs --- modules/user-interface.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 43ab86c3..02982a47 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -3,7 +3,7 @@ let emacsPackage = import ../packages/emacs.nix { inherit (pkgs) stdenv; - pkgs = pkgs.unstable; + inherit pkgs; emacs = pkgs.lib.overrideDerivation (pkgs.emacs) (attrs: { postInstall = attrs.postInstall + '' rm $out/share/applications/emacs.desktop -- cgit 1.4.1 From 72f8866df6eafff5b44b4d8c6d7c55c5df01cceb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 14 Apr 2018 21:33:53 +0200 Subject: SatoshiPay: Add helm (kubernetes) --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index a49bbba6..d8787ebb 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -29,6 +29,7 @@ electrum minikube kubernetes + kubernetes-helm redis-desktop-manager unstable.kompose unstable.robo3t -- cgit 1.4.1 From 61dcdbece76ec346ab21572f3800d54f4c7bb732 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 29 Apr 2018 14:58:22 +0200 Subject: user: Allow me to change network settings --- modules/configuration/user.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/configuration/user.nix b/modules/configuration/user.nix index 1d4a1837..7034a159 100644 --- a/modules/configuration/user.nix +++ b/modules/configuration/user.nix @@ -3,7 +3,7 @@ { users.extraUsers.alan = { description = "Alan Pearce"; isNormalUser = true; - extraGroups = [ "audio" "wheel" "adbusers" "docker" "nitrokey" "dialout" ]; + extraGroups = [ "audio" "wheel" "adbusers" "docker" "nitrokey" "dialout" "networkmanager" ]; shell = "/run/current-system/sw/bin/zsh"; home = "/home/alan"; uid = 1000; -- cgit 1.4.1 From 0057b23e6f5b82511993546eb751350d0d2b45da Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 29 Apr 2018 14:58:51 +0200 Subject: UI: Use mlterm instead of rxvt-unicode --- modules/user-interface.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 02982a47..eecf4e5c 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -22,6 +22,8 @@ in epdfview geeqie + mlterm + lxappearance vdirsyncer @@ -52,6 +54,8 @@ in services.devmon.enable = true; + environment.sessionVariables.TERMINAL = "mlterm"; + services.emacs = { enable = true; defaultEditor = true; @@ -66,10 +70,6 @@ in }; }; - services.urxvtd = { - enable = true; - }; - imports = [ ./services/xserver.nix ]; -- cgit 1.4.1 From b7bb57f5971f1cf4ccdee558fd35c7f042514682 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 29 Apr 2018 14:59:46 +0200 Subject: WM: Disable xterm login session --- modules/programs/window-manager.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index 09b0a28f..81470bf7 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -1,6 +1,8 @@ { config, pkgs, ... }: { services.xserver = { + desktopManager.xterm.enable = false; + displayManager = { lightdm = { enable = false; -- cgit 1.4.1 From 68f44953449af2ad3565426e1716757fe7afc04b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 29 Apr 2018 15:00:06 +0200 Subject: WM: Set default login user for slim --- modules/programs/window-manager.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index 81470bf7..dfa21848 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -4,8 +4,9 @@ desktopManager.xterm.enable = false; displayManager = { - lightdm = { - enable = false; + slim = { + enable = true; + defaultUser = "alan"; }; sessionCommands = '' ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr -solid '#4d4d4c' & -- cgit 1.4.1 From 05571aa5ed5eb898be468bff237657914f7e9dcf Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 29 Apr 2018 15:00:53 +0200 Subject: Delay startup of non-essential services --- modules/hardware/laptop.nix | 13 ++++++++++++- modules/hardware/nitrokey.nix | 10 +++++++++- modules/hardware/printing.nix | 9 +++++++++ modules/services/zeroconf.nix | 11 ++++++++++- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index bd083081..c6628855 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -6,7 +6,18 @@ ]; hardware = { - bluetooth.enable = true; + bluetooth = { + enable = true; + powerOnBoot = false; + }; + }; + systemd.services.bluetooth.wantedBy = lib.mkForce []; + systemd.timers.bluetooth = { + description = "Delayed startup of Bluetooth"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; }; environment.systemPackages = with pkgs; [ diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix index ec25d8e0..22e9d762 100644 --- a/modules/hardware/nitrokey.nix +++ b/modules/hardware/nitrokey.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { programs.ssh.startAgent = false; @@ -26,6 +26,14 @@ enable = true; }; }; + systemd.services.tor.wantedBy = lib.mkForce []; + systemd.timers.tor = { + description = "Delayed startup of Tor"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; + }; environment.systemPackages = with pkgs; [ gnupg diff --git a/modules/hardware/printing.nix b/modules/hardware/printing.nix index 32aa4038..96d3a959 100644 --- a/modules/hardware/printing.nix +++ b/modules/hardware/printing.nix @@ -3,6 +3,15 @@ { services.printing.enable = true; systemd.services.cups.wantedBy = lib.mkForce []; systemd.sockets.cups.wantedBy = [ "sockets.target" ]; + systemd.services.cups-browsed.wantedBy = lib.mkForce []; + + systemd.timers.cups-browsed = { + description = "Delayed startup of CUPS Remote Printer Discovery"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "2 min"; + }; + }; imports = [ ../services/zeroconf.nix diff --git a/modules/services/zeroconf.nix b/modules/services/zeroconf.nix index aa4b47e8..0b428c54 100644 --- a/modules/services/zeroconf.nix +++ b/modules/services/zeroconf.nix @@ -1,7 +1,16 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { services.avahi = { enable = true; nssmdns = true; + ipv6 = true; + }; + systemd.services.avahi-daemon.wantedBy = lib.mkForce []; + systemd.timers.avahi-daemon = { + description = "Delayed startup of Avahi"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; }; } -- cgit 1.4.1 From ed7e95ef79e2b754047390f93e11733291775cf1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 29 Apr 2018 19:14:40 +0200 Subject: Speedup boot by disabling nscd Seems odd, but it slows down network-manager by 10s --- modules/services/zeroconf.nix | 2 +- modules/user-interface.nix | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/services/zeroconf.nix b/modules/services/zeroconf.nix index 0b428c54..8eb01fbe 100644 --- a/modules/services/zeroconf.nix +++ b/modules/services/zeroconf.nix @@ -2,7 +2,7 @@ { services.avahi = { enable = true; - nssmdns = true; + nssmdns = false; ipv6 = true; }; systemd.services.avahi-daemon.wantedBy = lib.mkForce []; diff --git a/modules/user-interface.nix b/modules/user-interface.nix index eecf4e5c..348abd7d 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -56,6 +56,8 @@ in environment.sessionVariables.TERMINAL = "mlterm"; + services.nscd.enable = false; + services.emacs = { enable = true; defaultEditor = true; -- cgit 1.4.1 From 663992bd5a621a40a8f0124369d5ffa821871e19 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 29 Apr 2018 20:04:48 +0200 Subject: SatoshiPay: Startup mongodb and redis automatically, after delay --- modules/satoshipay.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index d8787ebb..36561b52 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -41,10 +41,26 @@ replSetName = "rs0"; }; systemd.services.mongodb.wantedBy = lib.mkForce []; + systemd.timers.mongodb = { + description = "Delayed startup of MongoDB"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; + }; + services.redis = { enable = true; }; systemd.services.redis.wantedBy = lib.mkForce []; + systemd.timers.redis = { + description = "Delayed startup of Redis"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; + }; + services.printing.drivers = with pkgs; [ cups-toshiba-estudio -- cgit 1.4.1 From 106542e052137ba632402276e1621bc16a3ab907 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 30 Apr 2018 19:32:30 +0200 Subject: Audio: Enable more PulseAudio features --- modules/hardware/audio.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hardware/audio.nix b/modules/hardware/audio.nix index f229da67..47d68e06 100644 --- a/modules/hardware/audio.nix +++ b/modules/hardware/audio.nix @@ -3,6 +3,7 @@ { hardware.pulseaudio = { enable = true; support32Bit = true; + package = pkgs.pulseaudioFull; }; sound.enable = true; -- cgit 1.4.1 From 13d399c7a4b436b8b687b17d6c5d24ac9e060410 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 10 May 2018 13:01:34 +0200 Subject: Remove KDE on marvin --- marvin.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/marvin.nix b/marvin.nix index 92ba5db4..62a0b660 100644 --- a/marvin.nix +++ b/marvin.nix @@ -22,7 +22,6 @@ ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix ./modules/programs/i3.nix - ./modules/programs/kde.nix ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix ./modules/programs/shell.nix -- cgit 1.4.1 From a205c33d34c1bda893d967f4962b4263a9ee5069 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 10 May 2018 13:02:15 +0200 Subject: Remove monitorsize for x250 --- modules/machines/x250.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/machines/x250.nix b/modules/machines/x250.nix index c527f4dc..0e8ac04e 100644 --- a/modules/machines/x250.nix +++ b/modules/machines/x250.nix @@ -8,10 +8,6 @@ firmwareLinuxNonfree ]; - services.xserver.monitorSection = '' - DisplaySize 277 156 - ''; - services.tlp.extraConfig = '' # Newer Thinkpads have a battery firmware # it conflicts with TLP if stop thresholds are set -- cgit 1.4.1 From e261ccaf3755d26f0af318e1b5775da0f7bee94f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 19 May 2018 17:06:40 +0200 Subject: Enable zeroconf name resolution Required nscd, which slows down the boot process, so make that a delayed-start service --- modules/services/zeroconf.nix | 2 +- modules/user-interface.nix | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/services/zeroconf.nix b/modules/services/zeroconf.nix index 8eb01fbe..0b428c54 100644 --- a/modules/services/zeroconf.nix +++ b/modules/services/zeroconf.nix @@ -2,7 +2,7 @@ { services.avahi = { enable = true; - nssmdns = false; + nssmdns = true; ipv6 = true; }; systemd.services.avahi-daemon.wantedBy = lib.mkForce []; diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 348abd7d..b0d4d9d2 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -56,7 +56,15 @@ in environment.sessionVariables.TERMINAL = "mlterm"; - services.nscd.enable = false; + services.nscd.enable = true; + systemd.services.nscd.wantedBy = lib.mkForce []; + systemd.timers.nscd = { + description = "Delayed startup of nscd"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; + }; services.emacs = { enable = true; -- cgit 1.4.1 From 8f2d38227be0dd84be4bb38334bff12b9d294087 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 19 May 2018 17:07:36 +0200 Subject: Disable networkmanager-bundled dnsmasq --- modules/hardware/network-manager.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hardware/network-manager.nix b/modules/hardware/network-manager.nix index 3f9f0433..28b88382 100644 --- a/modules/hardware/network-manager.nix +++ b/modules/hardware/network-manager.nix @@ -2,7 +2,7 @@ { networking.networkmanager = { enable = true; - useDnsmasq = true; + useDnsmasq = false; }; environment.systemPackages = with pkgs; [ -- cgit 1.4.1 From f9a06bdb8e3a0b795d3fc3d29cb467824971088e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 19 May 2018 17:08:18 +0200 Subject: ui: Install pass-otp --- modules/user-interface.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index b0d4d9d2..5b52e7f4 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -36,6 +36,8 @@ in weechat + unstable.pass-otp + calibre mpv -- cgit 1.4.1 From 8c9571698ccc2c5a2ed229b5b6dec62142497cda Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 23 May 2018 10:30:20 +0200 Subject: T470s: Improve display acceleration The corruption issue seems to have been solved --- modules/machines/t470s.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index d9bca7ce..e6fb8cb6 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -13,7 +13,9 @@ # Try a different acceleration method; maybe it helps with screen corruption services.xserver.deviceSection = '' - Option "AccelMethod" "uxa" + Option "AccelMethod" "sna" + Option "TearFree" "true" + Option "TripleBuffer" "false" ''; services.xserver.monitorSection = '' -- cgit 1.4.1 From dad4945128e9f0965ef2058753b853bdd27394bc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 23 May 2018 10:30:52 +0200 Subject: X: reorder fonts --- modules/services/xserver.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 630e639d..08f7b4e4 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -47,15 +47,20 @@ }; }; fonts = with pkgs; [ - fantasque-sans-mono dina-font envypn-font + profont + proggyfonts + terminus_font + + fantasque-sans-mono emacs-all-the-icons-fonts fira fira-code fira-mono go-font font-awesome-ttf + font-droid liberation_ttf mononoki (nerdfonts.override { @@ -65,12 +70,9 @@ paratype-pt-mono paratype-pt-sans paratype-pt-serif - profont - proggyfonts source-code-pro source-sans-pro source-serif-pro - terminus_font xorg.fontxfree86type1 ]; }; -- cgit 1.4.1 From 822dd7a7daae1ae2ca98bd988884d5f076bbf3f7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 4 Jun 2018 16:56:03 +0200 Subject: Nitrokey: Setup keybase --- modules/hardware/nitrokey.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix index 22e9d762..dc32e9ba 100644 --- a/modules/hardware/nitrokey.nix +++ b/modules/hardware/nitrokey.nix @@ -15,6 +15,9 @@ }; services.pcscd.enable = true; + services.keybase.enable = true; + services.kbfs.enable = true; + environment.variables.NIX_SKIP_KEYBASE_CHECKS = 1; services.tor = { enable = true; -- cgit 1.4.1 From be1a8162d354f1bb469c9ba7ce926ac6b918177a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 5 Jun 2018 11:08:33 +0200 Subject: Nitrokey: Fix environment variable syntax --- modules/hardware/nitrokey.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix index dc32e9ba..90b08cfb 100644 --- a/modules/hardware/nitrokey.nix +++ b/modules/hardware/nitrokey.nix @@ -17,7 +17,7 @@ services.pcscd.enable = true; services.keybase.enable = true; services.kbfs.enable = true; - environment.variables.NIX_SKIP_KEYBASE_CHECKS = 1; + environment.variables.NIX_SKIP_KEYBASE_CHECKS = "1"; services.tor = { enable = true; -- cgit 1.4.1 From f053cf7a1a7069db41199bd8c82a0f04ebd53844 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 5 Jun 2018 21:25:49 +0200 Subject: Marvin: Include base configuration --- marvin.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/marvin.nix b/marvin.nix index 62a0b660..f047d88b 100644 --- a/marvin.nix +++ b/marvin.nix @@ -3,6 +3,7 @@ { imports = [ ./hardware-configuration.nix + ./modules/base.nix ./modules/configuration/berlin.nix ./modules/configuration/british-english.nix ./modules/configuration/nix.nix -- cgit 1.4.1 From 831587da16026005f1a7362ea066e9d05380fb77 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Jun 2018 19:20:53 +0200 Subject: nitrokey: Actually install keybase, not just the services --- modules/hardware/nitrokey.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix index 90b08cfb..3837f6f3 100644 --- a/modules/hardware/nitrokey.nix +++ b/modules/hardware/nitrokey.nix @@ -41,5 +41,6 @@ environment.systemPackages = with pkgs; [ gnupg nitrokey-app + keybase-gui ]; } -- cgit 1.4.1 From 9b7339b2ed7452d1bfce3cff48201638170ee1b3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 11 Jun 2018 15:56:31 +0200 Subject: emacs: add evil packages --- packages/emacs.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 83aef71e..23fd4857 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -12,8 +12,17 @@ in diminish bind-key use-package - smartparens ]) ++ (with epkgs.melpaPackages; [ + spacemacs-theme + evil + evil-commentary + evil-goggles + evil-mu4e + evil-org + evil-surround + evil-leader + evil-space + ace-link ace-window add-node-modules-path @@ -108,7 +117,6 @@ in ripgrep rjsx-mode php-mode - # prog-fill scala-mode scss-mode shrink-whitespace @@ -123,11 +131,8 @@ in typescript-mode undo-tree visual-regexp - volatile-highlights web-mode - # monotropic-theme - eink-theme - white-theme + monotropic-theme wgrep-ag which-key yaml-mode -- cgit 1.4.1 From 9dccc208a35fe983e9f7cb64407a44a54b1f8626 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 15 Jun 2018 16:46:26 +0200 Subject: emacs: Add missing packages --- packages/emacs.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 23fd4857..cb90deab 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -15,13 +15,17 @@ in ]) ++ (with epkgs.melpaPackages; [ spacemacs-theme evil + evil-collection evil-commentary evil-goggles + evil-magit evil-mu4e evil-org + evil-quickscope evil-surround evil-leader evil-space + evil-snipe ace-link ace-window @@ -132,7 +136,9 @@ in undo-tree visual-regexp web-mode + eink-theme monotropic-theme + spacemacs-theme wgrep-ag which-key yaml-mode -- cgit 1.4.1 From db104a3f9ef5f2d81fb66996b9f9462555a51805 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 15 Jun 2018 16:46:46 +0200 Subject: satoshipay: update packages --- modules/satoshipay.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 36561b52..e51ba8e4 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -26,11 +26,10 @@ google-chrome docker_compose meteor - electrum minikube - kubernetes - kubernetes-helm - redis-desktop-manager + unstable.kubernetes + unstable.redis-desktop-manager + unstable.kubernetes-helm unstable.kompose unstable.robo3t unstable.slack -- cgit 1.4.1 From 2b8a5f7c76746af6f740d2dbee6c4a51a7aad403 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Jun 2018 20:02:56 +0200 Subject: emacs: Cleanup package list --- packages/emacs.nix | 75 ++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 42 deletions(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index cb90deab..cf8517af 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -8,37 +8,19 @@ let myEmacs = emacs; emacsWithPackages = (pkgs.emacsPackagesNgGen myEmacs).emacsWithPackages; in - emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [ - diminish - bind-key - use-package - ]) ++ (with epkgs.melpaPackages; [ - spacemacs-theme - evil - evil-collection - evil-commentary - evil-goggles - evil-magit - evil-mu4e - evil-org - evil-quickscope - evil-surround - evil-leader - evil-space - evil-snipe - + emacsWithPackages (epkgs: (with epkgs.melpaPackages; [ ace-link - ace-window add-node-modules-path ag auto-compile avy bbdb - beginend + bind-key cider clj-refactor clojure-mode cmd-to-echo + coffee-mode command-log-mode company company-go @@ -51,29 +33,37 @@ in crux cyphejor define-word - dired-narrow + diminish dired-subtree discover-my-major - dockerfile-mode - docker-tramp + discover-js2-refactor docker-compose-mode + docker-tramp + dockerfile-mode dtrt-indent dumb-jump eacl easy-hugo editorconfig + eink-theme elisp-slime-nav emmet-mode - ensime + evil + evil-collection + evil-commentary + evil-leader + evil-magit + evil-mu4e + evil-org + evil-quickscope + evil-snipe + evil-space + evil-surround exec-path-from-shell - expand-region eyebrowse - flow-minor-mode flycheck - flycheck-flow flycheck-pos-tip flycheck-vale - fontawesome geiser ggtags ghq @@ -85,8 +75,9 @@ in go-projectile goto-chg haskell-mode - highlight-stages + helm helpful + highlight-stages imenu-anywhere indium ivy-hydra @@ -94,25 +85,27 @@ in js2-mode js2-refactor json-mode + kubernetes ledger-mode lsp-javascript-typescript lsp-mode + lsp-ui magit magithub markdown-mode mocha - move-text - multiple-cursors + monotropic-theme + navi-mode nginx-mode nix-mode nix-sandbox + org-journal outorg outshine - navi-mode - org-journal page-break-lines paredit password-store + php-mode projectile projectile-ripgrep quickrun @@ -120,25 +113,21 @@ in restclient ripgrep rjsx-mode - php-mode - scala-mode + sentence-navigation scss-mode shrink-whitespace slime smart-tabs-mode smex spaceline - suggest + spacemacs-theme swiper tern toml-mode typescript-mode undo-tree - visual-regexp + use-package web-mode - eink-theme - monotropic-theme - spacemacs-theme wgrep-ag which-key yaml-mode @@ -147,8 +136,10 @@ in ]) ++ [ epkgs.redshank # I just need the one org-package - epkgs.orgPackages.org-plus-contrib + epkgs.hook-helpers epkgs.dired-du # From main packages set + + pkgs.mu ]) -- cgit 1.4.1 From 2dd5fc89029433472e63b4df67c6d6a4ccdfca0b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 18 Jun 2018 20:43:44 +0200 Subject: emacs: Add kubernetes-evil --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index cf8517af..c2644a43 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -86,6 +86,7 @@ in js2-refactor json-mode kubernetes + kubernetes-evil ledger-mode lsp-javascript-typescript lsp-mode -- cgit 1.4.1 From e8ab8a052bd0af979b306a12125d6c09b1326d24 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Jun 2018 15:56:18 +0200 Subject: emacs: Add auto-async-byte-compile --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index c2644a43..8ca7d0fa 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -13,6 +13,7 @@ in add-node-modules-path ag auto-compile + auto-async-byte-compile avy bbdb bind-key -- cgit 1.4.1 From cf7f46b1b1d99ebb67c0a183e266937bdc39596d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 26 Jun 2018 17:07:39 +0200 Subject: emacs: Add tide --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 8ca7d0fa..92a20ddf 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -125,6 +125,7 @@ in spacemacs-theme swiper tern + tide toml-mode typescript-mode undo-tree -- cgit 1.4.1 From 27ce842c9dccd98008e7ff76296ffeaa46e9d9eb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 30 Jun 2018 18:40:04 +0200 Subject: satoshipad: Configure a realistic docker prune time --- satoshipad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/satoshipad.nix b/satoshipad.nix index 54ce5bd2..d1648648 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -47,6 +47,7 @@ nix.gc.dates = "12:00"; system.autoUpgrade.dates = "12:24"; + virtualisation.docker.autoPrune.dates = "Mon, 13:00"; system.stateVersion = "18.03"; } -- cgit 1.4.1 From 0e155b8bae3a0fad2d211aa5c0ea0300f20a8340 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 30 Jun 2018 18:41:09 +0200 Subject: satoshipad: Tweak nixos maintenance timers --- satoshipad.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/satoshipad.nix b/satoshipad.nix index d1648648..68a9d683 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -45,8 +45,8 @@ networking.hostName = "satoshipad"; - nix.gc.dates = "12:00"; - system.autoUpgrade.dates = "12:24"; + nix.gc.dates = "12:30"; + system.autoUpgrade.dates = "13:24"; virtualisation.docker.autoPrune.dates = "Mon, 13:00"; system.stateVersion = "18.03"; -- cgit 1.4.1 From 47919612a7dd30afce680e91384c791379023685 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 12 Jul 2018 15:47:27 +0200 Subject: Simplify emacs configuation to make stable/unstable use easier --- modules/user-interface.nix | 8 +------- packages/emacs.nix | 13 ++++++++----- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 5b52e7f4..ca9d5956 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -2,13 +2,7 @@ let emacsPackage = import ../packages/emacs.nix { - inherit (pkgs) stdenv; - inherit pkgs; - emacs = pkgs.lib.overrideDerivation (pkgs.emacs) (attrs: { - postInstall = attrs.postInstall + '' - rm $out/share/applications/emacs.desktop - ''; - }); + pkgs = pkgs.unstable; }; in { programs.browserpass.enable = true; diff --git a/packages/emacs.nix b/packages/emacs.nix index 92a20ddf..f685c01b 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -1,14 +1,17 @@ { - pkgs, - emacs ? pkgs.emacs, - stdenv + pkgs ? import }: let - myEmacs = emacs; + myEmacs = pkgs.lib.overrideDerivation (pkgs.emacs) (attrs: { + postInstall = attrs.postInstall + '' + rm $out/share/applications/emacs.desktop + ''; + }); + emacsWithPackages = (pkgs.emacsPackagesNgGen myEmacs).emacsWithPackages; in - emacsWithPackages (epkgs: (with epkgs.melpaPackages; [ + emacsWithPackages (epkgs: (with epkgs; [ ace-link add-node-modules-path ag -- cgit 1.4.1 From a36c1ddc3ad6b4fdc2c24b309504862f6d61bae0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 17 Jul 2018 20:18:05 +0200 Subject: Install steam on marvin --- marvin.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/marvin.nix b/marvin.nix index f047d88b..bafad5bc 100644 --- a/marvin.nix +++ b/marvin.nix @@ -26,6 +26,7 @@ ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix ./modules/programs/shell.nix + ./modules/programs/steam.nix ./modules/services/syncthing.nix ]; -- cgit 1.4.1 From 454d3c333e7424c62247c38fbbe681ccdb422bd2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 18 Jul 2018 20:37:37 +0200 Subject: Use newer versions of password managers They need to be kept up-to-date with their corresponding browser plugins, which are auto-updated. Using unstable nixpkgs here should reduce the frequency of breakages --- modules/programs/passwords.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/passwords.nix b/modules/programs/passwords.nix index c93b1ff8..094ad29e 100644 --- a/modules/programs/passwords.nix +++ b/modules/programs/passwords.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: -{ environment.systemPackages = with pkgs; [ +{ environment.systemPackages = with pkgs.unstable; [ keepassx-community rofi-pass pass -- cgit 1.4.1 From 9396b6569afa486d0b057e2e782d0f0d59daa802 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 20 Jul 2018 17:46:21 +0200 Subject: Emacs: add packages --- packages/emacs.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index f685c01b..a76ce649 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -91,6 +91,7 @@ in json-mode kubernetes kubernetes-evil + kubernetes-tramp ledger-mode lsp-javascript-typescript lsp-mode @@ -111,6 +112,7 @@ in paredit password-store php-mode + prettier-js projectile projectile-ripgrep quickrun -- cgit 1.4.1 From 86de06ed1db69588d5290c9e679f675ab12ad6ae Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 20 Jul 2018 17:46:34 +0200 Subject: SatoshiPay: install google cloud sdk --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index e51ba8e4..68fe6e3c 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -27,6 +27,7 @@ docker_compose meteor minikube + unstable.google-cloud-sdk unstable.kubernetes unstable.redis-desktop-manager unstable.kubernetes-helm -- cgit 1.4.1 From 7e6dc94ba96b8fb66c9cc99d6a9ab79d772679de Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 22 Jul 2018 18:01:08 +0200 Subject: SatoshiPay: override cups-toshiba-estudio --- modules/satoshipay.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 68fe6e3c..75832dbc 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, fetchurl, lib, ... }: { virtualisation = { docker = { @@ -63,7 +63,13 @@ services.printing.drivers = with pkgs; [ - cups-toshiba-estudio + (cups-toshiba-estudio.overrideAttrs (oldAttrs: { + version = "7.89"; + src = pkgs.fetchurl { + url = http://business.toshiba.com/downloads/KB/f1Ulds/15178/TOSHIBA_ColorMFP_CUPS.tar; + sha256 = "0qz4r7q55i0adf4fv3aqnfqgi2pz3jb1jixkqm9x6nk4vanyjf4r"; + }; + })) ]; networking.domain = "satoshipay.io"; -- cgit 1.4.1 From 11bb3cd4b9ab734a5230c7b359e0fe040598bff8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 1 Aug 2018 12:22:57 +0200 Subject: javascript: Use node-gyp to pull in build tools --- modules/development/javascript.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 4dd81401..2e92509a 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -9,10 +9,7 @@ nodePackages.nodemon nodePackages.javascript-typescript-langserver nodePackages.eslint_d - - autoconf - automake - gcc + nodePackages.node-gyp gnumake ]; } -- cgit 1.4.1 From a4fc11580a6517e9f6641e3a7cf16fc96d56ba52 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 1 Aug 2018 12:26:42 +0200 Subject: Use unstable cups-toshiba-estudio instead of override This reverts commit 7e6dc94ba96b8fb66c9cc99d6a9ab79d772679de. --- modules/satoshipay.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 75832dbc..f4207573 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -1,4 +1,4 @@ -{ config, pkgs, fetchurl, lib, ... }: +{ config, pkgs, lib, ... }: { virtualisation = { docker = { @@ -63,13 +63,7 @@ services.printing.drivers = with pkgs; [ - (cups-toshiba-estudio.overrideAttrs (oldAttrs: { - version = "7.89"; - src = pkgs.fetchurl { - url = http://business.toshiba.com/downloads/KB/f1Ulds/15178/TOSHIBA_ColorMFP_CUPS.tar; - sha256 = "0qz4r7q55i0adf4fv3aqnfqgi2pz3jb1jixkqm9x6nk4vanyjf4r"; - }; - })) + unstable.cups-toshiba-estudio ]; networking.domain = "satoshipay.io"; -- cgit 1.4.1 From 4f4d732f5c7f308b367893a8d70a5bcbefb7f135 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 8 Aug 2018 13:56:54 +0200 Subject: xserver: Switch fonts --- modules/services/xserver.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 08f7b4e4..88778fce 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -35,9 +35,9 @@ enableDefaultFonts = true; fontconfig = { defaultFonts = { - monospace = [ "Source Code Pro" ]; - sansSerif = [ "Source Sans Pro" ]; - serif = [ "Source Serif Pro" ]; + monospace = [ "Liberation Mono" ]; + sansSerif = [ "Liberation Sans" ]; + serif = [ "Liberation Serif" ]; }; ultimate = { enable = true; -- cgit 1.4.1 From 1d676bc31a63e87ed214d317fb68e4eea0d7cbfc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 9 Aug 2018 13:11:49 +0200 Subject: dev/base: include gitk and other git friends --- modules/development/base.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/development/base.nix b/modules/development/base.nix index 370b5d69..013e975a 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -2,6 +2,7 @@ { environment.systemPackages = with pkgs; [ mercurial + gitAndTools.gitFull gitAndTools.git-extras gitAndTools.hub -- cgit 1.4.1 From 001802a5aec0a20d6e4b2ffa70b1b2bd6bed010b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 9 Aug 2018 13:12:04 +0200 Subject: dev/base: include a markdown command --- modules/development/base.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/development/base.nix b/modules/development/base.nix index 013e975a..1ae4a451 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -16,5 +16,6 @@ jq nodePackages.js-yaml + discount ]; } -- cgit 1.4.1 From 14e0c9b4e1b0212e998d1a79697d3c82f319713b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 20 Aug 2018 12:08:05 +0200 Subject: add tools previous installed in user profile --- modules/development/base.nix | 8 ++++++++ modules/satoshipay.nix | 2 ++ modules/user-interface.nix | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/modules/development/base.nix b/modules/development/base.nix index 1ae4a451..e8d2b76a 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -7,6 +7,14 @@ gitAndTools.hub editorconfig-core-c + multimarkdown + gocode + + surf + ldns + httping + wrk + whois ag ripgrep diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index f4207573..bbde34e8 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -27,6 +27,8 @@ docker_compose meteor minikube + mongodb-tools + sops unstable.google-cloud-sdk unstable.kubernetes unstable.redis-desktop-manager diff --git a/modules/user-interface.nix b/modules/user-interface.nix index ca9d5956..a91dc4af 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -10,9 +10,13 @@ in nixpkgs.config.firefox.enableOfficialBranding = true; environment.systemPackages = with pkgs; [ + aria2 firefox pcmanfm + fish + ncdu + epdfview geeqie @@ -39,6 +43,9 @@ in aspell aspellDicts.en + hexchat + signal-desktop + trash-cli ]; -- cgit 1.4.1 From 5f4723df19ab14b917b98677aa74d20aaf5a6557 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 26 Aug 2018 20:00:04 +0200 Subject: thinkpad: remove battery threshold customisation --- modules/hardware/thinkpad.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/hardware/thinkpad.nix b/modules/hardware/thinkpad.nix index 755b433e..15ec4df8 100644 --- a/modules/hardware/thinkpad.nix +++ b/modules/hardware/thinkpad.nix @@ -21,10 +21,10 @@ extraConfig = '' # Newer Thinkpads have a battery firmware # it conflicts with TLP if stop thresholds are set - START_CHARGE_THRESH_BAT0=70 - STOP_CHARGE_THRESH_BAT0=80 - START_CHARGE_THRESH_BAT1=70 - STOP_CHARGE_THRESH_BAT1=80 + # START_CHARGE_THRESH_BAT0=70 + # STOP_CHARGE_THRESH_BAT0=80 + # START_CHARGE_THRESH_BAT1=70 + # STOP_CHARGE_THRESH_BAT1=80 ''; }; -- cgit 1.4.1 From 10888ffca2dbe39721a0b62766c34b97bce8fb08 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 28 Aug 2018 14:13:05 +0200 Subject: satoshipay: continue using overriden printer drivers --- modules/satoshipay.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index bbde34e8..075ae3c7 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, fetchurl, lib, ... }: { virtualisation = { docker = { @@ -65,7 +65,13 @@ services.printing.drivers = with pkgs; [ - unstable.cups-toshiba-estudio + (cups-toshiba-estudio.overrideAttrs (oldAttrs: { + version = "7.89"; + src = pkgs.fetchurl { + url = http://business.toshiba.com/downloads/KB/f1Ulds/15178/TOSHIBA_ColorMFP_CUPS.tar; + sha256 = "0qz4r7q55i0adf4fv3aqnfqgi2pz3jb1jixkqm9x6nk4vanyjf4r"; + }; + })) ]; networking.domain = "satoshipay.io"; -- cgit 1.4.1 From 83b39bc89a5698ba7842ea9de6621817d1d894ca Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 7 Sep 2018 17:08:36 +0200 Subject: Import more packages for imperative user installs --- modules/development/base.nix | 1 + modules/development/javascript.nix | 7 ++++++- modules/programs/accounting.nix | 1 + modules/satoshipay.nix | 2 ++ modules/user-interface.nix | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/development/base.nix b/modules/development/base.nix index e8d2b76a..d2d67db7 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -8,6 +8,7 @@ editorconfig-core-c multimarkdown + go gocode surf diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 2e92509a..c8828600 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -4,12 +4,17 @@ nodejs-8_x phantomjs2 yarn + nodePackages.tern nodePackages.node2nix nodePackages.nodemon nodePackages.javascript-typescript-langserver nodePackages.eslint_d + + # npm install may use any of these + python2 nodePackages.node-gyp - gnumake + nodePackages.node-gyp-build + nodePackages.node-pre-gyp ]; } diff --git a/modules/programs/accounting.nix b/modules/programs/accounting.nix index 5882436f..7c17c14a 100644 --- a/modules/programs/accounting.nix +++ b/modules/programs/accounting.nix @@ -6,5 +6,6 @@ bean-add beancount fava + reckon ]; } diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 075ae3c7..ee5ae9a6 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -23,11 +23,13 @@ nixpkgs.config.allowUnfree = true; environment.systemPackages = with pkgs; [ + openssl google-chrome docker_compose meteor minikube mongodb-tools + s3cmd sops unstable.google-cloud-sdk unstable.kubernetes diff --git a/modules/user-interface.nix b/modules/user-interface.nix index a91dc4af..26699dac 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -43,8 +43,10 @@ in aspell aspellDicts.en + cifs-utils hexchat signal-desktop + nextcloud-client trash-cli ]; -- cgit 1.4.1 From 05011c3fe1b68c3414fc8a34307c2a07f9427a34 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 7 Sep 2018 17:08:54 +0200 Subject: T470s: Improve GPU usage/acceleration --- modules/machines/t470s.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index e6fb8cb6..304bfd5c 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -5,6 +5,8 @@ firmwareLinuxNonfree ]; + boot.kernelPackages = pkgs.linuxPackages_4_17; + systemd.services.ModemManager.enable = true; hardware.pulseaudio.extraConfig = '' @@ -12,11 +14,11 @@ ''; # Try a different acceleration method; maybe it helps with screen corruption - services.xserver.deviceSection = '' - Option "AccelMethod" "sna" - Option "TearFree" "true" - Option "TripleBuffer" "false" - ''; + # services.xserver.deviceSection = '' + # Option "AccelMethod" "sna" + # Option "TearFree" "true" + # Option "TripleBuffer" "false" + # ''; services.xserver.monitorSection = '' DisplaySize 310 176 -- cgit 1.4.1 From 474a3757e7eb9d57d040c6f95c3b689c17288bca Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 20 Sep 2018 10:54:25 +0200 Subject: satoshipay: use tmpdir for mongodb --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index ee5ae9a6..75a04078 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -43,6 +43,7 @@ services.mongodb = { enable = true; replSetName = "rs0"; + dbpath = "/tmp/mongodb"; }; systemd.services.mongodb.wantedBy = lib.mkForce []; systemd.timers.mongodb = { -- cgit 1.4.1 From a114b12027fbd82484833a7a2ded35273de39e3b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 24 Sep 2018 16:08:09 +0200 Subject: bare-metal: tweak TCP congestion control --- modules/hardware/bare-metal.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/hardware/bare-metal.nix b/modules/hardware/bare-metal.nix index eacc9f40..9d79fb50 100644 --- a/modules/hardware/bare-metal.nix +++ b/modules/hardware/bare-metal.nix @@ -11,6 +11,11 @@ hardware.cpu.intel.updateMicrocode = true; + boot.kernel.sysctl = { + "net.ipv4.tcp_allowed_congestion_control" = "illinois reno lp"; + "net.ipv4.tcp_congestion_control" = "illinois"; + }; + boot.tmpOnTmpfs = true; fileSystems."/".options = [ "noatime" "nodiratime" ]; -- cgit 1.4.1 From 2b75d0fc23652539d0932d540afb10303c6f70b7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Oct 2018 16:11:29 +0200 Subject: javascript: improve native module compatibility --- modules/development/javascript.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index c8828600..1d25ae85 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -12,6 +12,9 @@ nodePackages.eslint_d # npm install may use any of these + binutils + gcc + gnumake python2 nodePackages.node-gyp nodePackages.node-gyp-build -- cgit 1.4.1 From 75b82266ce18dd036683e2a9ac15f2cee4081ea5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 7 Oct 2018 17:52:22 +0200 Subject: marvin: remove steam --- marvin.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/marvin.nix b/marvin.nix index bafad5bc..f047d88b 100644 --- a/marvin.nix +++ b/marvin.nix @@ -26,7 +26,6 @@ ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix ./modules/programs/shell.nix - ./modules/programs/steam.nix ./modules/services/syncthing.nix ]; -- cgit 1.4.1 From aa81e95467a7d131a335e149b951f2a8ef66dfd5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 7 Oct 2018 17:53:03 +0200 Subject: cleanup some unused packages --- modules/development/base.nix | 1 - modules/services/xserver.nix | 3 --- modules/user-interface.nix | 3 --- packages/emacs.nix | 3 --- 4 files changed, 10 deletions(-) diff --git a/modules/development/base.nix b/modules/development/base.nix index d2d67db7..a353db62 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -24,7 +24,6 @@ http-prompt jq - nodePackages.js-yaml discount ]; } diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 88778fce..701b8348 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -63,9 +63,6 @@ font-droid liberation_ttf mononoki - (nerdfonts.override { - withFont = "Monoid"; - }) opensans-ttf paratype-pt-mono paratype-pt-sans diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 26699dac..c13babaa 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -24,9 +24,6 @@ in lxappearance - vdirsyncer - khal - offlineimap isync mu diff --git a/packages/emacs.nix b/packages/emacs.nix index a76ce649..6d7dc744 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -91,13 +91,11 @@ in json-mode kubernetes kubernetes-evil - kubernetes-tramp ledger-mode lsp-javascript-typescript lsp-mode lsp-ui magit - magithub markdown-mode mocha monotropic-theme @@ -143,7 +141,6 @@ in rainbow-mode ]) ++ [ epkgs.redshank - # I just need the one org-package epkgs.hook-helpers epkgs.dired-du -- cgit 1.4.1 From bc83a31fecce6dc1431d4188cf67b71efbf8e432 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 7 Oct 2018 17:53:23 +0200 Subject: upgrade to 18.09 --- marvin.nix | 2 +- modules/hardware/network-manager.nix | 2 +- modules/hardware/thinkpad.nix | 1 - modules/user-interface.nix | 5 +++-- packages/emacs.nix | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/marvin.nix b/marvin.nix index f047d88b..3227fd70 100644 --- a/marvin.nix +++ b/marvin.nix @@ -38,5 +38,5 @@ domain = "alanpearce.eu"; }; - system.stateVersion = "17.09"; + system.stateVersion = "18.09"; } diff --git a/modules/hardware/network-manager.nix b/modules/hardware/network-manager.nix index 28b88382..04480a8c 100644 --- a/modules/hardware/network-manager.nix +++ b/modules/hardware/network-manager.nix @@ -2,7 +2,7 @@ { networking.networkmanager = { enable = true; - useDnsmasq = false; + dns = "unbound"; }; environment.systemPackages = with pkgs; [ diff --git a/modules/hardware/thinkpad.nix b/modules/hardware/thinkpad.nix index 15ec4df8..0d2a1eed 100644 --- a/modules/hardware/thinkpad.nix +++ b/modules/hardware/thinkpad.nix @@ -13,7 +13,6 @@ services.thinkfan = { enable = true; - sensor = "/sys/class/thermal/thermal_zone0/temp"; }; services.tlp = { diff --git a/modules/user-interface.nix b/modules/user-interface.nix index c13babaa..5793a124 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -2,11 +2,12 @@ let emacsPackage = import ../packages/emacs.nix { - pkgs = pkgs.unstable; + inherit pkgs; + # pkgs = pkgs.unstable; }; in { programs.browserpass.enable = true; - programs.info.enable = true; + documentation.info.enable = true; nixpkgs.config.firefox.enableOfficialBranding = true; environment.systemPackages = with pkgs; [ diff --git a/packages/emacs.nix b/packages/emacs.nix index 6d7dc744..450591b6 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -89,8 +89,8 @@ in js2-mode js2-refactor json-mode - kubernetes - kubernetes-evil + # kubernetes + # kubernetes-evil ledger-mode lsp-javascript-typescript lsp-mode -- cgit 1.4.1 From 74b88c14d3f278f09ccc73726214628bab9fe4f1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 11 Oct 2018 14:14:16 +0200 Subject: t470s: Update kernel version --- modules/machines/t470s.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 304bfd5c..d729beac 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -5,7 +5,7 @@ firmwareLinuxNonfree ]; - boot.kernelPackages = pkgs.linuxPackages_4_17; + boot.kernelPackages = pkgs.linuxPackages_4_18; systemd.services.ModemManager.enable = true; -- cgit 1.4.1 From 25cfc6f60ddd7e43772ad0c6c68c0ea47c31a324 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 12 Oct 2018 15:36:51 +0200 Subject: Emacs: cleanup unused packages --- packages/emacs.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 450591b6..3dae49a1 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -24,7 +24,6 @@ in clj-refactor clojure-mode cmd-to-echo - coffee-mode command-log-mode company company-go @@ -42,7 +41,6 @@ in discover-my-major discover-js2-refactor docker-compose-mode - docker-tramp dockerfile-mode dtrt-indent dumb-jump @@ -99,13 +97,10 @@ in markdown-mode mocha monotropic-theme - navi-mode nginx-mode nix-mode nix-sandbox org-journal - outorg - outshine page-break-lines paredit password-store -- cgit 1.4.1 From 28f98b0ac1defee7bf5e66191fad21b260975d07 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 13 Oct 2018 21:24:45 +0200 Subject: Emacs: Enable overriding package --- packages/emacs.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 3dae49a1..dc99878c 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -1,9 +1,10 @@ { - pkgs ? import + pkgs ? import {}, + emacs ? pkgs.emacs }: let - myEmacs = pkgs.lib.overrideDerivation (pkgs.emacs) (attrs: { + myEmacs = pkgs.lib.overrideDerivation (emacs) (attrs: { postInstall = attrs.postInstall + '' rm $out/share/applications/emacs.desktop ''; -- cgit 1.4.1 From 7777eb3da4de01eda010d3b9a65f59c03969379f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 13 Oct 2018 21:25:03 +0200 Subject: Accounting: remove unused package --- modules/programs/accounting.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/programs/accounting.nix b/modules/programs/accounting.nix index 7c17c14a..e98c3e7e 100644 --- a/modules/programs/accounting.nix +++ b/modules/programs/accounting.nix @@ -1,7 +1,6 @@ { config, pkgs, ... }: { environment.systemPackages = with pkgs; [ - aqbanking ledger bean-add beancount -- cgit 1.4.1 From 38249638e6208c615a3ff8bc8e3b1d27c242a409 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 13 Oct 2018 21:25:51 +0200 Subject: Remove more unused programs --- modules/development/base.nix | 2 -- modules/programs/shell.nix | 6 ------ 2 files changed, 8 deletions(-) diff --git a/modules/development/base.nix b/modules/development/base.nix index a353db62..12145a55 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -7,11 +7,9 @@ gitAndTools.hub editorconfig-core-c - multimarkdown go gocode - surf ldns httping wrk diff --git a/modules/programs/shell.nix b/modules/programs/shell.nix index 33ee27da..b7bbd8fb 100644 --- a/modules/programs/shell.nix +++ b/modules/programs/shell.nix @@ -5,9 +5,6 @@ promptInit = ""; }; programs.bash.enableCompletion = true; - programs.xonsh = { - enable = true; - }; environment.systemPackages = with pkgs; [ vim @@ -19,12 +16,9 @@ htop lsof iftop - iotop nmap - netperf moreutils mtr - psmisc tree zip unzip -- cgit 1.4.1 From 726b9219e5040acde663a5a800f1228ff92140df Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 15 Oct 2018 16:48:08 +0200 Subject: xserver: Use penultimate fontconfig Looks fine. Seems to just work. --- modules/services/xserver.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 701b8348..fd4d52c6 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -39,11 +39,8 @@ sansSerif = [ "Liberation Sans" ]; serif = [ "Liberation Serif" ]; }; - ultimate = { + penultimate = { enable = true; - # presets: - # ultimate1 ultimate2 ultimate3 ultimate4 ultimate5 osx windowsxp - preset = "ultimate2"; }; }; fonts = with pkgs; [ -- cgit 1.4.1 From 64afe906dc73e7cb6f88ab9d52dd1203d06eb5c8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 16 Oct 2018 21:56:48 +0200 Subject: infrastructure: Remove ansible --- modules/programs/infrastructure.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/programs/infrastructure.nix b/modules/programs/infrastructure.nix index b41816e2..5e68bc8a 100644 --- a/modules/programs/infrastructure.nix +++ b/modules/programs/infrastructure.nix @@ -1,7 +1,6 @@ { config, pkgs, ... }: { environment.systemPackages = with pkgs; [ - ansible hugo nixops -- cgit 1.4.1 From 8003056612155a356e50829b998a0436c3d0f3a5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 19 Oct 2018 11:11:51 +0200 Subject: dev: Add git-lfs --- modules/development/base.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/development/base.nix b/modules/development/base.nix index 12145a55..777f8bef 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -5,6 +5,7 @@ gitAndTools.gitFull gitAndTools.git-extras gitAndTools.hub + git-lfs editorconfig-core-c go -- cgit 1.4.1 From 086e0f60c01730cacd716f14115bef99774f6957 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 21 Oct 2018 14:55:27 +0200 Subject: Setup trillian (MacBook) --- modules/development/base.nix | 15 ++++-- modules/development/javascript.nix | 18 +++++--- modules/programs/dotfiles.nix | 9 +++- modules/programs/shell.nix | 10 ++-- trillian.nix | 93 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 129 insertions(+), 16 deletions(-) create mode 100644 trillian.nix diff --git a/modules/development/base.nix b/modules/development/base.nix index 12145a55..b0ab4e3b 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -10,18 +10,23 @@ go gocode - ldns - httping wrk - whois ag ripgrep httpie - http-prompt jq discount - ]; + ] ++ ( + if !stdenv.isDarwin + then [ + whois + ldns + httping + http-prompt + ] else [ + ] + ); } diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 1d25ae85..37b78656 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -2,8 +2,6 @@ { environment.systemPackages = with pkgs.unstable; [ nodejs-8_x - phantomjs2 - yarn nodePackages.tern nodePackages.node2nix @@ -11,13 +9,21 @@ nodePackages.javascript-typescript-langserver nodePackages.eslint_d + nodePackages.node-gyp + nodePackages.node-gyp-build + nodePackages.node-pre-gyp + ] ++ ( + if stdenv.isDarwin + then + [ + ] + else + [ # npm install may use any of these binutils gcc gnumake python2 - nodePackages.node-gyp - nodePackages.node-gyp-build - nodePackages.node-pre-gyp - ]; + ] + ); } diff --git a/modules/programs/dotfiles.nix b/modules/programs/dotfiles.nix index 467665ff..2e3f44aa 100644 --- a/modules/programs/dotfiles.nix +++ b/modules/programs/dotfiles.nix @@ -1,9 +1,14 @@ { config, pkgs, ... }: { environment.systemPackages = with pkgs; [ - git stow fzf ghq - ]; + ] ++ ( + if stdenv.isDarwin + then [ + ] else [ + git + ] + ); } diff --git a/modules/programs/shell.nix b/modules/programs/shell.nix index b7bbd8fb..d59f9fb5 100644 --- a/modules/programs/shell.nix +++ b/modules/programs/shell.nix @@ -5,9 +5,9 @@ promptInit = ""; }; programs.bash.enableCompletion = true; + programs.vim.enable = pkgs.stdenv.isDarwin; environment.systemPackages = with pkgs; [ - vim pv fd entr @@ -23,7 +23,11 @@ zip unzip telnet - + ] ++ ( + if !stdenv.isDarwin + then [ + vim unar - ]; + ] else [ + ]); } diff --git a/trillian.nix b/trillian.nix new file mode 100644 index 00000000..07bcb5de --- /dev/null +++ b/trillian.nix @@ -0,0 +1,93 @@ +{ config, pkgs, ... }: + +let emacsPackage = import ./packages/emacs.nix { + inherit pkgs; + emacs = pkgs.emacs25Macport; +}; +in +{ + imports = [ + ./modules/development/base.nix + ./modules/development/javascript.nix + ./modules/programs/accounting.nix + ./modules/programs/dotfiles.nix + ./modules/programs/shell.nix + ]; + + nixpkgs.config = { + packageOverrides = pkgs: { + unstable = pkgs; + }; + }; + + networking = { + hostName = "trillian"; + knownNetworkServices = [ "Wi-Fi" ]; + dns = [ + "2606:4700:4700::1001" + "2606:4700:4700::1111" + "1.0.0.1" + "1.1.1.1" + ]; + }; + + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = with pkgs; + [ + mosh + emacsPackage + ]; + + # Use a custom configuration.nix location. + # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix + # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix"; + + # Auto upgrade nix package and the daemon service. + services.nix-daemon.enable = true; + services.nix-daemon.enableSocketListener = true; + # nix.package = pkgs.nix; + + # programs.nix-index.enable = true; + + programs.vim = { + enable = true; + enableSensible = true; + }; + + # Create /etc/bashrc that loads the nix-darwin environment. + programs.bash.enable = true; + programs.zsh.enable = true; + programs.fish.enable = true; + + programs.gnupg = { + agent = { + enable = true; + enableSSHSupport = false; + }; + }; + + # launchd.user.agents.emacs-daemon = { + # command = "${emacsPackage}/bin/emacs --daemon"; + # serviceConfig = { + # KeepAlive = true; + # }; + # }; + # + nix.gc = { + automatic = true; + options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))"; + }; + nix.daemonNiceLevel = 10; + nix.daemonIONice = true; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 3; + + # You should generally set this to the total number of logical cores in your system. + # $ sysctl -n hw.ncpu + nix.maxJobs = 2; + nix.buildCores = 4; +} +# vim: sw=2 sts=2 expandtab autoindent smarttab -- cgit 1.4.1 From d2c76a7b484ff11dc9a19a3e1c56bd71e9fc725f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 22 Oct 2018 19:42:04 +0200 Subject: trillian: Fix terminal locale --- trillian.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trillian.nix b/trillian.nix index 07bcb5de..c2fc05e3 100644 --- a/trillian.nix +++ b/trillian.nix @@ -60,6 +60,8 @@ in programs.zsh.enable = true; programs.fish.enable = true; + environment.variables.LANG = "en_GB.UTF-8"; + programs.gnupg = { agent = { enable = true; -- cgit 1.4.1 From 460eae59fd62fbc8430b5e34bb6c82afcd71a568 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 14 Nov 2018 15:43:48 +0100 Subject: Remove TLP battery config --- modules/hardware/thinkpad.nix | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modules/hardware/thinkpad.nix b/modules/hardware/thinkpad.nix index 0d2a1eed..903e819b 100644 --- a/modules/hardware/thinkpad.nix +++ b/modules/hardware/thinkpad.nix @@ -17,14 +17,6 @@ services.tlp = { enable = true; - extraConfig = '' - # Newer Thinkpads have a battery firmware - # it conflicts with TLP if stop thresholds are set - # START_CHARGE_THRESH_BAT0=70 - # STOP_CHARGE_THRESH_BAT0=80 - # START_CHARGE_THRESH_BAT1=70 - # STOP_CHARGE_THRESH_BAT1=80 - ''; }; imports = [ -- cgit 1.4.1 From 83cecc19118a232825bea1d54d81dc6c1400552e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 14 Nov 2018 15:56:02 +0100 Subject: shell: fix darwin check --- modules/programs/shell.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/shell.nix b/modules/programs/shell.nix index d59f9fb5..ab55e0c4 100644 --- a/modules/programs/shell.nix +++ b/modules/programs/shell.nix @@ -5,7 +5,9 @@ promptInit = ""; }; programs.bash.enableCompletion = true; - programs.vim.enable = pkgs.stdenv.isDarwin; + programs.vim = pkgs.lib.attrsets.optionalAttrs pkgs.stdenv.isDarwin { + enable = true; + }; environment.systemPackages = with pkgs; [ pv -- cgit 1.4.1 From 300bca067cdeadcae0ef5fc10e870358aaf76bda Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 14 Nov 2018 22:29:54 +0100 Subject: trillian: Install aspell --- trillian.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trillian.nix b/trillian.nix index c2fc05e3..d9354717 100644 --- a/trillian.nix +++ b/trillian.nix @@ -37,6 +37,8 @@ in [ mosh emacsPackage + aspell + aspellDicts.en ]; # Use a custom configuration.nix location. -- cgit 1.4.1 From 7d36785ec81a2ce337512816ec5c75273bf969b4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 22 Nov 2018 16:16:23 +0100 Subject: T470s: Use reasonable temperature sensor --- modules/machines/t470s.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index d729beac..844a4f57 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -7,6 +7,10 @@ boot.kernelPackages = pkgs.linuxPackages_4_18; + services.thinkfan.sensors = '' + hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input + ''; + systemd.services.ModemManager.enable = true; hardware.pulseaudio.extraConfig = '' -- cgit 1.4.1 From 594de27ef6882766a1673660d61c4c2fc7bc1fa1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 27 Nov 2018 15:34:48 +0100 Subject: SatoshiPay: update package list --- modules/satoshipay.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 75a04078..fdc3532b 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -26,7 +26,6 @@ openssl google-chrome docker_compose - meteor minikube mongodb-tools s3cmd @@ -35,7 +34,7 @@ unstable.kubernetes unstable.redis-desktop-manager unstable.kubernetes-helm - unstable.kompose + unstable.helmfile unstable.robo3t unstable.slack ]; -- cgit 1.4.1 From 7a69a1c482830adb17a3be73d437c6d8f54183a2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 11 Dec 2018 15:54:22 +0100 Subject: SatoshiPay: remove virtualbox --- modules/satoshipay.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index fdc3532b..1733123a 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -12,12 +12,6 @@ enable = true; }; }; - - virtualbox = { - host = { - enable = true; - }; - }; }; nixpkgs.config.allowUnfree = true; -- cgit 1.4.1 From 702b3985219e6b1c0d4a7316a87b142c9218c16a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 11 Dec 2018 15:57:01 +0100 Subject: SatoshiPay: remove minikube --- modules/satoshipay.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 1733123a..7f1b0c71 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -20,7 +20,6 @@ openssl google-chrome docker_compose - minikube mongodb-tools s3cmd sops -- cgit 1.4.1 From a17c83e793f0234f6cff02726c9b7d53b92a3304 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 7 Jan 2019 15:45:59 +0100 Subject: javascript: Update to node 10 --- modules/development/javascript.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 37b78656..7e9dcfb4 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -1,17 +1,17 @@ { config, pkgs, ... }: { environment.systemPackages = with pkgs.unstable; [ - nodejs-8_x + nodejs-10_x - nodePackages.tern - nodePackages.node2nix - nodePackages.nodemon - nodePackages.javascript-typescript-langserver - nodePackages.eslint_d + nodePackages_10_x.tern + nodePackages_10_x.node2nix + nodePackages_10_x.nodemon + nodePackages_10_x.javascript-typescript-langserver + nodePackages_10_x.eslint_d - nodePackages.node-gyp - nodePackages.node-gyp-build - nodePackages.node-pre-gyp + nodePackages_10_x.node-gyp + nodePackages_10_x.node-gyp-build + nodePackages_10_x.node-pre-gyp ] ++ ( if stdenv.isDarwin then -- cgit 1.4.1 From d300ba19bdff556ba765a5ff6d7101bf27265271 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 7 Jan 2019 15:46:17 +0100 Subject: satoshipay: Install kubectx --- modules/satoshipay.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 7f1b0c71..46cccc75 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -25,6 +25,7 @@ sops unstable.google-cloud-sdk unstable.kubernetes + unstable.kubectx unstable.redis-desktop-manager unstable.kubernetes-helm unstable.helmfile -- cgit 1.4.1 From 837b394c5eec1bf3b7cb92b8a5b1f5a76eb82802 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 7 Jan 2019 15:46:54 +0100 Subject: xserver: Tweak font rendering I have no idea what I'm doing, but this seems to look nice, even if it's not like macOS. --- modules/services/xserver.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index fd4d52c6..36790fe0 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -40,7 +40,11 @@ serif = [ "Liberation Serif" ]; }; penultimate = { + enable = false; + }; + ultimate = { enable = true; + preset = "osx"; }; }; fonts = with pkgs; [ -- cgit 1.4.1 From 89667596a464800efcbcc7fca223f32a206102d5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 15 Jan 2019 11:04:37 +0100 Subject: Remove calibre --- modules/user-interface.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 5793a124..6ece6729 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -34,7 +34,6 @@ in unstable.pass-otp - calibre mpv mosh -- cgit 1.4.1 From 828aa5453eb7301367d252ff839b38e01e3047a1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 15 Jan 2019 11:04:52 +0100 Subject: Add kubernetes module for local infrastructure work --- modules/development/kubernetes.nix | 21 +++++++++++++++++++++ satoshipad.nix | 1 + 2 files changed, 22 insertions(+) create mode 100644 modules/development/kubernetes.nix diff --git a/modules/development/kubernetes.nix b/modules/development/kubernetes.nix new file mode 100644 index 00000000..692e46d6 --- /dev/null +++ b/modules/development/kubernetes.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: + +{ + networking.bridges = { + cbr0.interfaces = []; + }; + networking.interfaces = { + cbr0 = { + ipv4.addresses = [ + { address = "10.10.0.1"; + prefixLength = 24; + } + ]; + }; + }; + services.kubernetes.roles = ["master" "node"]; + services.kubernetes.kubelet.extraOpts = "--fail-swap-on=false"; + virtualisation.docker.extraOptions = '' + --iptables=false --ip-masq=false -b cbr0 + ''; +} diff --git a/satoshipad.nix b/satoshipad.nix index 68a9d683..e4a82246 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -13,6 +13,7 @@ ./modules/development/base.nix ./modules/development/javascript.nix ./modules/development/lisp.nix + ./modules/development/kubernetes.nix ./modules/hardware/adb.nix ./modules/hardware/audio.nix ./modules/hardware/systemd-boot.nix -- cgit 1.4.1 From 69bbccdeed216b30272e1e8a8a049987db44c6be Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 15 Jan 2019 11:05:28 +0100 Subject: SatoshiPay: init replicaset at startup --- modules/satoshipay.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 46cccc75..5198cc14 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -46,6 +46,17 @@ OnActiveSec = "1 min"; }; }; + systemd.services.mongodb-init = { + description = "Init mongodb replicaset"; + requires = [ "mongodb.service" ]; + script = "${pkgs.mongodb}/bin/mongo --eval 'rs.initiate()'"; + }; + systemd.timers.mongodb-init = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "2 min"; + }; + }; services.redis = { enable = true; -- cgit 1.4.1 From 24d018aae43738aae766dc9932c07f16ffb451b8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 28 Jan 2019 10:49:19 +0000 Subject: trillian: Use nixpkgs-unstable for newest emacs-macport --- trillian.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/trillian.nix b/trillian.nix index d9354717..01fd67b0 100644 --- a/trillian.nix +++ b/trillian.nix @@ -1,8 +1,8 @@ { config, pkgs, ... }: let emacsPackage = import ./packages/emacs.nix { - inherit pkgs; - emacs = pkgs.emacs25Macport; + pkgs = pkgs.unstable; + emacs = pkgs.emacsMacport; }; in { @@ -16,7 +16,9 @@ in nixpkgs.config = { packageOverrides = pkgs: { - unstable = pkgs; + unstable = import { + config = config.nixpkgs.config; + }; }; }; -- cgit 1.4.1 From 727dfcc3eff33f8fe422a82a1b3ff3ffe4a80073 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 4 Feb 2019 09:59:11 +0000 Subject: Update javascript setup --- modules/development/javascript.nix | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 7e9dcfb4..5262feee 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -1,17 +1,22 @@ { config, pkgs, ... }: +let + node = pkgs.unstable.nodejs-10_x; + npmPackages = pkgs.unstable.nodePackages_10_x; +in { environment.systemPackages = with pkgs.unstable; [ - nodejs-10_x + node - nodePackages_10_x.tern - nodePackages_10_x.node2nix - nodePackages_10_x.nodemon - nodePackages_10_x.javascript-typescript-langserver - nodePackages_10_x.eslint_d + npmPackages.node-gyp + npmPackages.node-gyp-build + npmPackages.node-pre-gyp + + npmPackages.tern + npmPackages.node2nix + npmPackages.nodemon + npmPackages.javascript-typescript-langserver + npmPackages.eslint_d - nodePackages_10_x.node-gyp - nodePackages_10_x.node-gyp-build - nodePackages_10_x.node-pre-gyp ] ++ ( if stdenv.isDarwin then -- cgit 1.4.1 From 0dd02abf123030a3372db808560392ce9bca1fbe Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 4 Feb 2019 09:59:34 +0000 Subject: Remove deprecated lsp-javascript-typescript --- packages/emacs.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index dc99878c..41e283f9 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -91,7 +91,6 @@ in # kubernetes # kubernetes-evil ledger-mode - lsp-javascript-typescript lsp-mode lsp-ui magit -- cgit 1.4.1 From 267d14631b2739589a8e47dd26dc69ac6a6e18d8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 4 Feb 2019 15:12:03 +0000 Subject: trillian: add quad9 DNS servers --- trillian.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trillian.nix b/trillian.nix index 01fd67b0..e259fc16 100644 --- a/trillian.nix +++ b/trillian.nix @@ -26,8 +26,12 @@ in hostName = "trillian"; knownNetworkServices = [ "Wi-Fi" ]; dns = [ + "2620:fe::fe" + "2620:fe::9" "2606:4700:4700::1001" "2606:4700:4700::1111" + "9.9.9.9" + "149.112.112.112" "1.0.0.1" "1.1.1.1" ]; -- cgit 1.4.1 From f23cc53573ae9c70fd628fb473d8267c8bfccd7d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 19 Feb 2019 14:52:39 +0000 Subject: trillian: Import private configuration --- trillian.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trillian.nix b/trillian.nix index e259fc16..1ffb8c76 100644 --- a/trillian.nix +++ b/trillian.nix @@ -7,6 +7,8 @@ let emacsPackage = import ./packages/emacs.nix { in { imports = [ + ./private/default.nix + ./modules/development/base.nix ./modules/development/javascript.nix ./modules/programs/accounting.nix -- cgit 1.4.1 From 56f5b23cc3062f91dd87b39e879515f7b4d3aa39 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 26 Mar 2019 12:37:17 +0100 Subject: laptop: reduce password prompts after hibernation --- modules/hardware/laptop.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index c6628855..a1d27ee4 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -38,7 +38,11 @@ IdleActionSec=600 ''; - services.physlock.enable = true; + services.physlock = { + enable = true; + # Already need to enter disk encryption password + lockOn.hibernate = false; + }; services.tlp = { enable = true; -- cgit 1.4.1 From c208816f345531ee86486c82cb9c543bbdf08d71 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 26 Mar 2019 12:38:01 +0100 Subject: T470s: use default kernel It is recent enough now --- modules/machines/t470s.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 844a4f57..623250ad 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -5,8 +5,6 @@ firmwareLinuxNonfree ]; - boot.kernelPackages = pkgs.linuxPackages_4_18; - services.thinkfan.sensors = '' hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input ''; -- cgit 1.4.1 From 41ab368a97f65215b47f1d1bad30e55faae40976 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 29 Mar 2019 15:37:36 +0100 Subject: Remove e-mail setup --- modules/user-interface.nix | 5 ----- packages/emacs.nix | 3 --- 2 files changed, 8 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 6ece6729..b9c7655e 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -25,11 +25,6 @@ in lxappearance - offlineimap - isync - mu - msmtp - weechat unstable.pass-otp diff --git a/packages/emacs.nix b/packages/emacs.nix index 41e283f9..52f4191f 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -56,7 +56,6 @@ in evil-commentary evil-leader evil-magit - evil-mu4e evil-org evil-quickscope evil-snipe @@ -140,6 +139,4 @@ in epkgs.hook-helpers epkgs.dired-du # From main packages set - - pkgs.mu ]) -- cgit 1.4.1 From 25fcbb1f62f5f05708f0f402f1c13c08861e009f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 9 Apr 2019 13:52:06 +0200 Subject: Emacs: install feature-mode --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 52f4191f..56ec53a4 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -63,6 +63,7 @@ in evil-surround exec-path-from-shell eyebrowse + feature-mode flycheck flycheck-pos-tip flycheck-vale -- cgit 1.4.1 From 4e042d8d8b7b6487cfb71ead538962bbe655df9f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 9 Apr 2019 16:51:41 +0200 Subject: Satoshipad: remove Syncthing --- satoshipad.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/satoshipad.nix b/satoshipad.nix index e4a82246..b2252298 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -13,7 +13,6 @@ ./modules/development/base.nix ./modules/development/javascript.nix ./modules/development/lisp.nix - ./modules/development/kubernetes.nix ./modules/hardware/adb.nix ./modules/hardware/audio.nix ./modules/hardware/systemd-boot.nix @@ -26,13 +25,13 @@ ./modules/machines/t470s.nix ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix + ./modules/programs/mate.nix ./modules/programs/i3.nix ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix ./modules/programs/shell.nix ./modules/programs/wine.nix ./modules/satoshipay.nix - ./modules/services/syncthing.nix ]; boot.initrd.luks.devices = [ -- cgit 1.4.1 From ec9bc1e0a592573a258ddad616a9869fe5062109 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 16 Apr 2019 15:30:47 +0200 Subject: Update to 19.03 --- modules/services/xserver.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 36790fe0..041d10fa 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -61,10 +61,11 @@ fira-mono go-font font-awesome-ttf - font-droid liberation_ttf mononoki opensans-ttf + roboto + roboto-mono paratype-pt-mono paratype-pt-sans paratype-pt-serif -- cgit 1.4.1 From 53ff00ce12bc69e3b15eec3b70ca9ee555decb0c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 16 Apr 2019 15:31:10 +0200 Subject: javascript: add yarn --- modules/development/javascript.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 5262feee..23a464e1 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -16,6 +16,7 @@ in npmPackages.nodemon npmPackages.javascript-typescript-langserver npmPackages.eslint_d + npmPackages.yarn ] ++ ( if stdenv.isDarwin -- cgit 1.4.1 From c910fc503263109cfe9483a0f1682dde48b852e1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 7 May 2019 17:15:39 +0200 Subject: nix: auto-update unstable packages in configuration --- modules/configuration/nix.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/configuration/nix.nix b/modules/configuration/nix.nix index 75c3486d..1a064303 100644 --- a/modules/configuration/nix.nix +++ b/modules/configuration/nix.nix @@ -27,7 +27,8 @@ }; systemd.services.nixos-upgrade = { script = pkgs.lib.mkForce '' - ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} + ${pkgs.nix}/bin/nix-channel --update nixos-unstable + ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --upgrade ${toString config.system.autoUpgrade.flags} ''; }; } -- cgit 1.4.1 From d0a81c0741d764d478e7b2bb93df7487ef5abed8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 7 May 2019 17:16:31 +0200 Subject: ui: switch to termite --- modules/user-interface.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index b9c7655e..0b665db4 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -21,7 +21,7 @@ in epdfview geeqie - mlterm + termite lxappearance @@ -51,7 +51,7 @@ in services.devmon.enable = true; - environment.sessionVariables.TERMINAL = "mlterm"; + environment.sessionVariables.TERMINAL = "termite"; services.nscd.enable = true; systemd.services.nscd.wantedBy = lib.mkForce []; -- cgit 1.4.1 From 3e9444b97111f5c4debfb27af1d2323d969c87ae Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 7 May 2019 17:16:45 +0200 Subject: intel: prefer modesetting driver --- modules/hardware/intel-gpu.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hardware/intel-gpu.nix b/modules/hardware/intel-gpu.nix index 593a06f0..804e1e62 100644 --- a/modules/hardware/intel-gpu.nix +++ b/modules/hardware/intel-gpu.nix @@ -6,7 +6,7 @@ libvdpau-va-gl ]; - services.xserver.videoDrivers = [ "intel" ]; + services.xserver.videoDrivers = [ "modesetting" "intel" ]; boot.earlyVconsoleSetup = true; boot.initrd.kernelModules = [ -- cgit 1.4.1 From 8b32cd4dd139278a88548ba638e49ae9b8fa0d55 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 7 May 2019 17:17:13 +0200 Subject: remove mate --- satoshipad.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index b2252298..528f20f8 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -25,7 +25,6 @@ ./modules/machines/t470s.nix ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix - ./modules/programs/mate.nix ./modules/programs/i3.nix ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix -- cgit 1.4.1 From a45b30890b61b21bc32d6ccfacf5b4a04b5a6c38 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 16 May 2019 15:47:15 +0200 Subject: Emacs: Install caddyfile-mode --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 56ec53a4..14b3dd43 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -21,6 +21,7 @@ in avy bbdb bind-key + caddyfile-mode cider clj-refactor clojure-mode -- cgit 1.4.1 From 95fc1892ad44ac0433330d26eb5354840e078705 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 22 May 2019 11:52:05 +0200 Subject: SatoshiPay: remove unused printer driver --- modules/satoshipay.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 5198cc14..011c563d 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -72,13 +72,6 @@ services.printing.drivers = with pkgs; [ - (cups-toshiba-estudio.overrideAttrs (oldAttrs: { - version = "7.89"; - src = pkgs.fetchurl { - url = http://business.toshiba.com/downloads/KB/f1Ulds/15178/TOSHIBA_ColorMFP_CUPS.tar; - sha256 = "0qz4r7q55i0adf4fv3aqnfqgi2pz3jb1jixkqm9x6nk4vanyjf4r"; - }; - })) ]; networking.domain = "satoshipay.io"; -- cgit 1.4.1 From d3fdee22c4c7b4edd77791b31277296bd9c5714e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 22 May 2019 11:52:24 +0200 Subject: Remove unused packages --- modules/user-interface.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 0b665db4..cace67d9 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -15,9 +15,6 @@ in firefox pcmanfm - fish - ncdu - epdfview geeqie @@ -38,7 +35,6 @@ in cifs-utils hexchat signal-desktop - nextcloud-client trash-cli ]; -- cgit 1.4.1 From 65d9fc0235e6826fd96dc4985f576ede143ac654 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 22 May 2019 11:56:07 +0200 Subject: Add/remove packages --- modules/development/base.nix | 4 +--- modules/development/javascript.nix | 2 ++ modules/programs/shell.nix | 3 +-- modules/satoshipay.nix | 4 ++++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/development/base.nix b/modules/development/base.nix index 5c474ac4..0d7520bf 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -1,15 +1,13 @@ { config, pkgs, ... }: { environment.systemPackages = with pkgs; [ - mercurial gitAndTools.gitFull gitAndTools.git-extras - gitAndTools.hub git-lfs + checkbashisms editorconfig-core-c go - gocode wrk diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 23a464e1..3e4a8926 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -17,6 +17,8 @@ in npmPackages.javascript-typescript-langserver npmPackages.eslint_d npmPackages.yarn + npmPackages.prettier + npmPackages.pnpm ] ++ ( if stdenv.isDarwin diff --git a/modules/programs/shell.nix b/modules/programs/shell.nix index ab55e0c4..cf36a115 100644 --- a/modules/programs/shell.nix +++ b/modules/programs/shell.nix @@ -12,8 +12,8 @@ environment.systemPackages = with pkgs; [ pv fd + unstable.sd entr - exa file htop lsof @@ -23,7 +23,6 @@ mtr tree zip - unzip telnet ] ++ ( if !stdenv.isDarwin diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 011c563d..513f4269 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -17,10 +17,14 @@ nixpkgs.config.allowUnfree = true; environment.systemPackages = with pkgs; [ + awscli + caddy openssl google-chrome docker_compose mongodb-tools + pgadmin + pgcli s3cmd sops unstable.google-cloud-sdk -- cgit 1.4.1 From b8f11db00e56bdbe72d28227c389a09e486f2217 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 23 May 2019 10:54:02 +0200 Subject: Split nitrokey and GnuPG setup --- modules/hardware/nitrokey.nix | 35 +---------------------------------- modules/programs/gnupg.nix | 40 ++++++++++++++++++++++++++++++++++++++++ satoshipad.nix | 1 + 3 files changed, 42 insertions(+), 34 deletions(-) create mode 100644 modules/programs/gnupg.nix diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix index 3837f6f3..a77ce00c 100644 --- a/modules/hardware/nitrokey.nix +++ b/modules/hardware/nitrokey.nix @@ -1,46 +1,13 @@ { config, pkgs, lib, ... }: -{ programs.ssh.startAgent = false; - - programs.gnupg = { - agent = { - enable = true; - enableSSHSupport = true; - }; - dirmngr.enable = true; - }; - +{ hardware.nitrokey = { enable = true; }; services.pcscd.enable = true; - services.keybase.enable = true; - services.kbfs.enable = true; - environment.variables.NIX_SKIP_KEYBASE_CHECKS = "1"; - - services.tor = { - enable = true; - client = { - enable = true; - socksListenAddress = "9050 IPv6Traffic"; - }; - torsocks = { - enable = true; - }; - }; - systemd.services.tor.wantedBy = lib.mkForce []; - systemd.timers.tor = { - description = "Delayed startup of Tor"; - wantedBy = [ "timers.target" ]; - timerConfig = { - OnActiveSec = "1 min"; - }; - }; environment.systemPackages = with pkgs; [ - gnupg nitrokey-app - keybase-gui ]; } diff --git a/modules/programs/gnupg.nix b/modules/programs/gnupg.nix new file mode 100644 index 00000000..af500780 --- /dev/null +++ b/modules/programs/gnupg.nix @@ -0,0 +1,40 @@ +{ config, pkgs, lib, ... }: + +{ programs.ssh.startAgent = false; + + programs.gnupg = { + agent = { + enable = true; + enableSSHSupport = true; + }; + dirmngr.enable = true; + }; + + services.keybase.enable = true; + services.kbfs.enable = true; + environment.variables.NIX_SKIP_KEYBASE_CHECKS = "1"; + + services.tor = { + enable = true; + client = { + enable = true; + socksListenAddress = "9050 IPv6Traffic"; + }; + torsocks = { + enable = true; + }; + }; + systemd.services.tor.wantedBy = lib.mkForce []; + systemd.timers.tor = { + description = "Delayed startup of Tor"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; + }; + + environment.systemPackages = with pkgs; [ + gnupg + keybase-gui + ]; +} diff --git a/satoshipad.nix b/satoshipad.nix index 528f20f8..a68848c4 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -25,6 +25,7 @@ ./modules/machines/t470s.nix ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix + ./modules/programs/gnupg.nix ./modules/programs/i3.nix ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix -- cgit 1.4.1 From 50c50c72354d079ef1a96e6415407da20808a6b8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 23 May 2019 10:54:17 +0200 Subject: Update Trezor setup --- modules/hardware/trezor.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/hardware/trezor.nix b/modules/hardware/trezor.nix index ad938e9a..ff1f8e38 100644 --- a/modules/hardware/trezor.nix +++ b/modules/hardware/trezor.nix @@ -1,4 +1,14 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: { services.trezord.enable = true; + environment.systemPackages = with pkgs; [ + gnupg + pinentry + (python3.withPackages(ps: with ps; [ trezor_agent wheel ])) + ]; + environment.variables.GNUPGHOME = "$HOME/.gnupg/trezor/"; + programs.gnupg.agent = { + enable = lib.mkForce false; + enableSSHSupport = lib.mkForce false; + }; } -- cgit 1.4.1 From d23fb647b7abdd5a1676cf0091b43de1d1ea2218 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 23 May 2019 10:54:25 +0200 Subject: Enable Trezor on SatoshiPad --- satoshipad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/satoshipad.nix b/satoshipad.nix index a68848c4..e84b8646 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -22,6 +22,7 @@ ./modules/hardware/printing.nix ./modules/hardware/qwerty.nix ./modules/hardware/trackball.nix + ./modules/hardware/trezor.nix ./modules/machines/t470s.nix ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix -- cgit 1.4.1 From 29b593e4c41d0edd742fc91c96477553a574fba3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 23 May 2019 12:54:32 +0200 Subject: Intel: Don't prefer modesetting driver Screen tearing, different monitor names, panned login screen --- modules/hardware/intel-gpu.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hardware/intel-gpu.nix b/modules/hardware/intel-gpu.nix index 804e1e62..6e0c2073 100644 --- a/modules/hardware/intel-gpu.nix +++ b/modules/hardware/intel-gpu.nix @@ -6,7 +6,7 @@ libvdpau-va-gl ]; - services.xserver.videoDrivers = [ "modesetting" "intel" ]; + services.xserver.videoDrivers = [ "intel" "modesetting" ]; boot.earlyVconsoleSetup = true; boot.initrd.kernelModules = [ -- cgit 1.4.1 From 8e02e85ab38a2e10e0272710b0af0018db43735e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 27 May 2019 15:44:06 +0200 Subject: Update Emacs packages --- packages/emacs.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 14b3dd43..b6a93f6d 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -34,6 +34,7 @@ in company-tern company-web counsel + counsel-etags counsel-projectile crux cyphejor @@ -96,8 +97,10 @@ in lsp-ui magit markdown-mode + minions mocha monotropic-theme + moody nginx-mode nix-mode nix-sandbox @@ -120,7 +123,6 @@ in slime smart-tabs-mode smex - spaceline spacemacs-theme swiper tern -- cgit 1.4.1 From ff015ad60ac5148715730688c537e037e2d3aa27 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 27 May 2019 16:33:14 +0200 Subject: Emacs: Update packages --- packages/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index b6a93f6d..42b40f83 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -39,7 +39,6 @@ in crux cyphejor define-word - diminish dired-subtree discover-my-major discover-js2-refactor @@ -90,6 +89,7 @@ in js2-mode js2-refactor json-mode + k8s-mode # kubernetes # kubernetes-evil ledger-mode -- cgit 1.4.1 From dfada4ad3353564b2f99474a4a2872aedf4a2bfd Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 27 May 2019 16:33:57 +0200 Subject: satoshipay: replace google-chrome with chromium --- modules/satoshipay.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 513f4269..78305873 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -20,7 +20,7 @@ awscli caddy openssl - google-chrome + chromium docker_compose mongodb-tools pgadmin -- cgit 1.4.1 From 3afe52a135a0ccee881e487fe3310f31ec62cf27 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 27 May 2019 16:34:38 +0200 Subject: satoshipay: Add chromium policy configuration --- modules/satoshipay.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 78305873..7ac6cdb1 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -16,6 +16,43 @@ nixpkgs.config.allowUnfree = true; + programs.chromium = { + enable = true; + extensions = [ + "cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin + "aeblfdkhhhdcdjpifhhbdiojplfjncoa" # 1password x + ]; + homepageLocation = "about:blank"; + defaultSearchProviderSearchURL = "https://duckduckgo.com/?q={searchTerms}"; + defaultSearchProviderSuggestURL = "https://duckduckgo.com/ac/?q={searchTerms}&type=list"; + # https://www.chromium.org/administrators/policy-list-3 + extraOpts = { + BlockThirdPartyCookies = true; + CookiesBlockedForUrls = [ + "[*.]smartlock.google.com" + "[*.]mediumSmartLockSigninAllowed.com" + ]; + SyncDisabled = true; + BuiltInDnsClientEnabled = false; + BrowserSignin = 0; + EasyUnlockAllowed = false; + EnableMediaRouter = false; + CloudPrintProxyEnabled = false; + CloudPrintSubmitEnabled = false; + SafeBrowsingEnabled = false; + RestoreOnStartup = 1; # Restore last session + AlwaysOpenPdfExternally = true; + BrowserNetworkTimeQueriesEnabled = false; + NotificationsAllowedForUrls = [ + "gitlab.satoshipay.tech" + "calendar.google.com" + ]; + NotificationsBlockedForUrls = [ + "[.*]reddit.com" + ]; + }; + }; + environment.systemPackages = with pkgs; [ awscli caddy -- cgit 1.4.1 From f4151d71e78bbabef8a832f2bd07238ac910f851 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 27 May 2019 16:36:46 +0200 Subject: T470s: Send all temp data to thinkfan --- modules/machines/t470s.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 623250ad..842b556e 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -6,7 +6,11 @@ ]; services.thinkfan.sensors = '' + hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_input hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input + hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input + hwmon /sys/devices/virtual/thermal/thermal_zone0/hwmon2/temp1_input + hwmon /sys/devices/virtual/thermal/thermal_zone1/hwmon3/temp1_input ''; systemd.services.ModemManager.enable = true; -- cgit 1.4.1 From 178624f221f3074e7083c1a5e91d1c4f92d4f576 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 28 May 2019 09:58:21 +0200 Subject: satoshipad: remove adb --- satoshipad.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index e84b8646..69b9abcb 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -13,7 +13,6 @@ ./modules/development/base.nix ./modules/development/javascript.nix ./modules/development/lisp.nix - ./modules/hardware/adb.nix ./modules/hardware/audio.nix ./modules/hardware/systemd-boot.nix ./modules/hardware/keyboardio-model01.nix -- cgit 1.4.1 From 36f72a74c3fd35799378279fc7473e2db3929d9f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 3 Jun 2019 18:07:12 +0200 Subject: t470s: tweak thinkfan levels --- modules/machines/t470s.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 842b556e..1bffb4c6 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -12,6 +12,15 @@ hwmon /sys/devices/virtual/thermal/thermal_zone0/hwmon2/temp1_input hwmon /sys/devices/virtual/thermal/thermal_zone1/hwmon3/temp1_input ''; + services.thinkfan.levels = '' + (0, 0, 48) + (1, 45, 52) + (2, 50, 57) + (3, 55, 63) + (6, 60, 65) + (7, 60, 85) + (127, 80, 32767) + ''; systemd.services.ModemManager.enable = true; -- cgit 1.4.1 From 6fe33dc41c20bf0838eb0e40ed3a3d17ba58d44c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 3 Jun 2019 18:07:35 +0200 Subject: satoshipad: remove nitrokey setup --- satoshipad.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 69b9abcb..3f21943c 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -17,7 +17,6 @@ ./modules/hardware/systemd-boot.nix ./modules/hardware/keyboardio-model01.nix ./modules/hardware/network-manager.nix - ./modules/hardware/nitrokey.nix ./modules/hardware/printing.nix ./modules/hardware/qwerty.nix ./modules/hardware/trackball.nix -- cgit 1.4.1 From 7e6f5a6d6f329c890a4259b03dbeded189580003 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 3 Jun 2019 18:07:45 +0200 Subject: Optimise Intel GPU setup --- modules/hardware/intel-gpu.nix | 5 ----- modules/machines/t470s.nix | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/hardware/intel-gpu.nix b/modules/hardware/intel-gpu.nix index 6e0c2073..fc6b6fa3 100644 --- a/modules/hardware/intel-gpu.nix +++ b/modules/hardware/intel-gpu.nix @@ -11,10 +11,5 @@ boot.earlyVconsoleSetup = true; boot.initrd.kernelModules = [ "i915" - "intel_agp" - ]; - boot.kernelModules = pkgs.lib.mkBefore [ - "i915" - "intel_agp" ]; } diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 1bffb4c6..81a889e8 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -22,6 +22,12 @@ (127, 80, 32767) ''; + boot.kernelParams = [ + "i915.enable_guc=2" + "i915.enable_fbc=1" + "i915.enable_psr=2" + ]; + systemd.services.ModemManager.enable = true; hardware.pulseaudio.extraConfig = '' -- cgit 1.4.1 From af54fb9ff51211ef2b17b642cfa96efa10445fde Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 5 Jun 2019 21:05:53 +0200 Subject: trillian: Enable completion for nix-darwin commands --- trillian.nix | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/trillian.nix b/trillian.nix index 1ffb8c76..86dc4c47 100644 --- a/trillian.nix +++ b/trillian.nix @@ -47,6 +47,7 @@ in emacsPackage aspell aspellDicts.en + darwin-zsh-completions ]; # Use a custom configuration.nix location. @@ -85,7 +86,7 @@ in # KeepAlive = true; # }; # }; - # + # nix.gc = { automatic = true; options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))"; @@ -93,6 +94,38 @@ in nix.daemonNiceLevel = 10; nix.daemonIONice = true; + nixpkgs.overlays = [ + (self: super: { + darwin-zsh-completions = super.runCommandNoCC "darwin-zsh-completions-0.0.0" + { preferLocalBuild = true; } + '' + mkdir -p $out/share/zsh/site-functions + cat <<-'EOF' > $out/share/zsh/site-functions/_darwin-rebuild + #compdef darwin-rebuild + #autoload + _nix-common-options + local -a _1st_arguments + _1st_arguments=( + 'switch:Build, activate, and update the current generation'\ + 'build:Build without activating or updating the current generation'\ + 'check:Build and run the activation sanity checks'\ + 'changelog:Show most recent entries in the changelog'\ + ) + _arguments \ + '--list-generations[Print a list of all generations in the active profile]'\ + '--rollback[Roll back to the previous configuration]'\ + {--switch-generation,-G}'[Activate specified generation]'\ + '(--profile-name -p)'{--profile-name,-p}'[Profile to use to track current and previous system configurations]:Profile:_nix_profiles'\ + '1:: :->subcmds' && return 0 + case $state in + subcmds) + _describe -t commands 'darwin-rebuild subcommands' _1st_arguments + ;; + esac + EOF + ''; + }) + ]; # Used for backwards compatibility, please read the changelog before changing. # $ darwin-rebuild changelog system.stateVersion = 3; -- cgit 1.4.1 From 1a8a25b7425edf5dcbf23bfbac0530b3ecfa88d0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 5 Jun 2019 21:06:28 +0200 Subject: trillian: Disable bash/fish setup --- trillian.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/trillian.nix b/trillian.nix index 86dc4c47..6383468d 100644 --- a/trillian.nix +++ b/trillian.nix @@ -66,10 +66,8 @@ in enableSensible = true; }; - # Create /etc/bashrc that loads the nix-darwin environment. - programs.bash.enable = true; programs.zsh.enable = true; - programs.fish.enable = true; + programs.zsh.enableBashCompletion = true; environment.variables.LANG = "en_GB.UTF-8"; -- cgit 1.4.1 From c535b89bd84d1c53ce3a3a55848be4341cd736e5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 5 Jun 2019 21:06:44 +0200 Subject: Trillian: activate nix system at startup --- trillian.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trillian.nix b/trillian.nix index 6383468d..ebab80b8 100644 --- a/trillian.nix +++ b/trillian.nix @@ -59,6 +59,8 @@ in services.nix-daemon.enableSocketListener = true; # nix.package = pkgs.nix; + services.activate-system.enable = true; + # programs.nix-index.enable = true; programs.vim = { -- cgit 1.4.1 From 5f000e27702f4aad72ebc80fc3ca540f54d49135 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 5 Jun 2019 21:15:33 +0200 Subject: Trillian: Configure DNS servers on dongle LAN --- trillian.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trillian.nix b/trillian.nix index ebab80b8..1cda75f7 100644 --- a/trillian.nix +++ b/trillian.nix @@ -26,7 +26,7 @@ in networking = { hostName = "trillian"; - knownNetworkServices = [ "Wi-Fi" ]; + knownNetworkServices = [ "Wi-Fi" "USB 10/100/1000 LAN" ]; dns = [ "2620:fe::fe" "2620:fe::9" -- cgit 1.4.1 From 32827c9f15a158877e10bc35e39c73e2e3486a90 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 5 Jun 2019 21:16:13 +0200 Subject: Trillian: use local resolver (dnscrypt-proxy installed via macports) --- trillian.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/trillian.nix b/trillian.nix index 1cda75f7..d8e8ea1b 100644 --- a/trillian.nix +++ b/trillian.nix @@ -28,14 +28,8 @@ in hostName = "trillian"; knownNetworkServices = [ "Wi-Fi" "USB 10/100/1000 LAN" ]; dns = [ - "2620:fe::fe" - "2620:fe::9" - "2606:4700:4700::1001" - "2606:4700:4700::1111" - "9.9.9.9" - "149.112.112.112" - "1.0.0.1" - "1.1.1.1" + "::1" + "127.0.0.1" ]; }; -- cgit 1.4.1 From 006c0cc4659e20e47541657bbd192492c6461aa2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 8 Jun 2019 20:12:46 +0200 Subject: Separate GnuPG, Keybase and Tor --- modules/programs/gnupg.nix | 38 ++++---------------------------------- modules/programs/keybase.nix | 11 +++++++++++ modules/programs/tor.nix | 22 ++++++++++++++++++++++ satoshipad.nix | 2 ++ 4 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 modules/programs/keybase.nix create mode 100644 modules/programs/tor.nix diff --git a/modules/programs/gnupg.nix b/modules/programs/gnupg.nix index af500780..663bcb3c 100644 --- a/modules/programs/gnupg.nix +++ b/modules/programs/gnupg.nix @@ -1,40 +1,10 @@ { config, pkgs, lib, ... }: -{ programs.ssh.startAgent = false; - - programs.gnupg = { - agent = { - enable = true; - enableSSHSupport = true; - }; - dirmngr.enable = true; - }; - - services.keybase.enable = true; - services.kbfs.enable = true; - environment.variables.NIX_SKIP_KEYBASE_CHECKS = "1"; - - services.tor = { - enable = true; - client = { - enable = true; - socksListenAddress = "9050 IPv6Traffic"; - }; - torsocks = { - enable = true; - }; - }; - systemd.services.tor.wantedBy = lib.mkForce []; - systemd.timers.tor = { - description = "Delayed startup of Tor"; - wantedBy = [ "timers.target" ]; - timerConfig = { - OnActiveSec = "1 min"; - }; - }; - +{ environment.systemPackages = with pkgs; [ gnupg - keybase-gui + pinentry + (python3.withPackages(ps: with ps; [ trezor_agent wheel ])) ]; + environment.variables.GNUPGHOME = "$HOME/.gnupg/trezor/"; } diff --git a/modules/programs/keybase.nix b/modules/programs/keybase.nix new file mode 100644 index 00000000..39a16b27 --- /dev/null +++ b/modules/programs/keybase.nix @@ -0,0 +1,11 @@ +{ config, pkgs, lib, ... }: + +{ + services.keybase.enable = true; + services.kbfs.enable = true; + environment.variables.NIX_SKIP_KEYBASE_CHECKS = "1"; + + environment.systemPackages = with pkgs; [ + keybase-gui + ]; +} diff --git a/modules/programs/tor.nix b/modules/programs/tor.nix new file mode 100644 index 00000000..5524aede --- /dev/null +++ b/modules/programs/tor.nix @@ -0,0 +1,22 @@ +{ config, pkgs, lib, ... }: + +{ + services.tor = { + enable = true; + client = { + enable = true; + socksListenAddress = "9050 IPv6Traffic"; + }; + torsocks = { + enable = true; + }; + }; + systemd.services.tor.wantedBy = lib.mkForce []; + systemd.timers.tor = { + description = "Delayed startup of Tor"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; + }; +} diff --git a/satoshipad.nix b/satoshipad.nix index 3f21943c..11cd3fc4 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -25,6 +25,8 @@ ./modules/programs/accounting.nix ./modules/programs/dotfiles.nix ./modules/programs/gnupg.nix + ./modules/programs/keybase.nix + ./modules/programs/tor.nix ./modules/programs/i3.nix ./modules/programs/infrastructure.nix ./modules/programs/passwords.nix -- cgit 1.4.1 From e7453ff22b535ae9455e70597489affd4e5aea89 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 16 Jun 2019 23:19:10 +0200 Subject: Redo emacs package setup --- packages/emacs.nix | 66 +++++++++++------------------------------------------- 1 file changed, 13 insertions(+), 53 deletions(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 42b40f83..a2ed3992 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -1,6 +1,6 @@ { - pkgs ? import {}, - emacs ? pkgs.emacs + pkgs ? import {}, + emacs ? pkgs.emacsMacport }: let @@ -16,41 +16,23 @@ in ace-link add-node-modules-path ag - auto-compile + amx auto-async-byte-compile avy - bbdb - bind-key + basic-theme caddyfile-mode - cider - clj-refactor - clojure-mode - cmd-to-echo - command-log-mode company - company-go + company-box company-lsp - company-restclient - company-tern company-web counsel - counsel-etags counsel-projectile crux - cyphejor - define-word - dired-subtree - discover-my-major - discover-js2-refactor docker-compose-mode dockerfile-mode - dtrt-indent - dumb-jump - eacl - easy-hugo editorconfig eink-theme - elisp-slime-nav + eldoc-box emmet-mode evil evil-collection @@ -59,35 +41,27 @@ in evil-magit evil-org evil-quickscope - evil-snipe evil-space evil-surround exec-path-from-shell eyebrowse feature-mode flycheck - flycheck-pos-tip - flycheck-vale - geiser - ggtags - ghq + general git-gutter-fringe git-messenger git-timemachine - go-eldoc - go-mode - go-projectile + gitattributes-mode + gitconfig-mode + gitignore-mode + gitlab-ci-mode + gitlab-ci-mode-flycheck goto-chg haskell-mode - helm helpful - highlight-stages - imenu-anywhere - indium ivy-hydra jinja2-mode js2-mode - js2-refactor json-mode k8s-mode # kubernetes @@ -98,17 +72,14 @@ in magit markdown-mode minions - mocha monotropic-theme moody nginx-mode nix-mode - nix-sandbox org-journal - page-break-lines paredit - password-store php-mode + posframe prettier-js projectile projectile-ripgrep @@ -117,16 +88,9 @@ in restclient ripgrep rjsx-mode - sentence-navigation scss-mode - shrink-whitespace - slime - smart-tabs-mode - smex spacemacs-theme swiper - tern - tide toml-mode typescript-mode undo-tree @@ -138,9 +102,5 @@ in ]) ++ (with epkgs.elpaPackages; [ rainbow-mode ]) ++ [ - epkgs.redshank - - epkgs.hook-helpers - epkgs.dired-du # From main packages set ]) -- cgit 1.4.1 From 2d09ae24c058863da37f2ed0d9a95dd8d9aedc94 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 19 Jun 2019 17:04:03 +0200 Subject: Emacs: install all-the-icons --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index a2ed3992..34c95a8a 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -16,6 +16,7 @@ in ace-link add-node-modules-path ag + all-the-icons amx auto-async-byte-compile avy -- cgit 1.4.1 From 795fa1ad410ab662564f41327db6aef88e4923f3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 19 Jun 2019 17:04:13 +0200 Subject: Emacs: default to non-macport package --- packages/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 34c95a8a..8d6c6d02 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -1,6 +1,6 @@ { pkgs ? import {}, - emacs ? pkgs.emacsMacport + emacs ? pkgs.emacs }: let -- cgit 1.4.1 From dad40027a898b7254f4c6a3da6272dc5ab70f912 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 19 Jun 2019 17:04:32 +0200 Subject: t470s: remove missing hwmon/temp imports They seem to change on boot --- modules/machines/t470s.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 81a889e8..53f8908b 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -9,8 +9,6 @@ hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_input hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input - hwmon /sys/devices/virtual/thermal/thermal_zone0/hwmon2/temp1_input - hwmon /sys/devices/virtual/thermal/thermal_zone1/hwmon3/temp1_input ''; services.thinkfan.levels = '' (0, 0, 48) -- cgit 1.4.1 From 7ebecc0f9ba39299a58b5002792744a28200c227 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 19 Jun 2019 17:05:54 +0200 Subject: Remove chromium --- marvin.nix | 4 ---- modules/development/base.nix | 1 + modules/satoshipay.nix | 38 -------------------------------------- prefect.nix | 4 ---- 4 files changed, 1 insertion(+), 46 deletions(-) diff --git a/marvin.nix b/marvin.nix index 3227fd70..0a7aceb5 100644 --- a/marvin.nix +++ b/marvin.nix @@ -29,10 +29,6 @@ ./modules/services/syncthing.nix ]; - environment.systemPackages = with pkgs; [ - chromium - ]; - networking = { hostName = "marvin"; domain = "alanpearce.eu"; diff --git a/modules/development/base.nix b/modules/development/base.nix index 0d7520bf..1cf85c8d 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -14,6 +14,7 @@ ag ripgrep + firefox-devedition-bin httpie jq diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 7ac6cdb1..36c7f108 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -16,48 +16,10 @@ nixpkgs.config.allowUnfree = true; - programs.chromium = { - enable = true; - extensions = [ - "cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin - "aeblfdkhhhdcdjpifhhbdiojplfjncoa" # 1password x - ]; - homepageLocation = "about:blank"; - defaultSearchProviderSearchURL = "https://duckduckgo.com/?q={searchTerms}"; - defaultSearchProviderSuggestURL = "https://duckduckgo.com/ac/?q={searchTerms}&type=list"; - # https://www.chromium.org/administrators/policy-list-3 - extraOpts = { - BlockThirdPartyCookies = true; - CookiesBlockedForUrls = [ - "[*.]smartlock.google.com" - "[*.]mediumSmartLockSigninAllowed.com" - ]; - SyncDisabled = true; - BuiltInDnsClientEnabled = false; - BrowserSignin = 0; - EasyUnlockAllowed = false; - EnableMediaRouter = false; - CloudPrintProxyEnabled = false; - CloudPrintSubmitEnabled = false; - SafeBrowsingEnabled = false; - RestoreOnStartup = 1; # Restore last session - AlwaysOpenPdfExternally = true; - BrowserNetworkTimeQueriesEnabled = false; - NotificationsAllowedForUrls = [ - "gitlab.satoshipay.tech" - "calendar.google.com" - ]; - NotificationsBlockedForUrls = [ - "[.*]reddit.com" - ]; - }; - }; - environment.systemPackages = with pkgs; [ awscli caddy openssl - chromium docker_compose mongodb-tools pgadmin diff --git a/prefect.nix b/prefect.nix index 1c786a7d..ff5dbadb 100644 --- a/prefect.nix +++ b/prefect.nix @@ -28,10 +28,6 @@ ./modules/services/syncthing.nix ]; - environment.systemPackages = with pkgs; [ - chromium - ]; - networking = { hostName = "prefect"; domain = "alanpearce.eu"; -- cgit 1.4.1 From 54bc9ec3052b951e09fa3e1934d0cb0dfb300bf3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 19 Jun 2019 17:06:31 +0200 Subject: Emacs: use unstable packages --- modules/user-interface.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index cace67d9..39964971 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -2,8 +2,7 @@ let emacsPackage = import ../packages/emacs.nix { - inherit pkgs; - # pkgs = pkgs.unstable; + pkgs = pkgs.unstable; }; in { programs.browserpass.enable = true; -- cgit 1.4.1 From 473a10c40202f3934c355624d67c82e30b120f13 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 27 Jun 2019 16:40:07 +0200 Subject: Tweak fonts --- modules/services/xserver.nix | 17 ++++++++--------- modules/user-interface.nix | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 041d10fa..34efd50a 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -35,15 +35,15 @@ enableDefaultFonts = true; fontconfig = { defaultFonts = { - monospace = [ "Liberation Mono" ]; - sansSerif = [ "Liberation Sans" ]; - serif = [ "Liberation Serif" ]; + monospace = [ "IBM Plex Mono" ]; + sansSerif = [ "Roboto" ]; + serif = [ "Roboto Slab" ]; }; penultimate = { - enable = false; + enable = true; }; ultimate = { - enable = true; + enable = false; preset = "osx"; }; }; @@ -60,15 +60,14 @@ fira-code fira-mono go-font - font-awesome-ttf + font-awesome_5 + ibm-plex liberation_ttf mononoki opensans-ttf roboto roboto-mono - paratype-pt-mono - paratype-pt-sans - paratype-pt-serif + roboto-slab source-code-pro source-sans-pro source-serif-pro diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 39964971..b0d66516 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -4,6 +4,32 @@ let emacsPackage = import ../packages/emacs.nix { pkgs = pkgs.unstable; }; + editorScript = pkgs.writeScriptBin "edit" '' + #!${pkgs.runtimeShell} + if [ -z "$1" ]; then + exec ${emacsPackage}/bin/emacsclient --create-frame --alternate-editor ${emacsPackage}/bin/emacs + else + exec ${emacsPackage}/bin/emacsclient --alternate-editor ${emacsPackage}/bin/emacs "$@" + fi + ''; + desktopApplicationFile = pkgs.writeTextFile { + name = "emacsclient.desktop"; + destination = "/share/applications/emacsclient.desktop"; + text = '' + [Desktop Entry] + Name=Emacsclient + GenericName=Text Editor + Comment=Edit text + MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; + Exec=emacseditor %F + Icon=emacs + Type=Application + Terminal=false + Categories=Development;TextEditor; + StartupWMClass=Emacs + Keywords=Text;Editor; + ''; + }; in { programs.browserpass.enable = true; documentation.info.enable = true; @@ -58,10 +84,11 @@ in }; }; - services.emacs = { - enable = true; - defaultEditor = true; - package = emacsPackage; + environment.variables = { + # This is required so that GTK applications launched from Emacs + # get properly themed: + GTK_DATA_PREFIX = "${config.system.path}"; + EDITOR = lib.mkOverride 900 "${editorScript}/bin/edit"; }; services.redshift = { -- cgit 1.4.1 From 7b55894e04f1af73e4846d2c152536f7f702c96d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 27 Jun 2019 16:41:20 +0200 Subject: Improve edit/emacs access --- modules/user-interface.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index b0d66516..aaa5e88d 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -21,7 +21,7 @@ let GenericName=Text Editor Comment=Edit text MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; - Exec=emacseditor %F + Exec=${editorScript}/bin/edit %F Icon=emacs Type=Application Terminal=false @@ -43,6 +43,8 @@ in epdfview geeqie + emacsPackage + editorScript termite lxappearance -- cgit 1.4.1 From 3a8c0f8a0386e0066dbec507e85d0b901f91e31c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 30 Jun 2019 12:34:14 +0200 Subject: Development: Don't try to install firefox-dev on macOS --- modules/development/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/development/base.nix b/modules/development/base.nix index 1cf85c8d..ea119514 100644 --- a/modules/development/base.nix +++ b/modules/development/base.nix @@ -14,7 +14,6 @@ ag ripgrep - firefox-devedition-bin httpie jq @@ -26,6 +25,7 @@ ldns httping http-prompt + firefox-devedition-bin ] else [ ] ); -- cgit 1.4.1 From 741968bd77c35c19cda1d4c0e7d944992dfa9aad Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 30 Jun 2019 12:34:51 +0200 Subject: Emacs: make certain packages macOS-specific --- packages/emacs.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 8d6c6d02..cc9d8830 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -9,6 +9,7 @@ let rm $out/share/applications/emacs.desktop ''; }); + stdenv = pkgs.stdenv; emacsWithPackages = (pkgs.emacsPackagesNgGen myEmacs).emacsWithPackages; in @@ -44,7 +45,6 @@ in evil-quickscope evil-space evil-surround - exec-path-from-shell eyebrowse feature-mode flycheck @@ -100,7 +100,11 @@ in wgrep-ag which-key yaml-mode - ]) ++ (with epkgs.elpaPackages; [ + ] ++ (if stdenv.isDarwin then [ + exec-path-from-shell + ns-auto-titlebar + ] else [ + ])) ++ (with epkgs.elpaPackages; [ rainbow-mode ]) ++ [ # From main packages set -- cgit 1.4.1 From 4c79e2669cc976d42610ab8e08b96a7e1acdc0c3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 30 Jun 2019 12:36:34 +0200 Subject: Emacs: remove unused evil-leader Superceded by general --- packages/emacs.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index cc9d8830..087727bc 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -39,7 +39,6 @@ in evil evil-collection evil-commentary - evil-leader evil-magit evil-org evil-quickscope -- cgit 1.4.1 From 63d2301d8e6aa5d57d9e86192c3d64a9798e4d3a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 30 Jun 2019 12:36:55 +0200 Subject: Emacs: Install all-the-icons --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 087727bc..77adb13e 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -15,6 +15,7 @@ let in emacsWithPackages (epkgs: (with epkgs; [ ace-link + all-the-icons add-node-modules-path ag all-the-icons -- cgit 1.4.1 From ba7d4a7e9c03aaf6b9e8703499c8b5e2a3b140cc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 30 Jun 2019 12:37:19 +0200 Subject: Trillian: use native Emacs package --- trillian.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trillian.nix b/trillian.nix index d8e8ea1b..cc612868 100644 --- a/trillian.nix +++ b/trillian.nix @@ -2,7 +2,7 @@ let emacsPackage = import ./packages/emacs.nix { pkgs = pkgs.unstable; - emacs = pkgs.emacsMacport; + emacs = pkgs.unstable.emacs; }; in { -- cgit 1.4.1 From 7cc15c09240a25395a9bf19184c4805970f4f67a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 30 Jun 2019 13:12:04 +0200 Subject: Emacs: update company setup --- packages/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index 77adb13e..8e3a4035 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -25,9 +25,9 @@ in basic-theme caddyfile-mode company - company-box company-lsp company-web + company-tabnine counsel counsel-projectile crux -- cgit 1.4.1 From 5037abcd29f025b6ae0f0539bfbf670618d09b78 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 30 Jun 2019 13:26:35 +0200 Subject: Trillian: Allow unfree nix packages macOS is unfree, after all --- trillian.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/trillian.nix b/trillian.nix index cc612868..8d84664b 100644 --- a/trillian.nix +++ b/trillian.nix @@ -17,6 +17,7 @@ in ]; nixpkgs.config = { + allowUnfree = true; packageOverrides = pkgs: { unstable = import { config = config.nixpkgs.config; -- cgit 1.4.1 From 40ecc1fb03c5a9a527cf7ed7cc9d7a5138e4a778 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 2 Jul 2019 20:28:25 +0200 Subject: Emacs: install nix-update --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 8e3a4035..db309776 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -77,6 +77,7 @@ in moody nginx-mode nix-mode + nix-update org-journal paredit php-mode -- cgit 1.4.1 From 61c59173c503d4833e80e430e14c65ed1d6c9dc7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 4 Jul 2019 17:01:29 +0200 Subject: javascript: Install typescript-language-server --- modules/development/javascript.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 3e4a8926..67eef971 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -15,6 +15,7 @@ in npmPackages.node2nix npmPackages.nodemon npmPackages.javascript-typescript-langserver + npmPackages.typescript-language-server npmPackages.eslint_d npmPackages.yarn npmPackages.prettier -- cgit 1.4.1 From 851738b06d2c30e2531267580cb926b216ff8f48 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Jul 2019 14:13:00 +0200 Subject: Emacs: install flymake-diagnostic-at-point --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index db309776..f8eac9db 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -48,6 +48,7 @@ in eyebrowse feature-mode flycheck + flymake-diagnostic-at-point general git-gutter-fringe git-messenger -- cgit 1.4.1 From f7bf69cf5141a8193b900a136f18769bd0820d00 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Jul 2019 16:09:41 +0200 Subject: javascript: split npmPackages --- modules/development/javascript.nix | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 67eef971..df1da10a 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -4,23 +4,8 @@ let node = pkgs.unstable.nodejs-10_x; npmPackages = pkgs.unstable.nodePackages_10_x; in -{ environment.systemPackages = with pkgs.unstable; [ +{ environment.systemPackages = (with pkgs.unstable; [ node - - npmPackages.node-gyp - npmPackages.node-gyp-build - npmPackages.node-pre-gyp - - npmPackages.tern - npmPackages.node2nix - npmPackages.nodemon - npmPackages.javascript-typescript-langserver - npmPackages.typescript-language-server - npmPackages.eslint_d - npmPackages.yarn - npmPackages.prettier - npmPackages.pnpm - ] ++ ( if stdenv.isDarwin then @@ -34,5 +19,19 @@ in gnumake python2 ] - ); + )) ++ (with npmPackages; [ + node-gyp + node-gyp-build + node-pre-gyp + + tern + node2nix + nodemon + javascript-typescript-langserver + typescript-language-server + eslint_d + yarn + prettier + pnpm + ]); } -- cgit 1.4.1 From e4b48b135c57fddea105f51a6f233a881b213ea2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Jul 2019 16:11:54 +0200 Subject: javascript: install language servers for HTML and (S)CSS --- modules/development/javascript.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index df1da10a..7771fc34 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -29,6 +29,8 @@ in nodemon javascript-typescript-langserver typescript-language-server + vscode-css-languageserver-bin + vscode-html-languageserver-bin eslint_d yarn prettier -- cgit 1.4.1 From 5208d6d4255b0a6e3100d495062b6bb5ca1703ed Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 9 Jul 2019 19:38:14 +0200 Subject: Emacs: remove company-lsp --- packages/emacs.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/emacs.nix b/packages/emacs.nix index f8eac9db..a9934fc1 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -25,7 +25,6 @@ in basic-theme caddyfile-mode company - company-lsp company-web company-tabnine counsel -- cgit 1.4.1 From f6a12691b41b8ddec599891b9c7df5efb8dbc450 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 10 Jul 2019 16:18:52 +0200 Subject: Emacs: install almost-mono-themes --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index a9934fc1..62c0ad6e 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -16,6 +16,7 @@ in emacsWithPackages (epkgs: (with epkgs; [ ace-link all-the-icons + almost-mono-themes add-node-modules-path ag all-the-icons -- cgit 1.4.1 From 7f96612c424440e4e35e118cfa56acd7e67cc868 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 20 Jul 2019 19:59:03 +0200 Subject: Emacs: add lsp-haskell package --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 62c0ad6e..89e9fe5d 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -71,6 +71,7 @@ in ledger-mode lsp-mode lsp-ui + lsp-haskell magit markdown-mode minions -- cgit 1.4.1 From 725e2e893274a51faa74fc9879f4283f002dcda0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 20 Jul 2019 19:59:21 +0200 Subject: trillian: update nix-darwin --- trillian.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trillian.nix b/trillian.nix index 8d84664b..1f4ce67e 100644 --- a/trillian.nix +++ b/trillian.nix @@ -123,11 +123,11 @@ in ]; # Used for backwards compatibility, please read the changelog before changing. # $ darwin-rebuild changelog - system.stateVersion = 3; + system.stateVersion = 4; # You should generally set this to the total number of logical cores in your system. # $ sysctl -n hw.ncpu - nix.maxJobs = 2; - nix.buildCores = 4; + nix.maxJobs = 4; + nix.buildCores = 2; } # vim: sw=2 sts=2 expandtab autoindent smarttab -- cgit 1.4.1 From 2139f0c19dccd6715f6473a009b3023225e21d77 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 20 Jul 2019 20:17:31 +0200 Subject: Ignore nix-darwin configuration --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e4fc3504..8a1263bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /private/ /hardware-configuration.nix /configuration.nix +/darwin-configuration.nix -- cgit 1.4.1 From 149d6bbdd0a8e96a896310de49317d402b5be733 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 24 Jul 2019 11:46:07 +0200 Subject: Emacs: add lsp-treemacs for project-wide error checking --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 89e9fe5d..448503b8 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -72,6 +72,7 @@ in lsp-mode lsp-ui lsp-haskell + lsp-treemacs magit markdown-mode minions -- cgit 1.4.1 From e6e92c12ae75663c4cc45502031056d7b94ea8d5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 25 Jul 2019 12:34:49 +0200 Subject: Nix: decrease lifetime of old configurations --- modules/configuration/nix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/configuration/nix.nix b/modules/configuration/nix.nix index 1a064303..8dc334a1 100644 --- a/modules/configuration/nix.nix +++ b/modules/configuration/nix.nix @@ -9,7 +9,7 @@ autoOptimiseStore = true; gc = { automatic = true; - options = "--delete-older-than 30d"; + options = "--delete-older-than 14d"; }; }; -- cgit 1.4.1 From dd4e45818a2a98272851210254e5feacdbdf7c55 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 26 Jul 2019 11:37:13 +0200 Subject: UI: auto-clear old trash items weekly --- modules/user-interface.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index aaa5e88d..a11c4b59 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -86,6 +86,23 @@ in }; }; + systemd.user.services.trash-clean = { + path = with pkgs; [ trash-cli ]; + description = "Remove old files from FreeDesktop.org trash"; + + serviceConfig = { + Type = "oneshot"; + }; + script = "trash-empty 30"; + }; + systemd.user.timers.trash-clean = { + wantedBy = [ "default.target" ]; + timerConfig = { + OnCalendar = "weekly"; + Persistent = true; + }; + }; + environment.variables = { # This is required so that GTK applications launched from Emacs # get properly themed: -- cgit 1.4.1 From d8cacfdc9c47a5ddbcdff93e3b19de1120d8d7e4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 1 Aug 2019 17:33:15 +0200 Subject: Emacs: add packages for eshell --- modules/user-interface.nix | 1 + packages/emacs.nix | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index a11c4b59..fd86db26 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -43,6 +43,7 @@ in epdfview geeqie + fish # for emacs-fish-completion emacsPackage editorScript termite diff --git a/packages/emacs.nix b/packages/emacs.nix index 448503b8..011fdb68 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -24,6 +24,7 @@ in auto-async-byte-compile avy basic-theme + bash-completion caddyfile-mode company company-web @@ -37,6 +38,12 @@ in eink-theme eldoc-box emmet-mode + esh-autosuggest + esh-buf-stack + esh-help + eshell-fringe-status + eshell-toggle + eshell-up evil evil-collection evil-commentary @@ -47,6 +54,7 @@ in evil-surround eyebrowse feature-mode + fish-completion flycheck flymake-diagnostic-at-point general -- cgit 1.4.1 From 48c7486017f4ca8edc813115cfd9ef0cf5b24782 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Aug 2019 15:34:13 +0200 Subject: WM: switch to lightdm SLiM is unmaintained --- modules/programs/window-manager.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index dfa21848..391ec44d 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -4,9 +4,9 @@ desktopManager.xterm.enable = false; displayManager = { - slim = { + lightdm = { enable = true; - defaultUser = "alan"; + greeters.enso.enable = true; }; sessionCommands = '' ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr -solid '#4d4d4c' & -- cgit 1.4.1 From c82564a14c5ee5d1ad378d2932249880c27fa14b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 2 Aug 2019 15:34:42 +0200 Subject: Enable gnome keyring prerequisites --- modules/services/xserver.nix | 2 -- modules/user-interface.nix | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 34efd50a..179a4633 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -6,8 +6,6 @@ exportConfiguration = true; }; - services.dbus.socketActivated = true; - environment.systemPackages = with pkgs; [ xorg.xmodmap xorg.xinit diff --git a/modules/user-interface.nix b/modules/user-interface.nix index fd86db26..f6b9cae9 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -119,6 +119,13 @@ in }; }; + programs.dconf.enable = true; + services.gnome3 = { + gnome-keyring.enable = true; + seahorse.enable = true; + at-spi2-core.enable = true; + }; + imports = [ ./services/xserver.nix ]; -- cgit 1.4.1 From 1a25bbc3e539dfc4005b9981554da90475912dfa Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 4 Aug 2019 15:12:21 +0200 Subject: Emacs: add ws-butler packages --- packages/emacs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emacs.nix b/packages/emacs.nix index 011fdb68..a8acaf31 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -110,6 +110,7 @@ in use-package web-mode wgrep-ag + ws-butler which-key yaml-mode ] ++ (if stdenv.isDarwin then [ -- cgit 1.4.1 From ad2906907b4e72e55b5f43667773b5c5ad1e2475 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 4 Aug 2019 15:13:00 +0200 Subject: Remove colemak.nix --- modules/hardware/colemak.nix | 21 --------------------- prefect.nix | 1 - 2 files changed, 22 deletions(-) delete mode 100644 modules/hardware/colemak.nix diff --git a/modules/hardware/colemak.nix b/modules/hardware/colemak.nix deleted file mode 100644 index b8218e67..00000000 --- a/modules/hardware/colemak.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, pkgs, ... }: - -{ i18n.consoleKeyMap = "colemak/en-latin9"; - services.kmscon = { - extraConfig = '' - xkb-model=pc104 - xkb-layout=us - xkb-variant=colemak - xkb-options="altwin:prtsc_rwin" - ''; - }; - services.xserver = { - layout = "us,us"; - xkbVariant = "colemak,"; - xkbOptions = "grp:shifts_toggle,altwin:prtsc_rwin"; - displayManager.sessionCommands = '' - # Needed for pass/rofi-pass autotype - ${pkgs.xlibs.setxkbmap}/bin/setxkbmap us,us -variant colemak, - ''; - }; -} diff --git a/prefect.nix b/prefect.nix index ff5dbadb..0a8c8b36 100644 --- a/prefect.nix +++ b/prefect.nix @@ -14,7 +14,6 @@ ./modules/hardware/audio.nix ./modules/hardware/bare-metal.nix ./modules/user-interface.nix - ./modules/hardware/colemak.nix ./modules/hardware/nitrokey.nix ./modules/hardware/mouse.nix ./modules/hardware/systemd-boot.nix -- cgit 1.4.1 From 5080014eddd0e40049cae369f2d4276b9c6e243a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 5 Aug 2019 11:45:08 +0200 Subject: Re-add e-mail setup This reverts commit 41ab368a97f65215b47f1d1bad30e55faae40976. --- modules/user-interface.nix | 5 +++++ packages/emacs.nix | 3 +++ 2 files changed, 8 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index f6b9cae9..2188e147 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -50,6 +50,11 @@ in lxappearance + python3Packages.keyring + isync + mu + msmtp + weechat unstable.pass-otp diff --git a/packages/emacs.nix b/packages/emacs.nix index a8acaf31..4fedd3d4 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -48,6 +48,7 @@ in evil-collection evil-commentary evil-magit + evil-mu4e evil-org evil-quickscope evil-space @@ -121,4 +122,6 @@ in rainbow-mode ]) ++ [ # From main packages set + + pkgs.mu ]) -- cgit 1.4.1 From aa870b21d05fc774db69d1530a55430fcc40adb4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 5 Aug 2019 14:44:07 +0200 Subject: satoshipad: remove printing setup --- satoshipad.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/satoshipad.nix b/satoshipad.nix index 11cd3fc4..25aaf284 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -17,7 +17,6 @@ ./modules/hardware/systemd-boot.nix ./modules/hardware/keyboardio-model01.nix ./modules/hardware/network-manager.nix - ./modules/hardware/printing.nix ./modules/hardware/qwerty.nix ./modules/hardware/trackball.nix ./modules/hardware/trezor.nix -- cgit 1.4.1 From f41600d28dff11897dd92b6f85e15ceeb93fe6e3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 5 Aug 2019 14:45:15 +0200 Subject: satoshipad: run mbsync on timer --- satoshipad.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/satoshipad.nix b/satoshipad.nix index 25aaf284..5ecb4481 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -50,4 +50,22 @@ virtualisation.docker.autoPrune.dates = "Mon, 13:00"; system.stateVersion = "18.03"; + + systemd.user.services.mbsync = { + description = "Mailbox synchronisation"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.isync}/bin/mbsync -Va"; + ExecStartPost = "${pkgs.unstable.emacs}/bin/emacsclient -e (mu4e-update-index)"; + }; + }; + + systemd.user.timers.mbsync = { + description = "Mailbox synchronisation timer"; + wantedBy = [ "default.target" ]; + timerConfig = { + OnBootSec = "2m"; + OnUnitActiveSec = "10m"; + }; + }; } -- cgit 1.4.1 From 12839aaa0916d1f8382b35b9e97c33cc079398f2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 5 Aug 2019 14:45:39 +0200 Subject: Fix mu version mismatch --- modules/user-interface.nix | 2 +- packages/emacs.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 2188e147..2d199edb 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -52,7 +52,7 @@ in python3Packages.keyring isync - mu + unstable.mu msmtp weechat diff --git a/packages/emacs.nix b/packages/emacs.nix index 4fedd3d4..cebbb16f 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -123,5 +123,5 @@ in ]) ++ [ # From main packages set - pkgs.mu + pkgs.unstable.mu ]) -- cgit 1.4.1 From 85c094d51f6169de365fe2466acc0f0f5a353390 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 6 Aug 2019 16:35:24 +0200 Subject: Xserver: improve browser font stack --- modules/services/xserver.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 179a4633..f1877b73 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -30,12 +30,12 @@ fonts = { enableFontDir = true; - enableDefaultFonts = true; + enableDefaultFonts = false; fontconfig = { defaultFonts = { - monospace = [ "IBM Plex Mono" ]; - sansSerif = [ "Roboto" ]; - serif = [ "Roboto Slab" ]; + monospace = [ "Liberation Mono" ]; + sansSerif = [ "Liberation Sans" ]; + serif = [ "Liberation Serif" ]; }; penultimate = { enable = true; @@ -62,14 +62,15 @@ ibm-plex liberation_ttf mononoki - opensans-ttf roboto roboto-mono roboto-slab source-code-pro source-sans-pro source-serif-pro - xorg.fontxfree86type1 + xorg.fontmiscmisc + xorg.fontcursormisc + xorg.fontbhlucidatypewriter100dpi ]; }; } -- cgit 1.4.1 From e1713691cb526fb347bec38089eda1d0cb7112d5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 15 Aug 2019 16:26:23 +0200 Subject: satoshipad: fix mbsync timer --- satoshipad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/satoshipad.nix b/satoshipad.nix index 5ecb4481..6d744537 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -53,6 +53,7 @@ systemd.user.services.mbsync = { description = "Mailbox synchronisation"; + path = with pkgs; [ python3Packages.keyring ]; serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.isync}/bin/mbsync -Va"; -- cgit 1.4.1 From 215befecd9d8ec133493a8d0d01d2f2504e29fa7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 19 Aug 2019 14:46:20 +0200 Subject: X: install bibata, capitaine cursor themes --- modules/services/xserver.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index f1877b73..80ed6a3a 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -15,6 +15,8 @@ xfontsel vanilla-dmz + capitaine-cursors + bibata-cursors arc-theme hicolor_icon_theme -- cgit 1.4.1 From 97b6b1f4ed9d211d09f0fadbab92b3c93b604077 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 19 Aug 2019 15:56:24 +0200 Subject: UI: fix termite TERM issue once and for all --- modules/user-interface.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 2d199edb..09c8dbe0 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -81,6 +81,10 @@ in services.devmon.enable = true; environment.sessionVariables.TERMINAL = "termite"; + # termite sets a custom TERM whose definition isn't installed by + # default. I SSH into too many servers to set this up on every + # single one of them, and some get recreated anyway + environment.sessionVariables.TERM = "xterm-color"; services.nscd.enable = true; systemd.services.nscd.wantedBy = lib.mkForce []; -- cgit 1.4.1 From 40581eb7fd601d9af881d0b056a381f14553b35e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 19 Aug 2019 16:20:20 +0200 Subject: t470s: Disable WWAN (unused) --- modules/machines/t470s.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 53f8908b..42a87672 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -1,6 +1,8 @@ { config, pkgs, ... }: -{ hardware.usbWwan.enable = true; +{ hardware.usbWwan.enable = false; # unused + systemd.services.ModemManager.enable = false; + hardware.firmware = with pkgs; [ firmwareLinuxNonfree ]; -- cgit 1.4.1 From 4b08ea4df136f30a6f870322ed96cbadc17741ad Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 26 Aug 2019 11:51:33 +0200 Subject: i3: use standard package instead of -gaps --- modules/programs/i3.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/programs/i3.nix b/modules/programs/i3.nix index 76dc66dc..f73664e6 100644 --- a/modules/programs/i3.nix +++ b/modules/programs/i3.nix @@ -2,7 +2,6 @@ { services.xserver.windowManager.i3 = { enable = true; - package = pkgs.i3-gaps; extraSessionCommands = '' ${pkgs.dunst}/bin/dunst & ${pkgs.sxhkd}/bin/sxhkd & -- cgit 1.4.1 From 3fbb8b4190e93b3ac58511df2039ee48a412697a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 26 Aug 2019 14:38:18 +0200 Subject: nix: hide autoUpgrade build output --- modules/configuration/nix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/configuration/nix.nix b/modules/configuration/nix.nix index 8dc334a1..54361d93 100644 --- a/modules/configuration/nix.nix +++ b/modules/configuration/nix.nix @@ -28,7 +28,7 @@ systemd.services.nixos-upgrade = { script = pkgs.lib.mkForce '' ${pkgs.nix}/bin/nix-channel --update nixos-unstable - ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --upgrade ${toString config.system.autoUpgrade.flags} + ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --no-build-output --upgrade ${toString config.system.autoUpgrade.flags} ''; }; } -- cgit 1.4.1 From 4551a59f04bd3dba4e2d00449389b15040fdd54d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 27 Aug 2019 15:02:12 +0200 Subject: nix: install cachix --- .gitignore | 1 + cachix.nix | 14 ++++++++++++++ modules/configuration/nix.nix | 4 ++++ 3 files changed, 19 insertions(+) create mode 100644 cachix.nix diff --git a/.gitignore b/.gitignore index 8a1263bb..1ba8e950 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /hardware-configuration.nix /configuration.nix /darwin-configuration.nix +/cachix diff --git a/cachix.nix b/cachix.nix new file mode 100644 index 00000000..cce90a32 --- /dev/null +++ b/cachix.nix @@ -0,0 +1,14 @@ + +# WARN: this file will get overwritten by $ cachix use +{ pkgs, lib, ... }: + +let + folder = ./cachix; + toImport = name: value: folder + ("/" + name); + filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; + imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); +in { + inherit imports; + nix.binaryCaches = ["https://cache.nixos.org/"]; +} + \ No newline at end of file diff --git a/modules/configuration/nix.nix b/modules/configuration/nix.nix index 54361d93..15cbb7a8 100644 --- a/modules/configuration/nix.nix +++ b/modules/configuration/nix.nix @@ -21,6 +21,10 @@ }; }; + environment.systemPackages = with pkgs; [ + cachix + ]; + system.autoUpgrade = { enable = true; flags = [ "--max-jobs" "2" ]; -- cgit 1.4.1 From e793acc4ad3d069da8708b51228f6adecc15be8d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 27 Aug 2019 15:03:05 +0200 Subject: audio: use full pulseaudio only when bluetooth is enabled --- modules/hardware/audio.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/hardware/audio.nix b/modules/hardware/audio.nix index 47d68e06..bb0dd534 100644 --- a/modules/hardware/audio.nix +++ b/modules/hardware/audio.nix @@ -3,7 +3,9 @@ { hardware.pulseaudio = { enable = true; support32Bit = true; - package = pkgs.pulseaudioFull; + package = if config.hardware.bluetooth.enable + then pkgs.pulseaudioFull + else pkgs.pulseaudio; }; sound.enable = true; -- cgit 1.4.1 From 3be4b4ea6bd0faff4cda90ca745a269b368e48b0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 27 Aug 2019 15:04:09 +0200 Subject: UI: install html2text for Emacs --- modules/user-interface.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 09c8dbe0..660bb4cb 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -54,6 +54,7 @@ in isync unstable.mu msmtp + html2text weechat -- cgit 1.4.1 From 4b707d4833a602154adc774cd96248079ce81b0b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 27 Aug 2019 15:04:30 +0200 Subject: T470s: disable ModemManager --- modules/machines/t470s.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 42a87672..99f2df50 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -28,7 +28,6 @@ "i915.enable_psr=2" ]; - systemd.services.ModemManager.enable = true; hardware.pulseaudio.extraConfig = '' load-module module-alsa-sink device=hw:0,7 -- cgit 1.4.1 From f0fb7b08933dbdbafb0a0117120948812e29b0ff Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 27 Aug 2019 15:04:53 +0200 Subject: Enable bfq IO scheduler --- modules/hardware/bare-metal.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hardware/bare-metal.nix b/modules/hardware/bare-metal.nix index 9d79fb50..298eb66a 100644 --- a/modules/hardware/bare-metal.nix +++ b/modules/hardware/bare-metal.nix @@ -18,6 +18,8 @@ boot.tmpOnTmpfs = true; + boot.kernelModules = [ "bfq" ]; + fileSystems."/".options = [ "noatime" "nodiratime" ]; fileSystems."/home".options = [ "noatime" "nodiratime" ]; } -- cgit 1.4.1 From f1dfff811175b6cb005fffc6d796a24059814029 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 27 Aug 2019 15:05:03 +0200 Subject: T470s: use BFQ scheduler --- modules/machines/t470s.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index 99f2df50..c4a92869 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -28,6 +28,9 @@ "i915.enable_psr=2" ]; + boot.postBootCommands = '' + echo bfq > /sys/block/nvme0n1/queue/scheduler + ''; hardware.pulseaudio.extraConfig = '' load-module module-alsa-sink device=hw:0,7 -- cgit 1.4.1 From e658a7b8402130af9393657ccddc2cf7ded2e6a3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 27 Aug 2019 16:16:46 +0200 Subject: wm: configure x correctly at startup --- modules/programs/window-manager.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index 391ec44d..313bd45d 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -9,8 +9,8 @@ greeters.enso.enable = true; }; sessionCommands = '' - ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr -solid '#4d4d4c' & - ${pkgs.hsetroot}/bin/hsetroot -solid '#4d4d4c' + ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.xresources/main + ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr -solid '#4d4d4c' ${pkgs.networkmanagerapplet}/bin/nm-applet & ''; }; -- cgit 1.4.1 From 5138ed9bfa6a4e822d091519f2a7afaeee5692ca Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 28 Aug 2019 15:39:13 +0200 Subject: bare-metal: enable zramSwap --- modules/hardware/bare-metal.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/hardware/bare-metal.nix b/modules/hardware/bare-metal.nix index 298eb66a..0a61790a 100644 --- a/modules/hardware/bare-metal.nix +++ b/modules/hardware/bare-metal.nix @@ -16,6 +16,10 @@ "net.ipv4.tcp_congestion_control" = "illinois"; }; + zramSwap = { + enable = true; + algorithm = "zstd"; + }; boot.tmpOnTmpfs = true; boot.kernelModules = [ "bfq" ]; -- cgit 1.4.1 From 1c9f2e4f79c747724ff30da7a7c836ff6c5a8025 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 28 Aug 2019 16:48:08 +0200 Subject: T470s: set DPI once --- modules/machines/t470s.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix index c4a92869..e0b49427 100644 --- a/modules/machines/t470s.nix +++ b/modules/machines/t470s.nix @@ -43,14 +43,17 @@ # Option "TripleBuffer" "false" # ''; - services.xserver.monitorSection = '' - DisplaySize 310 176 + services.xserver = { + dpi = 109; + monitorSection = '' + DisplaySize 310 176 - Option "StandbyTime" "0" - Option "SuspendTime" "300" - Option "OffTime" "600" - Option "BlankTime" "0" - ''; + Option "StandbyTime" "0" + Option "SuspendTime" "300" + Option "OffTime" "600" + Option "BlankTime" "0" + ''; + }; environment.systemPackages = with pkgs; [ nvme-cli -- cgit 1.4.1 From 66e0fc015b2325ac807747ea6b4c771a05c6ba63 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 28 Aug 2019 16:48:30 +0200 Subject: laptop: run autorandr via acpid on lid events --- modules/hardware/laptop.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index a1d27ee4..4c76ff6a 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -38,6 +38,13 @@ IdleActionSec=600 ''; + services.acpid = { + enable = true; + lidEventCommands = '' + ${pkgs.autorandr}/bin/autorandr --batch --change + ''; + }; + services.physlock = { enable = true; # Already need to enter disk encryption password -- cgit 1.4.1 From 721f85a77991422e43b7930e110feea14b2deb1c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Sep 2019 13:09:54 +0200 Subject: laptop: Improve bluetooth setup --- modules/hardware/laptop.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index 4c76ff6a..3b5aeb2a 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -9,6 +9,7 @@ bluetooth = { enable = true; powerOnBoot = false; + package = pkgs.bluezFull; }; }; systemd.services.bluetooth.wantedBy = lib.mkForce []; @@ -21,6 +22,9 @@ }; environment.systemPackages = with pkgs; [ + blueman + bluez-tools + powerstat powertop -- cgit 1.4.1 From 5f0e9c4f7e65162dc703d9a4836dcf45c0d73867 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Sep 2019 13:10:07 +0200 Subject: laptop: support high-quality bluetooth audio codecs LDAC, aptX HD and AAC --- modules/hardware/laptop.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index 3b5aeb2a..7320d600 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -11,6 +11,11 @@ powerOnBoot = false; package = pkgs.bluezFull; }; + pulseaudio = { + extraModules = with pkgs; [ + pulseaudio-modules-bt + ]; + }; }; systemd.services.bluetooth.wantedBy = lib.mkForce []; systemd.timers.bluetooth = { -- cgit 1.4.1 From 6ce2d1c7e98ed7c45f5b29bf49df570d9d3f9694 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 5 Sep 2019 17:27:59 +0200 Subject: user: enable bluetooth tethering as user --- modules/configuration/user.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/configuration/user.nix b/modules/configuration/user.nix index 7034a159..e7362bce 100644 --- a/modules/configuration/user.nix +++ b/modules/configuration/user.nix @@ -3,7 +3,7 @@ { users.extraUsers.alan = { description = "Alan Pearce"; isNormalUser = true; - extraGroups = [ "audio" "wheel" "adbusers" "docker" "nitrokey" "dialout" "networkmanager" ]; + extraGroups = [ "audio" "wheel" "lp" "adbusers" "docker" "nitrokey" "dialout" "networkmanager" ]; shell = "/run/current-system/sw/bin/zsh"; home = "/home/alan"; uid = 1000; -- cgit 1.4.1 From de693c7795cd7d693ef327ec2cca06563668633a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Sep 2019 11:54:18 +0200 Subject: window-manager: fix xautolock --- modules/programs/window-manager.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index 313bd45d..c0322acf 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -16,7 +16,7 @@ }; xautolock = { enable = true; - locker = "${pkgs.i3lock-color}"; + locker = "${pkgs.i3lock-color}/bin/i3lock-color"; time = 5; }; }; -- cgit 1.4.1 From 14354e6765b968d9f625446be8534fe28d8e7092 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Sep 2019 11:54:30 +0200 Subject: window-manager: notify before lock --- modules/programs/window-manager.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix index c0322acf..1ca1e109 100644 --- a/modules/programs/window-manager.nix +++ b/modules/programs/window-manager.nix @@ -17,6 +17,8 @@ xautolock = { enable = true; locker = "${pkgs.i3lock-color}/bin/i3lock-color"; + enableNotifier = true; + notifier = "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\""; time = 5; }; }; -- cgit 1.4.1 From 84be4b98580bb5600f45253af5b5e093c97199f9 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Sep 2019 11:54:49 +0200 Subject: laptop: disable physlock xautolock is nicer --- modules/hardware/laptop.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index 7320d600..8c370514 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -54,12 +54,6 @@ ''; }; - services.physlock = { - enable = true; - # Already need to enter disk encryption password - lockOn.hibernate = false; - }; - services.tlp = { enable = true; extraConfig = '' -- cgit 1.4.1 From c0287ca3a1e7168f016673c51668c1e764a0723b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 12 Sep 2019 19:20:17 +0200 Subject: Don't install mu on darwin; it's broken --- modules/user-interface.nix | 7 +++++-- packages/emacs.nix | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 660bb4cb..7c2e31c6 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -52,7 +52,6 @@ in python3Packages.keyring isync - unstable.mu msmtp html2text @@ -71,7 +70,11 @@ in signal-desktop trash-cli - ]; + ] ++ (if !stdenv.isDarwin + then [ + unstable.mu + ] + else []); nixpkgs.config.allowUnfree = true; diff --git a/packages/emacs.nix b/packages/emacs.nix index cebbb16f..e0df78b0 100644 --- a/packages/emacs.nix +++ b/packages/emacs.nix @@ -120,8 +120,8 @@ in ] else [ ])) ++ (with epkgs.elpaPackages; [ rainbow-mode - ]) ++ [ + ]) ++ (if !stdenv.isDarwin then [ # From main packages set pkgs.unstable.mu - ]) + ] else [])) -- cgit 1.4.1 From 9e5f4ef842477090d789b8cd22028b1154a31985 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 10 Sep 2019 11:46:43 +0200 Subject: Import javascript CLI tools via node2nix --- modules/development/javascript.nix | 8 + packages/node2nix/Makefile | 5 + packages/node2nix/default.nix | 17 + packages/node2nix/node-env.nix | 540 ++++++++++++++++++++++++ packages/node2nix/node-packages.json | 5 + packages/node2nix/node-packages.nix | 791 +++++++++++++++++++++++++++++++++++ 6 files changed, 1366 insertions(+) create mode 100644 packages/node2nix/Makefile create mode 100644 packages/node2nix/default.nix create mode 100644 packages/node2nix/node-env.nix create mode 100644 packages/node2nix/node-packages.json create mode 100644 packages/node2nix/node-packages.nix diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix index 7771fc34..e9c598e5 100644 --- a/modules/development/javascript.nix +++ b/modules/development/javascript.nix @@ -3,6 +3,10 @@ let node = pkgs.unstable.nodejs-10_x; npmPackages = pkgs.unstable.nodePackages_10_x; + node2nixPackages = import ../../packages/node2nix/default.nix { + pkgs = pkgs.unstable; + nodejs = node; + }; in { environment.systemPackages = (with pkgs.unstable; [ node @@ -35,5 +39,9 @@ in yarn prettier pnpm + + node2nixPackages.prettier_d + node2nixPackages.dockerfile-language-server-nodejs + node2nixPackages.yaml-language-server ]); } diff --git a/packages/node2nix/Makefile b/packages/node2nix/Makefile new file mode 100644 index 00000000..d829eeb5 --- /dev/null +++ b/packages/node2nix/Makefile @@ -0,0 +1,5 @@ +default.nix: node-packages.json + node2nix --nodejs-10 --input $< + +install: default.nix + nix-env -f default.nix -i diff --git a/packages/node2nix/default.nix b/packages/node2nix/default.nix new file mode 100644 index 00000000..fa0a1482 --- /dev/null +++ b/packages/node2nix/default.nix @@ -0,0 +1,17 @@ +# This file has been generated by node2nix 1.7.0. Do not edit! + +{pkgs ? import { + inherit system; + }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-10_x"}: + +let + nodeEnv = import ./node-env.nix { + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit nodejs; + libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; + }; +in +import ./node-packages.nix { + inherit (pkgs) fetchurl fetchgit; + inherit nodeEnv; +} \ No newline at end of file diff --git a/packages/node2nix/node-env.nix b/packages/node2nix/node-env.nix new file mode 100644 index 00000000..670556bf --- /dev/null +++ b/packages/node2nix/node-env.nix @@ -0,0 +1,540 @@ +# This file originates from node2nix + +{stdenv, nodejs, python2, utillinux, libtool, runCommand, writeTextFile}: + +let + python = if nodejs ? python then nodejs.python else python2; + + # Create a tar wrapper that filters all the 'Ignoring unknown extended header keyword' noise + tarWrapper = runCommand "tarWrapper" {} '' + mkdir -p $out/bin + + cat > $out/bin/tar <> $out/nix-support/hydra-build-products + ''; + }; + + includeDependencies = {dependencies}: + stdenv.lib.optionalString (dependencies != []) + (stdenv.lib.concatMapStrings (dependency: + '' + # Bundle the dependencies of the package + mkdir -p node_modules + cd node_modules + + # Only include dependencies if they don't exist. They may also be bundled in the package. + if [ ! -e "${dependency.name}" ] + then + ${composePackage dependency} + fi + + cd .. + '' + ) dependencies); + + # Recursively composes the dependencies of a package + composePackage = { name, packageName, src, dependencies ? [], ... }@args: + '' + DIR=$(pwd) + cd $TMPDIR + + unpackFile ${src} + + # Make the base dir in which the target dependency resides first + mkdir -p "$(dirname "$DIR/${packageName}")" + + if [ -f "${src}" ] + then + # Figure out what directory has been unpacked + packageDir="$(find . -maxdepth 1 -type d | tail -1)" + + # Restore write permissions to make building work + find "$packageDir" -type d -exec chmod u+x {} \; + chmod -R u+w "$packageDir" + + # Move the extracted tarball into the output folder + mv "$packageDir" "$DIR/${packageName}" + elif [ -d "${src}" ] + then + # Get a stripped name (without hash) of the source directory. + # On old nixpkgs it's already set internally. + if [ -z "$strippedName" ] + then + strippedName="$(stripHash ${src})" + fi + + # Restore write permissions to make building work + chmod -R u+w "$strippedName" + + # Move the extracted directory into the output folder + mv "$strippedName" "$DIR/${packageName}" + fi + + # Unset the stripped name to not confuse the next unpack step + unset strippedName + + # Include the dependencies of the package + cd "$DIR/${packageName}" + ${includeDependencies { inherit dependencies; }} + cd .. + ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} + ''; + + pinpointDependencies = {dependencies, production}: + let + pinpointDependenciesFromPackageJSON = writeTextFile { + name = "pinpointDependencies.js"; + text = '' + var fs = require('fs'); + var path = require('path'); + + function resolveDependencyVersion(location, name) { + if(location == process.env['NIX_STORE']) { + return null; + } else { + var dependencyPackageJSON = path.join(location, "node_modules", name, "package.json"); + + if(fs.existsSync(dependencyPackageJSON)) { + var dependencyPackageObj = JSON.parse(fs.readFileSync(dependencyPackageJSON)); + + if(dependencyPackageObj.name == name) { + return dependencyPackageObj.version; + } + } else { + return resolveDependencyVersion(path.resolve(location, ".."), name); + } + } + } + + function replaceDependencies(dependencies) { + if(typeof dependencies == "object" && dependencies !== null) { + for(var dependency in dependencies) { + var resolvedVersion = resolveDependencyVersion(process.cwd(), dependency); + + if(resolvedVersion === null) { + process.stderr.write("WARNING: cannot pinpoint dependency: "+dependency+", context: "+process.cwd()+"\n"); + } else { + dependencies[dependency] = resolvedVersion; + } + } + } + } + + /* Read the package.json configuration */ + var packageObj = JSON.parse(fs.readFileSync('./package.json')); + + /* Pinpoint all dependencies */ + replaceDependencies(packageObj.dependencies); + if(process.argv[2] == "development") { + replaceDependencies(packageObj.devDependencies); + } + replaceDependencies(packageObj.optionalDependencies); + + /* Write the fixed package.json file */ + fs.writeFileSync("package.json", JSON.stringify(packageObj, null, 2)); + ''; + }; + in + '' + node ${pinpointDependenciesFromPackageJSON} ${if production then "production" else "development"} + + ${stdenv.lib.optionalString (dependencies != []) + '' + if [ -d node_modules ] + then + cd node_modules + ${stdenv.lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies} + cd .. + fi + ''} + ''; + + # Recursively traverses all dependencies of a package and pinpoints all + # dependencies in the package.json file to the versions that are actually + # being used. + + pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args: + '' + if [ -d "${packageName}" ] + then + cd "${packageName}" + ${pinpointDependencies { inherit dependencies production; }} + cd .. + ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} + fi + ''; + + # Extract the Node.js source code which is used to compile packages with + # native bindings + nodeSources = runCommand "node-sources" {} '' + tar --no-same-owner --no-same-permissions -xf ${nodejs.src} + mv node-* $out + ''; + + # Script that adds _integrity fields to all package.json files to prevent NPM from consulting the cache (that is empty) + addIntegrityFieldsScript = writeTextFile { + name = "addintegrityfields.js"; + text = '' + var fs = require('fs'); + var path = require('path'); + + function augmentDependencies(baseDir, dependencies) { + for(var dependencyName in dependencies) { + var dependency = dependencies[dependencyName]; + + // Open package.json and augment metadata fields + var packageJSONDir = path.join(baseDir, "node_modules", dependencyName); + var packageJSONPath = path.join(packageJSONDir, "package.json"); + + if(fs.existsSync(packageJSONPath)) { // Only augment packages that exist. Sometimes we may have production installs in which development dependencies can be ignored + console.log("Adding metadata fields to: "+packageJSONPath); + var packageObj = JSON.parse(fs.readFileSync(packageJSONPath)); + + if(dependency.integrity) { + packageObj["_integrity"] = dependency.integrity; + } else { + packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads. + } + + if(dependency.resolved) { + packageObj["_resolved"] = dependency.resolved; // Adopt the resolved property if one has been provided + } else { + packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories. + } + + if(dependency.from !== undefined) { // Adopt from property if one has been provided + packageObj["_from"] = dependency.from; + } + + fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2)); + } + + // Augment transitive dependencies + if(dependency.dependencies !== undefined) { + augmentDependencies(packageJSONDir, dependency.dependencies); + } + } + } + + if(fs.existsSync("./package-lock.json")) { + var packageLock = JSON.parse(fs.readFileSync("./package-lock.json")); + + if(packageLock.lockfileVersion !== 1) { + process.stderr.write("Sorry, I only understand lock file version 1!\n"); + process.exit(1); + } + + if(packageLock.dependencies !== undefined) { + augmentDependencies(".", packageLock.dependencies); + } + } + ''; + }; + + # Reconstructs a package-lock file from the node_modules/ folder structure and package.json files with dummy sha1 hashes + reconstructPackageLock = writeTextFile { + name = "addintegrityfields.js"; + text = '' + var fs = require('fs'); + var path = require('path'); + + var packageObj = JSON.parse(fs.readFileSync("package.json")); + + var lockObj = { + name: packageObj.name, + version: packageObj.version, + lockfileVersion: 1, + requires: true, + dependencies: {} + }; + + function augmentPackageJSON(filePath, dependencies) { + var packageJSON = path.join(filePath, "package.json"); + if(fs.existsSync(packageJSON)) { + var packageObj = JSON.parse(fs.readFileSync(packageJSON)); + dependencies[packageObj.name] = { + version: packageObj.version, + integrity: "sha1-000000000000000000000000000=", + dependencies: {} + }; + processDependencies(path.join(filePath, "node_modules"), dependencies[packageObj.name].dependencies); + } + } + + function processDependencies(dir, dependencies) { + if(fs.existsSync(dir)) { + var files = fs.readdirSync(dir); + + files.forEach(function(entry) { + var filePath = path.join(dir, entry); + var stats = fs.statSync(filePath); + + if(stats.isDirectory()) { + if(entry.substr(0, 1) == "@") { + // When we encounter a namespace folder, augment all packages belonging to the scope + var pkgFiles = fs.readdirSync(filePath); + + pkgFiles.forEach(function(entry) { + if(stats.isDirectory()) { + var pkgFilePath = path.join(filePath, entry); + augmentPackageJSON(pkgFilePath, dependencies); + } + }); + } else { + augmentPackageJSON(filePath, dependencies); + } + } + }); + } + } + + processDependencies("node_modules", lockObj.dependencies); + + fs.writeFileSync("package-lock.json", JSON.stringify(lockObj, null, 2)); + ''; + }; + + prepareAndInvokeNPM = {packageName, bypassCache, reconstructLock, npmFlags, production}: + let + forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com"; + in + '' + # Pinpoint the versions of all dependencies to the ones that are actually being used + echo "pinpointing versions of dependencies..." + source $pinpointDependenciesScriptPath + + # Patch the shebangs of the bundled modules to prevent them from + # calling executables outside the Nix store as much as possible + patchShebangs . + + # Deploy the Node.js package by running npm install. Since the + # dependencies have been provided already by ourselves, it should not + # attempt to install them again, which is good, because we want to make + # it Nix's responsibility. If it needs to install any dependencies + # anyway (e.g. because the dependency parameters are + # incomplete/incorrect), it fails. + # + # The other responsibilities of NPM are kept -- version checks, build + # steps, postprocessing etc. + + export HOME=$TMPDIR + cd "${packageName}" + runHook preRebuild + + ${stdenv.lib.optionalString bypassCache '' + ${stdenv.lib.optionalString reconstructLock '' + if [ -f package-lock.json ] + then + echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!" + echo "This will most likely result in version mismatches! We will remove the lock file and regenerate it!" + rm package-lock.json + else + echo "No package-lock.json file found, reconstructing..." + fi + + node ${reconstructPackageLock} + ''} + + node ${addIntegrityFieldsScript} + ''} + + npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild + + if [ "$dontNpmInstall" != "1" ] + then + # NPM tries to download packages even when they already exist if npm-shrinkwrap is used. + rm -f npm-shrinkwrap.json + + npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install + fi + ''; + + # Builds and composes an NPM package including all its dependencies + buildNodePackage = + { name + , packageName + , version + , dependencies ? [] + , buildInputs ? [] + , production ? true + , npmFlags ? "" + , dontNpmInstall ? false + , bypassCache ? false + , reconstructLock ? false + , preRebuild ? "" + , dontStrip ? true + , unpackPhase ? "true" + , buildPhase ? "true" + , ... }@args: + + let + extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" ]; + in + stdenv.mkDerivation ({ + name = "node_${name}-${version}"; + buildInputs = [ tarWrapper python nodejs ] + ++ stdenv.lib.optional (stdenv.isLinux) utillinux + ++ stdenv.lib.optional (stdenv.isDarwin) libtool + ++ buildInputs; + + inherit dontStrip; # Stripping may fail a build for some package deployments + inherit dontNpmInstall preRebuild unpackPhase buildPhase; + + compositionScript = composePackage args; + pinpointDependenciesScript = pinpointDependenciesOfPackage args; + + passAsFile = [ "compositionScript" "pinpointDependenciesScript" ]; + + installPhase = '' + # Create and enter a root node_modules/ folder + mkdir -p $out/lib/node_modules + cd $out/lib/node_modules + + # Compose the package and all its dependencies + source $compositionScriptPath + + ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} + + # Create symlink to the deployed executable folder, if applicable + if [ -d "$out/lib/node_modules/.bin" ] + then + ln -s $out/lib/node_modules/.bin $out/bin + fi + + # Create symlinks to the deployed manual page folders, if applicable + if [ -d "$out/lib/node_modules/${packageName}/man" ] + then + mkdir -p $out/share + for dir in "$out/lib/node_modules/${packageName}/man/"* + do + mkdir -p $out/share/man/$(basename "$dir") + for page in "$dir"/* + do + ln -s $page $out/share/man/$(basename "$dir") + done + done + fi + + # Run post install hook, if provided + runHook postInstall + ''; + } // extraArgs); + + # Builds a development shell + buildNodeShell = + { name + , packageName + , version + , src + , dependencies ? [] + , buildInputs ? [] + , production ? true + , npmFlags ? "" + , dontNpmInstall ? false + , bypassCache ? false + , reconstructLock ? false + , dontStrip ? true + , unpackPhase ? "true" + , buildPhase ? "true" + , ... }@args: + + let + extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ]; + + nodeDependencies = stdenv.mkDerivation ({ + name = "node-dependencies-${name}-${version}"; + + buildInputs = [ tarWrapper python nodejs ] + ++ stdenv.lib.optional (stdenv.isLinux) utillinux + ++ stdenv.lib.optional (stdenv.isDarwin) libtool + ++ buildInputs; + + inherit dontStrip; # Stripping may fail a build for some package deployments + inherit dontNpmInstall unpackPhase buildPhase; + + includeScript = includeDependencies { inherit dependencies; }; + pinpointDependenciesScript = pinpointDependenciesOfPackage args; + + passAsFile = [ "includeScript" "pinpointDependenciesScript" ]; + + installPhase = '' + mkdir -p $out/${packageName} + cd $out/${packageName} + + source $includeScriptPath + + # Create fake package.json to make the npm commands work properly + cp ${src}/package.json . + chmod 644 package.json + ${stdenv.lib.optionalString bypassCache '' + if [ -f ${src}/package-lock.json ] + then + cp ${src}/package-lock.json . + fi + ''} + + # Go to the parent folder to make sure that all packages are pinpointed + cd .. + ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} + + ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} + + # Expose the executables that were installed + cd .. + ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} + + mv ${packageName} lib + ln -s $out/lib/node_modules/.bin $out/bin + ''; + } // extraArgs); + in + stdenv.mkDerivation { + name = "node-shell-${name}-${version}"; + + buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ buildInputs; + buildCommand = '' + mkdir -p $out/bin + cat > $out/bin/shell <