From 0a50d682ec85bf023bebd68a3ca388001f0c0677 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 8 Oct 2019 21:44:57 +0200 Subject: mv modules settings --- system/marvin.nix | 38 ++--- system/modules/base.nix | 13 -- system/modules/configuration/berlin.nix | 8 - system/modules/configuration/british-english.nix | 4 - system/modules/configuration/england.nix | 8 - system/modules/configuration/nix.nix | 29 ---- system/modules/configuration/user.nix | 11 -- system/modules/gaming.nix | 27 ---- system/modules/hardware/adb.nix | 9 -- system/modules/hardware/audio.nix | 20 --- system/modules/hardware/bare-metal.nix | 29 ---- system/modules/hardware/connman.nix | 14 -- system/modules/hardware/grub2.nix | 13 -- system/modules/hardware/hidpi.nix | 9 -- system/modules/hardware/intel-gpu.nix | 15 -- system/modules/hardware/keyboardio-model01.nix | 13 -- system/modules/hardware/laptop.nix | 87 ----------- system/modules/hardware/mouse.nix | 12 -- system/modules/hardware/network-manager.nix | 12 -- system/modules/hardware/nitrokey.nix | 13 -- system/modules/hardware/nvidia-gpu.nix | 5 - system/modules/hardware/printing.nix | 19 --- system/modules/hardware/qwerty.nix | 9 -- system/modules/hardware/synaptics.nix | 27 ---- system/modules/hardware/systemd-boot.nix | 10 -- system/modules/hardware/thinkpad.nix | 26 ---- system/modules/hardware/trackball.nix | 13 -- system/modules/hardware/trezor.nix | 13 -- system/modules/kubernetes.nix | 21 --- system/modules/machines/t470s.nix | 59 ------- system/modules/machines/x250.nix | 33 ---- system/modules/programs/accounting.nix | 10 -- system/modules/programs/barrier.nix | 7 - system/modules/programs/gnome.nix | 24 --- system/modules/programs/gnupg.nix | 10 -- system/modules/programs/i3.nix | 20 --- system/modules/programs/infrastructure.nix | 8 - system/modules/programs/kde.nix | 20 --- system/modules/programs/keybase.nix | 11 -- system/modules/programs/shell.nix | 8 - system/modules/programs/tor.nix | 22 --- system/modules/programs/window-manager.nix | 46 ------ system/modules/programs/wine.nix | 6 - system/modules/satoshipay.nix | 71 --------- system/modules/services/syncthing.nix | 11 -- system/modules/services/xserver.nix | 82 ---------- system/modules/services/zeroconf.nix | 16 -- system/modules/user-interface.nix | 97 ------------ system/prefect.nix | 48 +++--- system/satoshipad.nix | 40 ++--- system/settings/base.nix | 13 ++ system/settings/configuration/berlin.nix | 8 + system/settings/configuration/british-english.nix | 4 + system/settings/configuration/england.nix | 8 + system/settings/configuration/nix.nix | 29 ++++ system/settings/configuration/user.nix | 11 ++ system/settings/gaming.nix | 27 ++++ system/settings/hardware/adb.nix | 9 ++ system/settings/hardware/audio.nix | 20 +++ system/settings/hardware/bare-metal.nix | 29 ++++ system/settings/hardware/connman.nix | 14 ++ system/settings/hardware/grub2.nix | 13 ++ system/settings/hardware/hidpi.nix | 9 ++ system/settings/hardware/intel-gpu.nix | 15 ++ system/settings/hardware/keyboardio-model01.nix | 13 ++ system/settings/hardware/laptop.nix | 87 +++++++++++ system/settings/hardware/mouse.nix | 12 ++ system/settings/hardware/network-manager.nix | 12 ++ system/settings/hardware/nitrokey.nix | 13 ++ system/settings/hardware/nvidia-gpu.nix | 5 + system/settings/hardware/printing.nix | 19 +++ system/settings/hardware/qwerty.nix | 9 ++ system/settings/hardware/synaptics.nix | 27 ++++ system/settings/hardware/systemd-boot.nix | 10 ++ system/settings/hardware/thinkpad.nix | 26 ++++ system/settings/hardware/trackball.nix | 13 ++ system/settings/hardware/trezor.nix | 13 ++ system/settings/kubernetes.nix | 21 +++ system/settings/machines/t470s.nix | 59 +++++++ system/settings/machines/x250.nix | 33 ++++ system/settings/programs/accounting.nix | 10 ++ system/settings/programs/barrier.nix | 7 + system/settings/programs/gnome.nix | 24 +++ system/settings/programs/gnupg.nix | 10 ++ system/settings/programs/i3.nix | 20 +++ system/settings/programs/infrastructure.nix | 8 + system/settings/programs/kde.nix | 20 +++ system/settings/programs/keybase.nix | 11 ++ system/settings/programs/shell.nix | 8 + system/settings/programs/tor.nix | 22 +++ system/settings/programs/window-manager.nix | 46 ++++++ system/settings/programs/wine.nix | 6 + system/settings/satoshipay.nix | 71 +++++++++ system/settings/services/syncthing.nix | 11 ++ system/settings/services/xserver.nix | 82 ++++++++++ system/settings/services/zeroconf.nix | 16 ++ system/settings/user-interface.nix | 97 ++++++++++++ system/trillian.nix | 4 +- user/modules/autorandr.nix | 8 - user/modules/base.nix | 31 ---- user/modules/darwin.nix | 49 ------ user/modules/development/base.nix | 29 ---- user/modules/development/lisp.nix | 13 -- user/modules/dunst.nix | 57 ------- user/modules/emacs.nix | 169 -------------------- user/modules/gaming.nix | 45 ------ user/modules/git.nix | 77 --------- user/modules/gnupg.nix | 8 - user/modules/i3.nix | 149 ------------------ user/modules/isync.nix | 5 - user/modules/javascript.nix | 59 ------- user/modules/ledger.nix | 8 - user/modules/msmtp.nix | 5 - user/modules/nix.nix | 5 - user/modules/nixos.nix | 21 --- user/modules/nixpkgs.nix | 12 -- user/modules/passwords.nix | 10 -- user/modules/rofi.nix | 25 --- user/modules/satoshipay.nix | 55 ------- user/modules/sxhkd.nix | 29 ---- user/modules/tabnine.nix | 57 ------- user/modules/trezor.nix | 9 -- user/modules/user-interface.nix | 17 -- user/modules/xresources.nix | 8 - user/modules/zsh.nix | 181 ---------------------- user/prefect.nix | 38 ++--- user/satoshipad.nix | 42 ++--- user/settings/autorandr.nix | 8 + user/settings/base.nix | 31 ++++ user/settings/darwin.nix | 49 ++++++ user/settings/development/base.nix | 29 ++++ user/settings/development/lisp.nix | 13 ++ user/settings/dunst.nix | 57 +++++++ user/settings/emacs.nix | 169 ++++++++++++++++++++ user/settings/gaming.nix | 45 ++++++ user/settings/git.nix | 77 +++++++++ user/settings/gnupg.nix | 8 + user/settings/i3.nix | 149 ++++++++++++++++++ user/settings/isync.nix | 5 + user/settings/javascript.nix | 59 +++++++ user/settings/ledger.nix | 8 + user/settings/msmtp.nix | 5 + user/settings/nix.nix | 5 + user/settings/nixos.nix | 21 +++ user/settings/nixpkgs.nix | 12 ++ user/settings/passwords.nix | 10 ++ user/settings/rofi.nix | 25 +++ user/settings/satoshipay.nix | 55 +++++++ user/settings/sxhkd.nix | 29 ++++ user/settings/tabnine.nix | 57 +++++++ user/settings/trezor.nix | 9 ++ user/settings/user-interface.nix | 17 ++ user/settings/xresources.nix | 8 + user/settings/zsh.nix | 181 ++++++++++++++++++++++ user/trillian.nix | 24 +-- 155 files changed, 2308 insertions(+), 2308 deletions(-) delete mode 100644 system/modules/base.nix delete mode 100644 system/modules/configuration/berlin.nix delete mode 100644 system/modules/configuration/british-english.nix delete mode 100644 system/modules/configuration/england.nix delete mode 100644 system/modules/configuration/nix.nix delete mode 100644 system/modules/configuration/user.nix delete mode 100644 system/modules/gaming.nix delete mode 100644 system/modules/hardware/adb.nix delete mode 100644 system/modules/hardware/audio.nix delete mode 100644 system/modules/hardware/bare-metal.nix delete mode 100644 system/modules/hardware/connman.nix delete mode 100644 system/modules/hardware/grub2.nix delete mode 100644 system/modules/hardware/hidpi.nix delete mode 100644 system/modules/hardware/intel-gpu.nix delete mode 100644 system/modules/hardware/keyboardio-model01.nix delete mode 100644 system/modules/hardware/laptop.nix delete mode 100644 system/modules/hardware/mouse.nix delete mode 100644 system/modules/hardware/network-manager.nix delete mode 100644 system/modules/hardware/nitrokey.nix delete mode 100644 system/modules/hardware/nvidia-gpu.nix delete mode 100644 system/modules/hardware/printing.nix delete mode 100644 system/modules/hardware/qwerty.nix delete mode 100644 system/modules/hardware/synaptics.nix delete mode 100644 system/modules/hardware/systemd-boot.nix delete mode 100644 system/modules/hardware/thinkpad.nix delete mode 100644 system/modules/hardware/trackball.nix delete mode 100644 system/modules/hardware/trezor.nix delete mode 100644 system/modules/kubernetes.nix delete mode 100644 system/modules/machines/t470s.nix delete mode 100644 system/modules/machines/x250.nix delete mode 100644 system/modules/programs/accounting.nix delete mode 100644 system/modules/programs/barrier.nix delete mode 100644 system/modules/programs/gnome.nix delete mode 100644 system/modules/programs/gnupg.nix delete mode 100644 system/modules/programs/i3.nix delete mode 100644 system/modules/programs/infrastructure.nix delete mode 100644 system/modules/programs/kde.nix delete mode 100644 system/modules/programs/keybase.nix delete mode 100644 system/modules/programs/shell.nix delete mode 100644 system/modules/programs/tor.nix delete mode 100644 system/modules/programs/window-manager.nix delete mode 100644 system/modules/programs/wine.nix delete mode 100644 system/modules/satoshipay.nix delete mode 100644 system/modules/services/syncthing.nix delete mode 100644 system/modules/services/xserver.nix delete mode 100644 system/modules/services/zeroconf.nix delete mode 100644 system/modules/user-interface.nix create mode 100644 system/settings/base.nix create mode 100644 system/settings/configuration/berlin.nix create mode 100644 system/settings/configuration/british-english.nix create mode 100644 system/settings/configuration/england.nix create mode 100644 system/settings/configuration/nix.nix create mode 100644 system/settings/configuration/user.nix create mode 100644 system/settings/gaming.nix create mode 100644 system/settings/hardware/adb.nix create mode 100644 system/settings/hardware/audio.nix create mode 100644 system/settings/hardware/bare-metal.nix create mode 100644 system/settings/hardware/connman.nix create mode 100644 system/settings/hardware/grub2.nix create mode 100644 system/settings/hardware/hidpi.nix create mode 100644 system/settings/hardware/intel-gpu.nix create mode 100644 system/settings/hardware/keyboardio-model01.nix create mode 100644 system/settings/hardware/laptop.nix create mode 100644 system/settings/hardware/mouse.nix create mode 100644 system/settings/hardware/network-manager.nix create mode 100644 system/settings/hardware/nitrokey.nix create mode 100644 system/settings/hardware/nvidia-gpu.nix create mode 100644 system/settings/hardware/printing.nix create mode 100644 system/settings/hardware/qwerty.nix create mode 100644 system/settings/hardware/synaptics.nix create mode 100644 system/settings/hardware/systemd-boot.nix create mode 100644 system/settings/hardware/thinkpad.nix create mode 100644 system/settings/hardware/trackball.nix create mode 100644 system/settings/hardware/trezor.nix create mode 100644 system/settings/kubernetes.nix create mode 100644 system/settings/machines/t470s.nix create mode 100644 system/settings/machines/x250.nix create mode 100644 system/settings/programs/accounting.nix create mode 100644 system/settings/programs/barrier.nix create mode 100644 system/settings/programs/gnome.nix create mode 100644 system/settings/programs/gnupg.nix create mode 100644 system/settings/programs/i3.nix create mode 100644 system/settings/programs/infrastructure.nix create mode 100644 system/settings/programs/kde.nix create mode 100644 system/settings/programs/keybase.nix create mode 100644 system/settings/programs/shell.nix create mode 100644 system/settings/programs/tor.nix create mode 100644 system/settings/programs/window-manager.nix create mode 100644 system/settings/programs/wine.nix create mode 100644 system/settings/satoshipay.nix create mode 100644 system/settings/services/syncthing.nix create mode 100644 system/settings/services/xserver.nix create mode 100644 system/settings/services/zeroconf.nix create mode 100644 system/settings/user-interface.nix delete mode 100644 user/modules/autorandr.nix delete mode 100644 user/modules/base.nix delete mode 100644 user/modules/darwin.nix delete mode 100644 user/modules/development/base.nix delete mode 100644 user/modules/development/lisp.nix delete mode 100644 user/modules/dunst.nix delete mode 100644 user/modules/emacs.nix delete mode 100644 user/modules/gaming.nix delete mode 100644 user/modules/git.nix delete mode 100644 user/modules/gnupg.nix delete mode 100644 user/modules/i3.nix delete mode 100644 user/modules/isync.nix delete mode 100644 user/modules/javascript.nix delete mode 100644 user/modules/ledger.nix delete mode 100644 user/modules/msmtp.nix delete mode 100644 user/modules/nix.nix delete mode 100644 user/modules/nixos.nix delete mode 100644 user/modules/nixpkgs.nix delete mode 100644 user/modules/passwords.nix delete mode 100644 user/modules/rofi.nix delete mode 100644 user/modules/satoshipay.nix delete mode 100644 user/modules/sxhkd.nix delete mode 100644 user/modules/tabnine.nix delete mode 100644 user/modules/trezor.nix delete mode 100644 user/modules/user-interface.nix delete mode 100644 user/modules/xresources.nix delete mode 100644 user/modules/zsh.nix create mode 100644 user/settings/autorandr.nix create mode 100644 user/settings/base.nix create mode 100644 user/settings/darwin.nix create mode 100644 user/settings/development/base.nix create mode 100644 user/settings/development/lisp.nix create mode 100644 user/settings/dunst.nix create mode 100644 user/settings/emacs.nix create mode 100644 user/settings/gaming.nix create mode 100644 user/settings/git.nix create mode 100644 user/settings/gnupg.nix create mode 100644 user/settings/i3.nix create mode 100644 user/settings/isync.nix create mode 100644 user/settings/javascript.nix create mode 100644 user/settings/ledger.nix create mode 100644 user/settings/msmtp.nix create mode 100644 user/settings/nix.nix create mode 100644 user/settings/nixos.nix create mode 100644 user/settings/nixpkgs.nix create mode 100644 user/settings/passwords.nix create mode 100644 user/settings/rofi.nix create mode 100644 user/settings/satoshipay.nix create mode 100644 user/settings/sxhkd.nix create mode 100644 user/settings/tabnine.nix create mode 100644 user/settings/trezor.nix create mode 100644 user/settings/user-interface.nix create mode 100644 user/settings/xresources.nix create mode 100644 user/settings/zsh.nix diff --git a/system/marvin.nix b/system/marvin.nix index c8b46085..59b90e9b 100644 --- a/system/marvin.nix +++ b/system/marvin.nix @@ -3,25 +3,25 @@ { imports = [ ./hardware-configuration.nix - ./modules/base.nix - ./modules/configuration/berlin.nix - ./modules/configuration/british-english.nix - ./modules/configuration/nix.nix - ./modules/configuration/user.nix - ./modules/hardware/adb.nix - ./modules/hardware/audio.nix - ./modules/hardware/qwerty.nix - ./modules/hardware/network-manager.nix - ./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/i3.nix - ./modules/programs/infrastructure.nix - ./modules/programs/shell.nix - ./modules/services/syncthing.nix + ./settings/base.nix + ./settings/configuration/berlin.nix + ./settings/configuration/british-english.nix + ./settings/configuration/nix.nix + ./settings/configuration/user.nix + ./settings/hardware/adb.nix + ./settings/hardware/audio.nix + ./settings/hardware/qwerty.nix + ./settings/hardware/network-manager.nix + ./settings/hardware/nitrokey.nix + ./settings/hardware/systemd-boot.nix + ./settings/hardware/trackball.nix + ./settings/hardware/trezor.nix + ./settings/machines/x250.nix + ./settings/programs/accounting.nix + ./settings/programs/i3.nix + ./settings/programs/infrastructure.nix + ./settings/programs/shell.nix + ./settings/services/syncthing.nix ]; networking = { diff --git a/system/modules/base.nix b/system/modules/base.nix deleted file mode 100644 index 9e94a5a2..00000000 --- a/system/modules/base.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ boot.loader.timeout = 1; - - environment.systemPackages = with pkgs; [ - nix-index - ]; - - networking.extraHosts = '' - 127.0.0.1 ${config.networking.hostName} - ::1 ${config.networking.hostName} - ''; -} diff --git a/system/modules/configuration/berlin.nix b/system/modules/configuration/berlin.nix deleted file mode 100644 index 246510c4..00000000 --- a/system/modules/configuration/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/system/modules/configuration/british-english.nix b/system/modules/configuration/british-english.nix deleted file mode 100644 index 3ff93678..00000000 --- a/system/modules/configuration/british-english.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ config, pkgs, ... }: - -{ i18n.defaultLocale = "en_GB.UTF-8"; -} diff --git a/system/modules/configuration/england.nix b/system/modules/configuration/england.nix deleted file mode 100644 index b2f799cd..00000000 --- a/system/modules/configuration/england.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ time.timeZone = "Europe/London"; - services.redshift = { - latitude = "52.2394"; - longitude = "-0.9416"; - }; -} diff --git a/system/modules/configuration/nix.nix b/system/modules/configuration/nix.nix deleted file mode 100644 index d254de0e..00000000 --- a/system/modules/configuration/nix.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, pkgs, ... }: - -{ nix = { - buildCores = 0; - - daemonNiceLevel = 19; - daemonIONiceLevel = 7; - - autoOptimiseStore = true; - gc = { - automatic = true; - options = "--delete-older-than 14d"; - }; - }; - - environment.systemPackages = with pkgs; [ - cachix - ]; - - system.autoUpgrade = { - enable = true; - flags = [ "--max-jobs" "1" ]; - }; - systemd.services.nixos-upgrade = { - script = pkgs.lib.mkForce '' - ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --no-build-output --upgrade ${toString config.system.autoUpgrade.flags} - ''; - }; -} diff --git a/system/modules/configuration/user.nix b/system/modules/configuration/user.nix deleted file mode 100644 index e7362bce..00000000 --- a/system/modules/configuration/user.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: - -{ users.extraUsers.alan = { - description = "Alan Pearce"; - isNormalUser = true; - extraGroups = [ "audio" "wheel" "lp" "adbusers" "docker" "nitrokey" "dialout" "networkmanager" ]; - shell = "/run/current-system/sw/bin/zsh"; - home = "/home/alan"; - uid = 1000; - }; -} diff --git a/system/modules/gaming.nix b/system/modules/gaming.nix deleted file mode 100644 index 0dbc5b12..00000000 --- a/system/modules/gaming.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, pkgs, ... }: - -{ - hardware.steam-hardware.enable = true; - hardware.opengl.driSupport32Bit = true; - hardware.pulseaudio.support32Bit = true; - - systemd = { - extraConfig = '' - DefaultLimitNOFILE=524288 - ''; - user.extraConfig = '' - DefaultLimitNOFILE=524288 - ''; - }; - - networking.firewall = { - allowedUDPPorts = [ - 27031 - 27036 - ]; - allowedTCPPorts = [ - 27036 - 27037 - ]; - }; -} diff --git a/system/modules/hardware/adb.nix b/system/modules/hardware/adb.nix deleted file mode 100644 index 8b511f55..00000000 --- a/system/modules/hardware/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/system/modules/hardware/audio.nix b/system/modules/hardware/audio.nix deleted file mode 100644 index ed956919..00000000 --- a/system/modules/hardware/audio.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, ... }: - -{ hardware.pulseaudio = { - enable = true; - support32Bit = true; - daemon.config = { - flat-volumes = "no"; - }; - package = if config.hardware.bluetooth.enable - then pkgs.pulseaudioFull - else pkgs.pulseaudio; - }; - - sound.enable = true; - - environment.systemPackages = with pkgs; [ - pamixer - pavucontrol - ]; -} diff --git a/system/modules/hardware/bare-metal.nix b/system/modules/hardware/bare-metal.nix deleted file mode 100644 index 0a61790a..00000000 --- a/system/modules/hardware/bare-metal.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - fuse_exfat - cryptsetup - dmidecode - hdparm - pciutils - usbutils - ]; - - hardware.cpu.intel.updateMicrocode = true; - - boot.kernel.sysctl = { - "net.ipv4.tcp_allowed_congestion_control" = "illinois reno lp"; - "net.ipv4.tcp_congestion_control" = "illinois"; - }; - - zramSwap = { - enable = true; - algorithm = "zstd"; - }; - boot.tmpOnTmpfs = true; - - boot.kernelModules = [ "bfq" ]; - - fileSystems."/".options = [ "noatime" "nodiratime" ]; - fileSystems."/home".options = [ "noatime" "nodiratime" ]; -} diff --git a/system/modules/hardware/connman.nix b/system/modules/hardware/connman.nix deleted file mode 100644 index 0361f9cb..00000000 --- a/system/modules/hardware/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/system/modules/hardware/grub2.nix b/system/modules/hardware/grub2.nix deleted file mode 100644 index 70e86e71..00000000 --- a/system/modules/hardware/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/system/modules/hardware/hidpi.nix b/system/modules/hardware/hidpi.nix deleted file mode 100644 index 1f4644c5..00000000 --- a/system/modules/hardware/hidpi.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ i18n = { - consoleFont = "ter-v24b"; - consolePackages = with pkgs; [ - terminus_font - ]; - }; -} diff --git a/system/modules/hardware/intel-gpu.nix b/system/modules/hardware/intel-gpu.nix deleted file mode 100644 index fc6b6fa3..00000000 --- a/system/modules/hardware/intel-gpu.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, pkgs, ... }: - -{ hardware.opengl.extraPackages = with pkgs; [ - vaapiIntel - vaapiVdpau - libvdpau-va-gl - ]; - - services.xserver.videoDrivers = [ "intel" "modesetting" ]; - - boot.earlyVconsoleSetup = true; - boot.initrd.kernelModules = [ - "i915" - ]; -} diff --git a/system/modules/hardware/keyboardio-model01.nix b/system/modules/hardware/keyboardio-model01.nix deleted file mode 100644 index 7a624f56..00000000 --- a/system/modules/hardware/keyboardio-model01.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ 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" - ''; - - environment.systemPackages = with pkgs; [ - arduino_core - ]; - - environment.variables.ARDUINO_PATH = "${pkgs.arduino_core}/share/arduino"; -} diff --git a/system/modules/hardware/laptop.nix b/system/modules/hardware/laptop.nix deleted file mode 100644 index 17e27b63..00000000 --- a/system/modules/hardware/laptop.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ boot.kernelModules = [ "coretemp" ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ - x86_energy_perf_policy - ]; - - hardware = { - bluetooth = { - enable = true; - powerOnBoot = false; - package = pkgs.bluezFull; - }; - pulseaudio = { - extraModules = with pkgs; [ - pulseaudio-modules-bt - ]; - }; - }; - 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; [ - blueman - bluez-tools - - powerstat - powertop - - arandr - autorandr - disper - ]; - - programs.light.enable = true; - - services.autorandr.enable = true; - - services.logind.extraConfig = '' - IdleAction=suspend - IdleActionSec=600 - ''; - - services.acpid = { - enable = true; - lidEventCommands = '' - ${pkgs.autorandr}/bin/autorandr --batch --change - ''; - }; - - services.tlp = { - enable = true; - extraConfig = '' - CPU_SCALING_GOVERNOR_ON_BAT=powersave - ENERGY_PERF_POLICY_ON_BAT="balance_power" - - SOUND_POWER_SAVE_ON_AC=60 - DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wwan" - ''; - }; - - services.xserver = { - libinput = { - enable = lib.mkDefault true; - naturalScrolling = true; - disableWhileTyping = true; - }; - displayManager.sessionCommands = '' - ${pkgs.autorandr}/bin/autorandr --change --force - ${pkgs.blueman}/bin/blueman-applet & - ''; - }; - - systemd.services.nixos-upgrade.unitConfig.ConditionACPower = true; - systemd.services.nix-gc.unitConfig.ConditionACPower = true; - systemd.services.docker-prune.unitConfig.ConditionACPower = true; - - imports = [ - ../user-interface.nix - ]; -} diff --git a/system/modules/hardware/mouse.nix b/system/modules/hardware/mouse.nix deleted file mode 100644 index b30d4124..00000000 --- a/system/modules/hardware/mouse.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ 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/system/modules/hardware/network-manager.nix b/system/modules/hardware/network-manager.nix deleted file mode 100644 index f28548a1..00000000 --- a/system/modules/hardware/network-manager.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, ... }: - -{ networking.networkmanager = { - enable = true; - dns = "unbound"; - }; - - environment.systemPackages = with pkgs; [ - networkmanagerapplet - networkmanager_dmenu - ]; -} diff --git a/system/modules/hardware/nitrokey.nix b/system/modules/hardware/nitrokey.nix deleted file mode 100644 index a77ce00c..00000000 --- a/system/modules/hardware/nitrokey.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - hardware.nitrokey = { - enable = true; - }; - - services.pcscd.enable = true; - - environment.systemPackages = with pkgs; [ - nitrokey-app - ]; -} diff --git a/system/modules/hardware/nvidia-gpu.nix b/system/modules/hardware/nvidia-gpu.nix deleted file mode 100644 index 9fc34169..00000000 --- a/system/modules/hardware/nvidia-gpu.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver.videoDrivers = [ "nvidia" ]; - nixpkgs.config.allowUnfree = true; -} diff --git a/system/modules/hardware/printing.nix b/system/modules/hardware/printing.nix deleted file mode 100644 index 96d3a959..00000000 --- a/system/modules/hardware/printing.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ 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/system/modules/hardware/qwerty.nix b/system/modules/hardware/qwerty.nix deleted file mode 100644 index c967d561..00000000 --- a/system/modules/hardware/qwerty.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ - services.xserver = { - layout = "us"; - xkbVariant = "intl-unicode"; - xkbOptions = "altwin:prtsc_rwin,caps:escape"; - }; -} diff --git a/system/modules/hardware/synaptics.nix b/system/modules/hardware/synaptics.nix deleted file mode 100644 index 9f075cce..00000000 --- a/system/modules/hardware/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/system/modules/hardware/systemd-boot.nix b/system/modules/hardware/systemd-boot.nix deleted file mode 100644 index 80e79fdc..00000000 --- a/system/modules/hardware/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/system/modules/hardware/thinkpad.nix b/system/modules/hardware/thinkpad.nix deleted file mode 100644 index 903e819b..00000000 --- a/system/modules/hardware/thinkpad.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, pkgs, ... }: - -{ boot.kernelModules = [ ]; - boot.blacklistedKernelModules = [ "thinkpad_ec" ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ - acpi_call - ]; - - hardware.trackpoint = { - enable = true; - emulateWheel = true; - }; - - services.thinkfan = { - enable = true; - }; - - services.tlp = { - enable = true; - }; - - imports = [ - ./bare-metal.nix - ./laptop.nix - ]; -} diff --git a/system/modules/hardware/trackball.nix b/system/modules/hardware/trackball.nix deleted file mode 100644 index 9aa5abc0..00000000 --- a/system/modules/hardware/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/system/modules/hardware/trezor.nix b/system/modules/hardware/trezor.nix deleted file mode 100644 index 33cc6f25..00000000 --- a/system/modules/hardware/trezor.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ services.trezord.enable = true; - environment.systemPackages = with pkgs; [ - gnupg - pinentry - (python3.withPackages(ps: with ps; [ trezor_agent wheel ])) - ]; - programs.gnupg.agent = { - enable = lib.mkForce false; - enableSSHSupport = lib.mkForce false; - }; -} diff --git a/system/modules/kubernetes.nix b/system/modules/kubernetes.nix deleted file mode 100644 index 692e46d6..00000000 --- a/system/modules/kubernetes.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ 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/system/modules/machines/t470s.nix b/system/modules/machines/t470s.nix deleted file mode 100644 index 4ee6c2ac..00000000 --- a/system/modules/machines/t470s.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ config, pkgs, ... }: - -{ hardware.usbWwan.enable = false; # unused - systemd.services.ModemManager.enable = false; - - hardware.firmware = with pkgs; [ - firmwareLinuxNonfree - ]; - - 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 - ''; - services.thinkfan.levels = '' - (0, 0, 48) - (1, 45, 52) - (2, 50, 57) - (3, 55, 63) - (6, 60, 65) - (7, 60, 85) - (127, 80, 32767) - ''; - - boot.kernelParams = [ - "i915.enable_guc=2" - "i915.enable_psr=1" - ]; - - boot.postBootCommands = '' - echo bfq > /sys/block/nvme0n1/queue/scheduler - ''; - - hardware.pulseaudio.extraConfig = '' - load-module module-alsa-sink device=hw:0,7 - ''; - - services.tlp.extraConfig = '' - DISK_DEVICES="nvme0n1" - DISK_IOSCHED="keep" - ''; - - services.xserver = { - dpi = 109; - monitorSection = '' - DisplaySize 310 176 - ''; - }; - - environment.systemPackages = with pkgs; [ - nvme-cli - ]; - - imports = [ - ../hardware/intel-gpu.nix - ../hardware/hidpi.nix - ../hardware/thinkpad.nix - ]; -} diff --git a/system/modules/machines/x250.nix b/system/modules/machines/x250.nix deleted file mode 100644 index 0e8ac04e..00000000 --- a/system/modules/machines/x250.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, pkgs, ... }: - -{ boot.extraModulePackages = with config.boot.kernelPackages; [ - acpi_call - ]; - - hardware.firmware = with pkgs; [ - firmwareLinuxNonfree - ]; - - 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/system/modules/programs/accounting.nix b/system/modules/programs/accounting.nix deleted file mode 100644 index e98c3e7e..00000000 --- a/system/modules/programs/accounting.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - ledger - bean-add - beancount - fava - reckon - ]; -} diff --git a/system/modules/programs/barrier.nix b/system/modules/programs/barrier.nix deleted file mode 100644 index 9a73620d..00000000 --- a/system/modules/programs/barrier.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, ... }: { - environment.systemPackages = with pkgs; [ - barrier - ]; - - networking.firewall.allowedTCPPorts = [ 24800 ]; -} diff --git a/system/modules/programs/gnome.nix b/system/modules/programs/gnome.nix deleted file mode 100644 index bd785453..00000000 --- a/system/modules/programs/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/system/modules/programs/gnupg.nix b/system/modules/programs/gnupg.nix deleted file mode 100644 index 663bcb3c..00000000 --- a/system/modules/programs/gnupg.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - environment.systemPackages = with pkgs; [ - gnupg - pinentry - (python3.withPackages(ps: with ps; [ trezor_agent wheel ])) - ]; - environment.variables.GNUPGHOME = "$HOME/.gnupg/trezor/"; -} diff --git a/system/modules/programs/i3.nix b/system/modules/programs/i3.nix deleted file mode 100644 index b0140cdb..00000000 --- a/system/modules/programs/i3.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver.windowManager = { - default = "i3"; - i3 = { - enable = true; - extraSessionCommands = '' - ${pkgs.sxhkd}/bin/sxhkd & - ''; - }; - }; - - environment.systemPackages = with pkgs; [ - i3status - ]; - - imports = [ - ./window-manager.nix - ]; -} diff --git a/system/modules/programs/infrastructure.nix b/system/modules/programs/infrastructure.nix deleted file mode 100644 index 5e68bc8a..00000000 --- a/system/modules/programs/infrastructure.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - hugo - - nixops - ]; -} diff --git a/system/modules/programs/kde.nix b/system/modules/programs/kde.nix deleted file mode 100644 index 652eb2a6..00000000 --- a/system/modules/programs/kde.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -{ services = { - xserver = { - desktopManager = { - plasma5.enable = true; - }; - displayManager = { - sddm.enable = true; - }; - }; - - physlock.enable = lib.mkForce false; - }; - - environment.systemPackages = with pkgs; [ - kde-gtk-config - ]; -} diff --git a/system/modules/programs/keybase.nix b/system/modules/programs/keybase.nix deleted file mode 100644 index 39a16b27..00000000 --- a/system/modules/programs/keybase.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ 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/system/modules/programs/shell.nix b/system/modules/programs/shell.nix deleted file mode 100644 index a8d4f56f..00000000 --- a/system/modules/programs/shell.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ programs.zsh = { - enable = true; - promptInit = ""; - }; - programs.bash.enableCompletion = true; -} diff --git a/system/modules/programs/tor.nix b/system/modules/programs/tor.nix deleted file mode 100644 index 5524aede..00000000 --- a/system/modules/programs/tor.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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/system/modules/programs/window-manager.nix b/system/modules/programs/window-manager.nix deleted file mode 100644 index 7095d523..00000000 --- a/system/modules/programs/window-manager.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver = { - desktopManager.xterm.enable = false; - - displayManager = { - lightdm = { - enable = true; - greeters.mini = { - enable = true; - user = "alan"; - }; - }; - sessionCommands = '' - ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.xresources/main - ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr -solid '#4d4d4c' - ''; - }; - xautolock = { - enable = true; - locker = "${pkgs.i3lock}/bin/i3lock -n"; - enableNotifier = true; - notifier = "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\""; - time = 5; - }; - }; - - services.xserver.displayManager.setupCommands = '' - ${pkgs.redshift}/bin/redshift \ - -l ${toString config.services.redshift.latitude}:${toString config.services.redshift.longitude} \ - -t ${toString config.services.redshift.temperature.day}:${toString config.services.redshift.temperature.night} \ - -b 1:1 \ - -o \ - -r \ - ''; - - environment.systemPackages = with pkgs; [ - dmenu - libnotify # for notify-send - rofi - sxhkd - maim - - perlPackages.FileMimeInfo # xdg-utils uses this when no DE - ]; -} diff --git a/system/modules/programs/wine.nix b/system/modules/programs/wine.nix deleted file mode 100644 index 98dd60a2..00000000 --- a/system/modules/programs/wine.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - wineStable - ]; -} diff --git a/system/modules/satoshipay.nix b/system/modules/satoshipay.nix deleted file mode 100644 index 9cc5a341..00000000 --- a/system/modules/satoshipay.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ config, pkgs, fetchurl, lib, ... }: - -{ virtualisation = { - docker = let - daemonConfig = { - ipv6 = true; - fixed-cidr-v6 = "fd69:2074:9fcd:b0fd::/64"; - features = { - buildkit = true; - }; - }; - in { - enable = true; - enableOnBoot = false; - liveRestore = false; - - extraOptions = "--config-file=${pkgs.writeText "daemon.json" (builtins.toJSON daemonConfig)}"; - - autoPrune = { - enable = true; - }; - }; - }; - - services.mongodb = { - enable = true; - replSetName = "rs0"; - dbpath = "/tmp/mongodb"; - }; - systemd.services.mongodb.wantedBy = lib.mkForce []; - systemd.timers.mongodb = { - description = "Delayed startup of MongoDB"; - wantedBy = [ "timers.target" ]; - timerConfig = { - 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; - }; - 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; [ - ]; - - networking.domain = "satoshipay.io"; - - networking.extraHosts = '' - 127.0.0.1 blogger.local wallet.satoshipay.local api.satoshipay.local ws.satoshipay.local - ''; -} diff --git a/system/modules/services/syncthing.nix b/system/modules/services/syncthing.nix deleted file mode 100644 index b6a12861..00000000 --- a/system/modules/services/syncthing.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: - -{ services.syncthing = { - enable = true; - user = "alan"; - group = "users"; - openDefaultPorts = true; - systemService = true; - dataDir = "/home/alan/.config/syncthing"; - }; -} diff --git a/system/modules/services/xserver.nix b/system/modules/services/xserver.nix deleted file mode 100644 index d898f55a..00000000 --- a/system/modules/services/xserver.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver = { - enable = true; - enableCtrlAltBackspace = true; - exportConfiguration = true; - }; - - i18n.consoleUseXkbConfig = true; - - environment.systemPackages = with pkgs; [ - xorg.xmodmap - xorg.xinit - xorg.xev - xorg.xdpyinfo - xclip - xfontsel - - vanilla-dmz - capitaine-cursors - bibata-cursors - - arc-theme - hicolor_icon_theme - paper-gtk-theme - paper-icon-theme - - arc-icon-theme - tango-icon-theme - - gtk-engine-murrine - gtk_engines - ]; - - fonts = { - enableFontDir = true; - enableDefaultFonts = false; - fontconfig = { - useEmbeddedBitmaps = true; - defaultFonts = { - monospace = [ "Liberation Mono" ]; - sansSerif = [ "Liberation Sans" ]; - serif = [ "Liberation Serif" ]; - }; - penultimate = { - enable = true; - }; - ultimate = { - enable = false; - preset = "osx"; - }; - }; - fonts = with pkgs; [ - dina-font - envypn-font - profont - proggyfonts - terminus_font - terminus_font_ttf - - fantasque-sans-mono - emacs-all-the-icons-fonts - fira - fira-code - fira-mono - go-font - font-awesome_5 - ibm-plex - liberation_ttf - mononoki - roboto - roboto-mono - roboto-slab - source-code-pro - source-sans-pro - source-serif-pro - xorg.fontmiscmisc - xorg.fontcursormisc - xorg.fontbhlucidatypewriter100dpi - ]; - }; -} diff --git a/system/modules/services/zeroconf.nix b/system/modules/services/zeroconf.nix deleted file mode 100644 index 0b428c54..00000000 --- a/system/modules/services/zeroconf.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ 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"; - }; - }; -} diff --git a/system/modules/user-interface.nix b/system/modules/user-interface.nix deleted file mode 100644 index 08d390ab..00000000 --- a/system/modules/user-interface.nix +++ /dev/null @@ -1,97 +0,0 @@ -{ config, pkgs, lib, makeDesktopItem, ... }: - -{ documentation.info.enable = true; - nixpkgs.config.firefox.enableOfficialBranding = true; - - environment.pathsToLink = [ "/share/zsh" ]; - - environment.systemPackages = with pkgs; [ - aria2 - firefox - pcmanfm - - epdfview - geeqie - - cmus - - fish # for emacs-fish-completion - - lxappearance - lxrandr - lxtask - - python3Packages.keyring - isync - msmtp - html2text - - weechat - - mpv - - aspell - aspellDicts.en - - cifs-utils - hexchat - signal-desktop - wire-desktop - - trash-cli - ]; - - nixpkgs.config.allowUnfree = true; - - services.compton = { - enable = true; - backend = "glx"; - vSync = "opengl-swc"; - }; - - services.devmon.enable = true; - - 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: - GTK_DATA_PREFIX = "${config.system.path}"; - }; - - services.redshift = { - enable = true; - temperature = { - day = 6500; - night = 3600; - }; - }; - - programs.ssh.startAgent = true; - - programs.dconf.enable = true; - services.gnome3 = { - gnome-keyring.enable = true; - seahorse.enable = true; - at-spi2-core.enable = true; - }; - - imports = [ - ./services/xserver.nix - ]; -} diff --git a/system/prefect.nix b/system/prefect.nix index d375b3c0..ed8ce720 100644 --- a/system/prefect.nix +++ b/system/prefect.nix @@ -3,30 +3,30 @@ { imports = [ ./hardware-configuration.nix - ./modules/satoshipay.nix - ./modules/base.nix - ./modules/configuration/berlin.nix - ./modules/configuration/british-english.nix - ./modules/configuration/nix.nix - ./modules/configuration/user.nix - ./modules/hardware/audio.nix - ./modules/hardware/bare-metal.nix - ./modules/hardware/mouse.nix - ./modules/hardware/systemd-boot.nix - ./modules/hardware/nvidia-gpu.nix - ./modules/hardware/trezor.nix - ./modules/services/zeroconf.nix - ./modules/user-interface.nix - ./modules/programs/accounting.nix - ./modules/programs/gnupg.nix - ./modules/programs/keybase.nix - ./modules/programs/i3.nix - ./modules/programs/infrastructure.nix - ./modules/programs/shell.nix - ./modules/gaming.nix - ./modules/programs/tor.nix - ./modules/programs/barrier.nix - ./modules/services/syncthing.nix + ./settings/satoshipay.nix + ./settings/base.nix + ./settings/configuration/berlin.nix + ./settings/configuration/british-english.nix + ./settings/configuration/nix.nix + ./settings/configuration/user.nix + ./settings/hardware/audio.nix + ./settings/hardware/bare-metal.nix + ./settings/hardware/mouse.nix + ./settings/hardware/systemd-boot.nix + ./settings/hardware/nvidia-gpu.nix + ./settings/hardware/trezor.nix + ./settings/services/zeroconf.nix + ./settings/user-interface.nix + ./settings/programs/accounting.nix + ./settings/programs/gnupg.nix + ./settings/programs/keybase.nix + ./settings/programs/i3.nix + ./settings/programs/infrastructure.nix + ./settings/programs/shell.nix + ./settings/gaming.nix + ./settings/programs/tor.nix + ./settings/programs/barrier.nix + ./settings/services/syncthing.nix ]; boot.loader.efi.canTouchEfiVariables = pkgs.lib.mkForce false; services.xserver.screenSection = '' diff --git a/system/satoshipad.nix b/system/satoshipad.nix index e910859d..84d2407f 100644 --- a/system/satoshipad.nix +++ b/system/satoshipad.nix @@ -5,26 +5,26 @@ ./hardware-configuration.nix ./private/default.nix - ./modules/base.nix - ./modules/configuration/berlin.nix - ./modules/configuration/british-english.nix - ./modules/configuration/nix.nix - ./modules/configuration/user.nix - ./modules/hardware/audio.nix - ./modules/hardware/systemd-boot.nix - ./modules/hardware/keyboardio-model01.nix - ./modules/hardware/network-manager.nix - ./modules/hardware/qwerty.nix - ./modules/hardware/trackball.nix - ./modules/hardware/trezor.nix - ./modules/machines/t470s.nix - ./modules/programs/gnupg.nix - ./modules/programs/keybase.nix - ./modules/programs/tor.nix - ./modules/programs/i3.nix - ./modules/programs/infrastructure.nix - ./modules/programs/shell.nix - ./modules/satoshipay.nix + ./settings/base.nix + ./settings/configuration/berlin.nix + ./settings/configuration/british-english.nix + ./settings/configuration/nix.nix + ./settings/configuration/user.nix + ./settings/hardware/audio.nix + ./settings/hardware/systemd-boot.nix + ./settings/hardware/keyboardio-model01.nix + ./settings/hardware/network-manager.nix + ./settings/hardware/qwerty.nix + ./settings/hardware/trackball.nix + ./settings/hardware/trezor.nix + ./settings/machines/t470s.nix + ./settings/programs/gnupg.nix + ./settings/programs/keybase.nix + ./settings/programs/tor.nix + ./settings/programs/i3.nix + ./settings/programs/infrastructure.nix + ./settings/programs/shell.nix + ./settings/satoshipay.nix ]; boot.initrd.luks.devices = [ diff --git a/system/settings/base.nix b/system/settings/base.nix new file mode 100644 index 00000000..9e94a5a2 --- /dev/null +++ b/system/settings/base.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ boot.loader.timeout = 1; + + environment.systemPackages = with pkgs; [ + nix-index + ]; + + networking.extraHosts = '' + 127.0.0.1 ${config.networking.hostName} + ::1 ${config.networking.hostName} + ''; +} diff --git a/system/settings/configuration/berlin.nix b/system/settings/configuration/berlin.nix new file mode 100644 index 00000000..246510c4 --- /dev/null +++ b/system/settings/configuration/berlin.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ time.timeZone = "Europe/Berlin"; + services.redshift = { + latitude = "52.586"; + longitude = "13.300"; + }; +} diff --git a/system/settings/configuration/british-english.nix b/system/settings/configuration/british-english.nix new file mode 100644 index 00000000..3ff93678 --- /dev/null +++ b/system/settings/configuration/british-english.nix @@ -0,0 +1,4 @@ +{ config, pkgs, ... }: + +{ i18n.defaultLocale = "en_GB.UTF-8"; +} diff --git a/system/settings/configuration/england.nix b/system/settings/configuration/england.nix new file mode 100644 index 00000000..b2f799cd --- /dev/null +++ b/system/settings/configuration/england.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ time.timeZone = "Europe/London"; + services.redshift = { + latitude = "52.2394"; + longitude = "-0.9416"; + }; +} diff --git a/system/settings/configuration/nix.nix b/system/settings/configuration/nix.nix new file mode 100644 index 00000000..d254de0e --- /dev/null +++ b/system/settings/configuration/nix.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ nix = { + buildCores = 0; + + daemonNiceLevel = 19; + daemonIONiceLevel = 7; + + autoOptimiseStore = true; + gc = { + automatic = true; + options = "--delete-older-than 14d"; + }; + }; + + environment.systemPackages = with pkgs; [ + cachix + ]; + + system.autoUpgrade = { + enable = true; + flags = [ "--max-jobs" "1" ]; + }; + systemd.services.nixos-upgrade = { + script = pkgs.lib.mkForce '' + ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --no-build-output --upgrade ${toString config.system.autoUpgrade.flags} + ''; + }; +} diff --git a/system/settings/configuration/user.nix b/system/settings/configuration/user.nix new file mode 100644 index 00000000..e7362bce --- /dev/null +++ b/system/settings/configuration/user.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ users.extraUsers.alan = { + description = "Alan Pearce"; + isNormalUser = true; + extraGroups = [ "audio" "wheel" "lp" "adbusers" "docker" "nitrokey" "dialout" "networkmanager" ]; + shell = "/run/current-system/sw/bin/zsh"; + home = "/home/alan"; + uid = 1000; + }; +} diff --git a/system/settings/gaming.nix b/system/settings/gaming.nix new file mode 100644 index 00000000..0dbc5b12 --- /dev/null +++ b/system/settings/gaming.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: + +{ + hardware.steam-hardware.enable = true; + hardware.opengl.driSupport32Bit = true; + hardware.pulseaudio.support32Bit = true; + + systemd = { + extraConfig = '' + DefaultLimitNOFILE=524288 + ''; + user.extraConfig = '' + DefaultLimitNOFILE=524288 + ''; + }; + + networking.firewall = { + allowedUDPPorts = [ + 27031 + 27036 + ]; + allowedTCPPorts = [ + 27036 + 27037 + ]; + }; +} diff --git a/system/settings/hardware/adb.nix b/system/settings/hardware/adb.nix new file mode 100644 index 00000000..8b511f55 --- /dev/null +++ b/system/settings/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/system/settings/hardware/audio.nix b/system/settings/hardware/audio.nix new file mode 100644 index 00000000..ed956919 --- /dev/null +++ b/system/settings/hardware/audio.nix @@ -0,0 +1,20 @@ +{ config, pkgs, ... }: + +{ hardware.pulseaudio = { + enable = true; + support32Bit = true; + daemon.config = { + flat-volumes = "no"; + }; + package = if config.hardware.bluetooth.enable + then pkgs.pulseaudioFull + else pkgs.pulseaudio; + }; + + sound.enable = true; + + environment.systemPackages = with pkgs; [ + pamixer + pavucontrol + ]; +} diff --git a/system/settings/hardware/bare-metal.nix b/system/settings/hardware/bare-metal.nix new file mode 100644 index 00000000..0a61790a --- /dev/null +++ b/system/settings/hardware/bare-metal.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + fuse_exfat + cryptsetup + dmidecode + hdparm + pciutils + usbutils + ]; + + hardware.cpu.intel.updateMicrocode = true; + + boot.kernel.sysctl = { + "net.ipv4.tcp_allowed_congestion_control" = "illinois reno lp"; + "net.ipv4.tcp_congestion_control" = "illinois"; + }; + + zramSwap = { + enable = true; + algorithm = "zstd"; + }; + boot.tmpOnTmpfs = true; + + boot.kernelModules = [ "bfq" ]; + + fileSystems."/".options = [ "noatime" "nodiratime" ]; + fileSystems."/home".options = [ "noatime" "nodiratime" ]; +} diff --git a/system/settings/hardware/connman.nix b/system/settings/hardware/connman.nix new file mode 100644 index 00000000..0361f9cb --- /dev/null +++ b/system/settings/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/system/settings/hardware/grub2.nix b/system/settings/hardware/grub2.nix new file mode 100644 index 00000000..70e86e71 --- /dev/null +++ b/system/settings/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/system/settings/hardware/hidpi.nix b/system/settings/hardware/hidpi.nix new file mode 100644 index 00000000..1f4644c5 --- /dev/null +++ b/system/settings/hardware/hidpi.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ i18n = { + consoleFont = "ter-v24b"; + consolePackages = with pkgs; [ + terminus_font + ]; + }; +} diff --git a/system/settings/hardware/intel-gpu.nix b/system/settings/hardware/intel-gpu.nix new file mode 100644 index 00000000..fc6b6fa3 --- /dev/null +++ b/system/settings/hardware/intel-gpu.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: + +{ hardware.opengl.extraPackages = with pkgs; [ + vaapiIntel + vaapiVdpau + libvdpau-va-gl + ]; + + services.xserver.videoDrivers = [ "intel" "modesetting" ]; + + boot.earlyVconsoleSetup = true; + boot.initrd.kernelModules = [ + "i915" + ]; +} diff --git a/system/settings/hardware/keyboardio-model01.nix b/system/settings/hardware/keyboardio-model01.nix new file mode 100644 index 00000000..7a624f56 --- /dev/null +++ b/system/settings/hardware/keyboardio-model01.nix @@ -0,0 +1,13 @@ +{ 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" + ''; + + environment.systemPackages = with pkgs; [ + arduino_core + ]; + + environment.variables.ARDUINO_PATH = "${pkgs.arduino_core}/share/arduino"; +} diff --git a/system/settings/hardware/laptop.nix b/system/settings/hardware/laptop.nix new file mode 100644 index 00000000..17e27b63 --- /dev/null +++ b/system/settings/hardware/laptop.nix @@ -0,0 +1,87 @@ +{ config, pkgs, lib, ... }: + +{ boot.kernelModules = [ "coretemp" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + x86_energy_perf_policy + ]; + + hardware = { + bluetooth = { + enable = true; + powerOnBoot = false; + package = pkgs.bluezFull; + }; + pulseaudio = { + extraModules = with pkgs; [ + pulseaudio-modules-bt + ]; + }; + }; + 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; [ + blueman + bluez-tools + + powerstat + powertop + + arandr + autorandr + disper + ]; + + programs.light.enable = true; + + services.autorandr.enable = true; + + services.logind.extraConfig = '' + IdleAction=suspend + IdleActionSec=600 + ''; + + services.acpid = { + enable = true; + lidEventCommands = '' + ${pkgs.autorandr}/bin/autorandr --batch --change + ''; + }; + + services.tlp = { + enable = true; + extraConfig = '' + CPU_SCALING_GOVERNOR_ON_BAT=powersave + ENERGY_PERF_POLICY_ON_BAT="balance_power" + + SOUND_POWER_SAVE_ON_AC=60 + DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wwan" + ''; + }; + + services.xserver = { + libinput = { + enable = lib.mkDefault true; + naturalScrolling = true; + disableWhileTyping = true; + }; + displayManager.sessionCommands = '' + ${pkgs.autorandr}/bin/autorandr --change --force + ${pkgs.blueman}/bin/blueman-applet & + ''; + }; + + systemd.services.nixos-upgrade.unitConfig.ConditionACPower = true; + systemd.services.nix-gc.unitConfig.ConditionACPower = true; + systemd.services.docker-prune.unitConfig.ConditionACPower = true; + + imports = [ + ../user-interface.nix + ]; +} diff --git a/system/settings/hardware/mouse.nix b/system/settings/hardware/mouse.nix new file mode 100644 index 00000000..b30d4124 --- /dev/null +++ b/system/settings/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/system/settings/hardware/network-manager.nix b/system/settings/hardware/network-manager.nix new file mode 100644 index 00000000..f28548a1 --- /dev/null +++ b/system/settings/hardware/network-manager.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ networking.networkmanager = { + enable = true; + dns = "unbound"; + }; + + environment.systemPackages = with pkgs; [ + networkmanagerapplet + networkmanager_dmenu + ]; +} diff --git a/system/settings/hardware/nitrokey.nix b/system/settings/hardware/nitrokey.nix new file mode 100644 index 00000000..a77ce00c --- /dev/null +++ b/system/settings/hardware/nitrokey.nix @@ -0,0 +1,13 @@ +{ config, pkgs, lib, ... }: + +{ + hardware.nitrokey = { + enable = true; + }; + + services.pcscd.enable = true; + + environment.systemPackages = with pkgs; [ + nitrokey-app + ]; +} diff --git a/system/settings/hardware/nvidia-gpu.nix b/system/settings/hardware/nvidia-gpu.nix new file mode 100644 index 00000000..9fc34169 --- /dev/null +++ b/system/settings/hardware/nvidia-gpu.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ services.xserver.videoDrivers = [ "nvidia" ]; + nixpkgs.config.allowUnfree = true; +} diff --git a/system/settings/hardware/printing.nix b/system/settings/hardware/printing.nix new file mode 100644 index 00000000..96d3a959 --- /dev/null +++ b/system/settings/hardware/printing.nix @@ -0,0 +1,19 @@ +{ config, pkgs, lib, ... }: + +{ 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/system/settings/hardware/qwerty.nix b/system/settings/hardware/qwerty.nix new file mode 100644 index 00000000..c967d561 --- /dev/null +++ b/system/settings/hardware/qwerty.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + services.xserver = { + layout = "us"; + xkbVariant = "intl-unicode"; + xkbOptions = "altwin:prtsc_rwin,caps:escape"; + }; +} diff --git a/system/settings/hardware/synaptics.nix b/system/settings/hardware/synaptics.nix new file mode 100644 index 00000000..9f075cce --- /dev/null +++ b/system/settings/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/system/settings/hardware/systemd-boot.nix b/system/settings/hardware/systemd-boot.nix new file mode 100644 index 00000000..80e79fdc --- /dev/null +++ b/system/settings/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/system/settings/hardware/thinkpad.nix b/system/settings/hardware/thinkpad.nix new file mode 100644 index 00000000..903e819b --- /dev/null +++ b/system/settings/hardware/thinkpad.nix @@ -0,0 +1,26 @@ +{ config, pkgs, ... }: + +{ boot.kernelModules = [ ]; + boot.blacklistedKernelModules = [ "thinkpad_ec" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + acpi_call + ]; + + hardware.trackpoint = { + enable = true; + emulateWheel = true; + }; + + services.thinkfan = { + enable = true; + }; + + services.tlp = { + enable = true; + }; + + imports = [ + ./bare-metal.nix + ./laptop.nix + ]; +} diff --git a/system/settings/hardware/trackball.nix b/system/settings/hardware/trackball.nix new file mode 100644 index 00000000..9aa5abc0 --- /dev/null +++ b/system/settings/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/system/settings/hardware/trezor.nix b/system/settings/hardware/trezor.nix new file mode 100644 index 00000000..33cc6f25 --- /dev/null +++ b/system/settings/hardware/trezor.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +{ services.trezord.enable = true; + environment.systemPackages = with pkgs; [ + gnupg + pinentry + (python3.withPackages(ps: with ps; [ trezor_agent wheel ])) + ]; + programs.gnupg.agent = { + enable = lib.mkForce false; + enableSSHSupport = lib.mkForce false; + }; +} diff --git a/system/settings/kubernetes.nix b/system/settings/kubernetes.nix new file mode 100644 index 00000000..692e46d6 --- /dev/null +++ b/system/settings/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/system/settings/machines/t470s.nix b/system/settings/machines/t470s.nix new file mode 100644 index 00000000..4ee6c2ac --- /dev/null +++ b/system/settings/machines/t470s.nix @@ -0,0 +1,59 @@ +{ config, pkgs, ... }: + +{ hardware.usbWwan.enable = false; # unused + systemd.services.ModemManager.enable = false; + + hardware.firmware = with pkgs; [ + firmwareLinuxNonfree + ]; + + 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 + ''; + services.thinkfan.levels = '' + (0, 0, 48) + (1, 45, 52) + (2, 50, 57) + (3, 55, 63) + (6, 60, 65) + (7, 60, 85) + (127, 80, 32767) + ''; + + boot.kernelParams = [ + "i915.enable_guc=2" + "i915.enable_psr=1" + ]; + + boot.postBootCommands = '' + echo bfq > /sys/block/nvme0n1/queue/scheduler + ''; + + hardware.pulseaudio.extraConfig = '' + load-module module-alsa-sink device=hw:0,7 + ''; + + services.tlp.extraConfig = '' + DISK_DEVICES="nvme0n1" + DISK_IOSCHED="keep" + ''; + + services.xserver = { + dpi = 109; + monitorSection = '' + DisplaySize 310 176 + ''; + }; + + environment.systemPackages = with pkgs; [ + nvme-cli + ]; + + imports = [ + ../hardware/intel-gpu.nix + ../hardware/hidpi.nix + ../hardware/thinkpad.nix + ]; +} diff --git a/system/settings/machines/x250.nix b/system/settings/machines/x250.nix new file mode 100644 index 00000000..0e8ac04e --- /dev/null +++ b/system/settings/machines/x250.nix @@ -0,0 +1,33 @@ +{ config, pkgs, ... }: + +{ boot.extraModulePackages = with config.boot.kernelPackages; [ + acpi_call + ]; + + hardware.firmware = with pkgs; [ + firmwareLinuxNonfree + ]; + + 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/system/settings/programs/accounting.nix b/system/settings/programs/accounting.nix new file mode 100644 index 00000000..e98c3e7e --- /dev/null +++ b/system/settings/programs/accounting.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + ledger + bean-add + beancount + fava + reckon + ]; +} diff --git a/system/settings/programs/barrier.nix b/system/settings/programs/barrier.nix new file mode 100644 index 00000000..9a73620d --- /dev/null +++ b/system/settings/programs/barrier.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: { + environment.systemPackages = with pkgs; [ + barrier + ]; + + networking.firewall.allowedTCPPorts = [ 24800 ]; +} diff --git a/system/settings/programs/gnome.nix b/system/settings/programs/gnome.nix new file mode 100644 index 00000000..bd785453 --- /dev/null +++ b/system/settings/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/system/settings/programs/gnupg.nix b/system/settings/programs/gnupg.nix new file mode 100644 index 00000000..663bcb3c --- /dev/null +++ b/system/settings/programs/gnupg.nix @@ -0,0 +1,10 @@ +{ config, pkgs, lib, ... }: + +{ + environment.systemPackages = with pkgs; [ + gnupg + pinentry + (python3.withPackages(ps: with ps; [ trezor_agent wheel ])) + ]; + environment.variables.GNUPGHOME = "$HOME/.gnupg/trezor/"; +} diff --git a/system/settings/programs/i3.nix b/system/settings/programs/i3.nix new file mode 100644 index 00000000..b0140cdb --- /dev/null +++ b/system/settings/programs/i3.nix @@ -0,0 +1,20 @@ +{ config, pkgs, ... }: + +{ services.xserver.windowManager = { + default = "i3"; + i3 = { + enable = true; + extraSessionCommands = '' + ${pkgs.sxhkd}/bin/sxhkd & + ''; + }; + }; + + environment.systemPackages = with pkgs; [ + i3status + ]; + + imports = [ + ./window-manager.nix + ]; +} diff --git a/system/settings/programs/infrastructure.nix b/system/settings/programs/infrastructure.nix new file mode 100644 index 00000000..5e68bc8a --- /dev/null +++ b/system/settings/programs/infrastructure.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + hugo + + nixops + ]; +} diff --git a/system/settings/programs/kde.nix b/system/settings/programs/kde.nix new file mode 100644 index 00000000..652eb2a6 --- /dev/null +++ b/system/settings/programs/kde.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +with lib; +{ services = { + xserver = { + desktopManager = { + plasma5.enable = true; + }; + displayManager = { + sddm.enable = true; + }; + }; + + physlock.enable = lib.mkForce false; + }; + + environment.systemPackages = with pkgs; [ + kde-gtk-config + ]; +} diff --git a/system/settings/programs/keybase.nix b/system/settings/programs/keybase.nix new file mode 100644 index 00000000..39a16b27 --- /dev/null +++ b/system/settings/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/system/settings/programs/shell.nix b/system/settings/programs/shell.nix new file mode 100644 index 00000000..a8d4f56f --- /dev/null +++ b/system/settings/programs/shell.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ programs.zsh = { + enable = true; + promptInit = ""; + }; + programs.bash.enableCompletion = true; +} diff --git a/system/settings/programs/tor.nix b/system/settings/programs/tor.nix new file mode 100644 index 00000000..5524aede --- /dev/null +++ b/system/settings/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/system/settings/programs/window-manager.nix b/system/settings/programs/window-manager.nix new file mode 100644 index 00000000..7095d523 --- /dev/null +++ b/system/settings/programs/window-manager.nix @@ -0,0 +1,46 @@ +{ config, pkgs, ... }: + +{ services.xserver = { + desktopManager.xterm.enable = false; + + displayManager = { + lightdm = { + enable = true; + greeters.mini = { + enable = true; + user = "alan"; + }; + }; + sessionCommands = '' + ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.xresources/main + ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr -solid '#4d4d4c' + ''; + }; + xautolock = { + enable = true; + locker = "${pkgs.i3lock}/bin/i3lock -n"; + enableNotifier = true; + notifier = "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\""; + time = 5; + }; + }; + + services.xserver.displayManager.setupCommands = '' + ${pkgs.redshift}/bin/redshift \ + -l ${toString config.services.redshift.latitude}:${toString config.services.redshift.longitude} \ + -t ${toString config.services.redshift.temperature.day}:${toString config.services.redshift.temperature.night} \ + -b 1:1 \ + -o \ + -r \ + ''; + + environment.systemPackages = with pkgs; [ + dmenu + libnotify # for notify-send + rofi + sxhkd + maim + + perlPackages.FileMimeInfo # xdg-utils uses this when no DE + ]; +} diff --git a/system/settings/programs/wine.nix b/system/settings/programs/wine.nix new file mode 100644 index 00000000..98dd60a2 --- /dev/null +++ b/system/settings/programs/wine.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + wineStable + ]; +} diff --git a/system/settings/satoshipay.nix b/system/settings/satoshipay.nix new file mode 100644 index 00000000..9cc5a341 --- /dev/null +++ b/system/settings/satoshipay.nix @@ -0,0 +1,71 @@ +{ config, pkgs, fetchurl, lib, ... }: + +{ virtualisation = { + docker = let + daemonConfig = { + ipv6 = true; + fixed-cidr-v6 = "fd69:2074:9fcd:b0fd::/64"; + features = { + buildkit = true; + }; + }; + in { + enable = true; + enableOnBoot = false; + liveRestore = false; + + extraOptions = "--config-file=${pkgs.writeText "daemon.json" (builtins.toJSON daemonConfig)}"; + + autoPrune = { + enable = true; + }; + }; + }; + + services.mongodb = { + enable = true; + replSetName = "rs0"; + dbpath = "/tmp/mongodb"; + }; + systemd.services.mongodb.wantedBy = lib.mkForce []; + systemd.timers.mongodb = { + description = "Delayed startup of MongoDB"; + wantedBy = [ "timers.target" ]; + timerConfig = { + 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; + }; + 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; [ + ]; + + networking.domain = "satoshipay.io"; + + networking.extraHosts = '' + 127.0.0.1 blogger.local wallet.satoshipay.local api.satoshipay.local ws.satoshipay.local + ''; +} diff --git a/system/settings/services/syncthing.nix b/system/settings/services/syncthing.nix new file mode 100644 index 00000000..b6a12861 --- /dev/null +++ b/system/settings/services/syncthing.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ services.syncthing = { + enable = true; + user = "alan"; + group = "users"; + openDefaultPorts = true; + systemService = true; + dataDir = "/home/alan/.config/syncthing"; + }; +} diff --git a/system/settings/services/xserver.nix b/system/settings/services/xserver.nix new file mode 100644 index 00000000..d898f55a --- /dev/null +++ b/system/settings/services/xserver.nix @@ -0,0 +1,82 @@ +{ config, pkgs, ... }: + +{ services.xserver = { + enable = true; + enableCtrlAltBackspace = true; + exportConfiguration = true; + }; + + i18n.consoleUseXkbConfig = true; + + environment.systemPackages = with pkgs; [ + xorg.xmodmap + xorg.xinit + xorg.xev + xorg.xdpyinfo + xclip + xfontsel + + vanilla-dmz + capitaine-cursors + bibata-cursors + + arc-theme + hicolor_icon_theme + paper-gtk-theme + paper-icon-theme + + arc-icon-theme + tango-icon-theme + + gtk-engine-murrine + gtk_engines + ]; + + fonts = { + enableFontDir = true; + enableDefaultFonts = false; + fontconfig = { + useEmbeddedBitmaps = true; + defaultFonts = { + monospace = [ "Liberation Mono" ]; + sansSerif = [ "Liberation Sans" ]; + serif = [ "Liberation Serif" ]; + }; + penultimate = { + enable = true; + }; + ultimate = { + enable = false; + preset = "osx"; + }; + }; + fonts = with pkgs; [ + dina-font + envypn-font + profont + proggyfonts + terminus_font + terminus_font_ttf + + fantasque-sans-mono + emacs-all-the-icons-fonts + fira + fira-code + fira-mono + go-font + font-awesome_5 + ibm-plex + liberation_ttf + mononoki + roboto + roboto-mono + roboto-slab + source-code-pro + source-sans-pro + source-serif-pro + xorg.fontmiscmisc + xorg.fontcursormisc + xorg.fontbhlucidatypewriter100dpi + ]; + }; +} diff --git a/system/settings/services/zeroconf.nix b/system/settings/services/zeroconf.nix new file mode 100644 index 00000000..0b428c54 --- /dev/null +++ b/system/settings/services/zeroconf.nix @@ -0,0 +1,16 @@ +{ 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"; + }; + }; +} diff --git a/system/settings/user-interface.nix b/system/settings/user-interface.nix new file mode 100644 index 00000000..08d390ab --- /dev/null +++ b/system/settings/user-interface.nix @@ -0,0 +1,97 @@ +{ config, pkgs, lib, makeDesktopItem, ... }: + +{ documentation.info.enable = true; + nixpkgs.config.firefox.enableOfficialBranding = true; + + environment.pathsToLink = [ "/share/zsh" ]; + + environment.systemPackages = with pkgs; [ + aria2 + firefox + pcmanfm + + epdfview + geeqie + + cmus + + fish # for emacs-fish-completion + + lxappearance + lxrandr + lxtask + + python3Packages.keyring + isync + msmtp + html2text + + weechat + + mpv + + aspell + aspellDicts.en + + cifs-utils + hexchat + signal-desktop + wire-desktop + + trash-cli + ]; + + nixpkgs.config.allowUnfree = true; + + services.compton = { + enable = true; + backend = "glx"; + vSync = "opengl-swc"; + }; + + services.devmon.enable = true; + + 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: + GTK_DATA_PREFIX = "${config.system.path}"; + }; + + services.redshift = { + enable = true; + temperature = { + day = 6500; + night = 3600; + }; + }; + + programs.ssh.startAgent = true; + + programs.dconf.enable = true; + services.gnome3 = { + gnome-keyring.enable = true; + seahorse.enable = true; + at-spi2-core.enable = true; + }; + + imports = [ + ./services/xserver.nix + ]; +} diff --git a/system/trillian.nix b/system/trillian.nix index 184fa906..21245fe8 100644 --- a/system/trillian.nix +++ b/system/trillian.nix @@ -4,8 +4,8 @@ imports = [ ./private/default.nix - ./modules/programs/accounting.nix - ./modules/programs/shell.nix + ./settings/programs/accounting.nix + ./settings/programs/shell.nix ]; nixpkgs.config = { diff --git a/user/modules/autorandr.nix b/user/modules/autorandr.nix deleted file mode 100644 index f63095a4..00000000 --- a/user/modules/autorandr.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ - xdg.configFile.autorandr = { - recursive = true; - source = ../autorandr/.config/autorandr; - }; -} diff --git a/user/modules/base.nix b/user/modules/base.nix deleted file mode 100644 index cc83cb47..00000000 --- a/user/modules/base.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, pkgs, ... }: - -{ - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - manual = { - html.enable = true; - }; - home.packages = with pkgs; [ - pv - fd - unstable.sd - entr - file - htop - lsof - iftop - nmap - moreutils - mtr - tree - zip - telnet - ] ++ ( - if !stdenv.isDarwin - then [ - vim - unar - ] else [ - ]); -} diff --git a/user/modules/darwin.nix b/user/modules/darwin.nix deleted file mode 100644 index b3c4d7d7..00000000 --- a/user/modules/darwin.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ config, pkgs, ... }: - -{ - 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 - ''; - }) - ]; - home.packages = with pkgs; [ - aspell - aspellDicts.en - darwin-zsh-completions - ]; - - programs.zsh.shellAliases = { - da = "darwin-rebuild"; - das = "darwin-rebuild switch"; - }; - - # Use GPG from GPGTools - programs.git.signing.gpgPath = "/usr/local/bin/gpg"; -} diff --git a/user/modules/development/base.nix b/user/modules/development/base.nix deleted file mode 100644 index 3ea20fc1..00000000 --- a/user/modules/development/base.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, pkgs, ... }: - -{ home.packages = with pkgs; [ - checkbashisms - editorconfig-core-c - go - - mosh - - wrk - - ag - (ripgrep.override { withPCRE2 = true; }) - - httpie - jq - - discount - ] ++ ( - if !stdenv.isDarwin - then [ - ldns - httping - http-prompt - firefox-devedition-bin - ] else [ - ] - ); -} diff --git a/user/modules/development/lisp.nix b/user/modules/development/lisp.nix deleted file mode 100644 index b8d465ee..00000000 --- a/user/modules/development/lisp.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ home.packages = with pkgs; [ - ccl - sbcl - lispPackages.quicklisp - asdf - cl-launch - - dust - pixie - ]; -} diff --git a/user/modules/dunst.nix b/user/modules/dunst.nix deleted file mode 100644 index 6d74b51b..00000000 --- a/user/modules/dunst.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ config, pkgs, ... }: - -{ - services.dunst = { - enable = true; - settings = { - global = { - font = "Monospace 13"; - geometry = "300x10-10+30"; - follow = "none"; - sticky_history = "yes"; - history_length = 20; - show_indicators = "yes"; - separator_height = 2; - padding = 8; - horizontal_padding = 8; - idle_threshold = 30; - - indicate_hidden = "no"; - - allow_markup = "yes"; - format = "%s\n%b"; - word_wrap = "yes"; - ignore_newline = "no"; - - separator_color = "frame"; - }; - frame = { - width = 1; - color = "#383838"; - }; - shortcuts = { - close = "mod4+apostrophe"; - close_all = "mod4+shift+apostrophe"; - history = "mod4+grave"; - context = "mod4+shift+period"; - }; - urgency_low = { - background = "#b8b8b8"; - foreground = "#f8f8f8"; - timeout = 10; - }; - - urgency_normal = { - background = "#7cafc2"; - foreground = "#f8f8f8"; - timeout = 10; - }; - - urgency_critical = { - background = "#ab4642"; - foreground = "#f8f8f8"; - timeout = 0; - }; - }; - }; -} diff --git a/user/modules/emacs.nix b/user/modules/emacs.nix deleted file mode 100644 index 9f542391..00000000 --- a/user/modules/emacs.nix +++ /dev/null @@ -1,169 +0,0 @@ -{ config, pkgs, lib, ... }: - -let - inherit (pkgs) stdenv; - - pkgsUnstable = if stdenv.isDarwin then import {} else import {}; - - editorScript = pkgs.writeScriptBin "edit" '' - #!${pkgs.runtimeShell} - if [ -z "$1" ]; then - exec ${config.programs.emacs.finalPackage}/bin/emacsclient --create-frame --alternate-editor ${config.programs.emacs.finalPackage}/bin/emacs - else - exec ${config.programs.emacs.finalPackage}/bin/emacsclient --alternate-editor ${config.programs.emacs.finalPackage}/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=${editorScript}/bin/edit %F - Icon=emacs - Type=Application - Terminal=false - Categories=Development;TextEditor; - StartupWMClass=Emacs - Keywords=Text;Editor; - ''; - }; -in -{ - programs.emacs = { - enable = true; - extraPackages = epkgs: (with epkgs; [ - ace-link - all-the-icons - almost-mono-themes - add-node-modules-path - ag - all-the-icons - amx - auto-async-byte-compile - avy - basic-theme - bash-completion - caddyfile-mode - company - company-web - company-tabnine - counsel - counsel-projectile - crux - docker-compose-mode - dockerfile-mode - dired-git-info - editorconfig - 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 - evil-magit - evil-mu4e - evil-org - evil-quickscope - evil-space - evil-surround - eyebrowse - feature-mode - fish-completion - flycheck - flymake-diagnostic-at-point - general - git-gutter-fringe - git-messenger - git-timemachine - gitattributes-mode - gitconfig-mode - gitignore-mode - gitlab-ci-mode - gitlab-ci-mode-flycheck - goto-chg - haskell-mode - helpful - ivy-hydra - jinja2-mode - js2-mode - json-mode - k8s-mode - # kubernetes - # kubernetes-evil - ledger-mode - lsp-mode - lsp-ui - lsp-haskell - lsp-treemacs - magit - markdown-mode - minions - monotropic-theme - moody - nginx-mode - nix-mode - nix-update - org-journal - paredit - php-mode - posframe - prettier-js - projectile - projectile-ripgrep - quickrun - rainbow-mode - relative-buffers - restclient - ripgrep - rjsx-mode - scss-mode - spacemacs-theme - swiper - toml-mode - typescript-mode - undo-tree - use-package - web-mode - wgrep-ag - ws-butler - which-key - yaml-mode - ] ++ lib.optionals (!stdenv.isDarwin) [ - pkgs.mu - ]); - }; - home.packages = [ - editorScript - ]; - nixpkgs.overlays = [ - (self: super: { - emacsPackagesNgGen = pkgsUnstable.emacsPackagesNgGen; - emacs = pkgsUnstable.emacs; - }) - ]; - home.sessionVariables = { - EDITOR = "${editorScript}/bin/edit"; - }; - home.file.".emacs.d/init.el" = { - source = ../emacs/.emacs.d/init.el; - onChange = '' - ${config.programs.emacs.finalPackage}/bin/emacs -batch -f batch-byte-compile .emacs.d/init.el - ''; - }; - home.file.".emacs.d/eshell/" = { - recursive = true; - source = ../emacs/.emacs.d/eshell; - }; - - home.file.".local/share/applications/emacsclient.desktop".source = desktopApplicationFile; -} diff --git a/user/modules/gaming.nix b/user/modules/gaming.nix deleted file mode 100644 index 022846ca..00000000 --- a/user/modules/gaming.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - unstable.steam - ( - unstable.winePackages.unstable.override { - pngSupport = true; - jpegSupport = true; - tiffSupport = true; - gettextSupport = true; - fontconfigSupport = true; - alsaSupport = true; - gtkSupport = true; - openglSupport = true; - tlsSupport = true; - gstreamerSupport = true; - cupsSupport = true; - colorManagementSupport = true; - dbusSupport = true; - mpg123Support = true; - openalSupport = true; - openclSupport = true; - cairoSupport = true; - odbcSupport = true; - netapiSupport = true; - cursesSupport = true; - vaSupport = true; - pcapSupport = true; - v4lSupport = true; - saneSupport = true; - gsmSupport = true; - gphoto2Support = true; - ldapSupport = true; - pulseaudioSupport = true; - udevSupport = true; - xineramaSupport = true; - xmlSupport = true; - vulkanSupport = true; - sdlSupport = true; - } - ) - unstable.lutris - ]; -} diff --git a/user/modules/git.nix b/user/modules/git.nix deleted file mode 100644 index 503b9e3f..00000000 --- a/user/modules/git.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - gitAndTools.git-extras - ]; - programs.git = { - enable = true; - userName = "Alan Pearce"; - userEmail = "alan@alanpearce.eu"; - extraConfig = { - pull = { - rebase = true; - }; - push = { - default = "current"; - followTags = true; - }; - rebase = { - autosquash = true; - }; - rerere = { - enable = true; - }; - diff = { - algorithm = "patience"; - tool = "icdiff"; - }; - difftool = { - prompt = false; - }; - "difftool.icdiff" = { - cmd = "${pkgs.icdiff}/bin/icdiff --line-numbers $LOCAL $REMOTE"; - }; - "difftool.sopsdiffer" = { - textconf = "${pkgs.sops}/bin/sops -d"; - }; - "merge.npm-merge-driver" = { - name = "automatically merge npm lockfiles"; - driver = "npx npm-merge-driver merge %A %O %B %P"; - }; - remote = { - autoSetupMerge = true; - }; - "branch.master" = { - rebase = false; - }; - }; - signing = { - key = "0xCD4BEB92A8D46583"; - }; - lfs = { - enable = true; - }; - aliases = { - authors = "shortlog -s -n"; - mup = "merge FETCH_HEAD"; - rup = "rebase FETCH_HEAD"; - st = "status -sb"; - ci = "commit"; - br = "branch"; - co = "checkout"; - lasttag = "!sh -c 'git tag --sort=version:refname | grep \"^v\\\\?[0-9]\" | tail -n1'"; - pending = "!sh -c 'git log --oneline --grep=\"#\" ...$(git lasttag)'"; - lg = "log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %Cred%d%Creset'"; - prl = "log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %Cred%d%Creset' --grep='#'"; - ignored = "ls-files --others -i --exclude-standard"; - }; - ignores = [ - ".DS_Store" - "*_flymake.*" - "*~" - "\#*\#" - ".\#*" - ]; - }; -} diff --git a/user/modules/gnupg.nix b/user/modules/gnupg.nix deleted file mode 100644 index 6dcb31f2..00000000 --- a/user/modules/gnupg.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.file.".gnupg" = { - recursive = true; - source = ../gnupg/.gnupg; - }; -} diff --git a/user/modules/i3.nix b/user/modules/i3.nix deleted file mode 100644 index d83ee2e7..00000000 --- a/user/modules/i3.nix +++ /dev/null @@ -1,149 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - xdg.configFile.i3status = { - recursive = true; - source = ../i3/.config/i3status; - }; - xsession.windowManager.i3 = let - mod = "Mod4"; - mode_system = "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown"; - locker = "${pkgs.xautolock}/bin/xautolock -locknow"; - in - { - enable = true; - config = { - modifier = mod; - fonts = [ "Terminus 12px" ]; - floating = { - criteria = [ - { class = "Pinentry$"; } - ]; - }; - window = { - titlebar = false; - }; - keybindings = { - "${mod}+Return" = "exec --no-startup-id xst"; - # kill focused window - "${mod}+w" = "kill"; - "${mod}+Shift+w" = "kill"; - - "--release ${mod}+Mod1+r" = "exec rofi -show run"; - "--release ${mod}+Shift+semicolon" = "exec rofi-pass"; - "--release ${mod}+space" = "exec \"rofi -show combi -combi-modi drun,window\""; - - # change focus - "${mod}+h" = "focus left"; - "${mod}+j" = "focus down"; - "${mod}+k" = "focus up"; - "${mod}+l" = "focus right"; - - "${mod}+1" = "workspace 1"; - "${mod}+2" = "workspace 2"; - "${mod}+3" = "workspace 3"; - "${mod}+4" = "workspace 4"; - "${mod}+5" = "workspace 5"; - "${mod}+6" = "workspace 6"; - "${mod}+7" = "workspace 7"; - "${mod}+8" = "workspace 8"; - "${mod}+9" = "workspace 9"; - "${mod}+0" = "workspace 10"; - - # move focused window - "${mod}+Shift+h" = "move left"; - "${mod}+Shift+j" = "move down"; - "${mod}+Shift+k" = "move up"; - "${mod}+Shift+l" = "move right"; - - "${mod}+Shift+1" = "move container to workspace 1"; - "${mod}+Shift+2" = "move container to workspace 2"; - "${mod}+Shift+3" = "move container to workspace 3"; - "${mod}+Shift+4" = "move container to workspace 4"; - "${mod}+Shift+5" = "move container to workspace 5"; - "${mod}+Shift+6" = "move container to workspace 6"; - "${mod}+Shift+7" = "move container to workspace 7"; - "${mod}+Shift+8" = "move container to workspace 8"; - "${mod}+Shift+9" = "move container to workspace 9"; - - - # move workspace - "${mod}+Mod1+h" = "move workspace to output left"; - "${mod}+Mod1+j" = "move workspace to output down"; - "${mod}+Mod1+k" = "move workspace to output up"; - "${mod}+Mod1+l" = "move workspace to output right"; - - # split in horizontal orientation - "${mod}+b" = "split h"; - - # split in vertical orientation - "${mod}+v" = "split v"; - - "${mod}+F11" = "fullscreen toggle"; - "${mod}+f" = "fullscreen toggle"; - - # change container layout (stacked, tabbed, toggle split) - "${mod}+Shift+s" = "layout stacking"; - "${mod}+Shift+t" = "layout tabbed"; - "${mod}+Shift+v" = "layout toggle split"; - - # toggle tiling / floating - "${mod}+Shift+f" = "floating toggle"; - - # change focus between tiling / floating windows - "${mod}+Tab" = "focus mode_toggle"; - - # focus the parent container - "${mod}+a" = "focus parent"; - - # focus the child container - "${mod}+d" = "focus child"; - - "${mod}+Shift+c" = "reload"; - "${mod}+Shift+p" = "restart"; - - "${mod}+Shift+r" = "mode resize"; - "${mod}+Shift+o" = "exec ${locker}"; - "${mod}+Pause" = "mode \"${mode_system}\""; - "${mod}+Escape" = "mode \"${mode_system}\""; - "${mod}+Shift+q" = "mode \"${mode_system}\""; - }; - - modes = { - resize = { - "h" = "resize shrink width 10 px or 10 ppt"; - "j" = "resize grow height 10 px or 10 ppt"; - "k" = "resize shrink height 10 px or 10 ppt"; - "l" = "resize grow width 10 px or 10 ppt"; - - "Left" = "resize shrink width 10 px or 10 ppt"; - "Down" = "resize grow height 10 px or 10 ppt"; - "Up" = "resize shrink height 10 px or 10 ppt"; - "Right" = "resize grow width 10 px or 10 ppt"; - - "Return" = "mode default"; - "Escape" = "mode default"; - }; - "${mode_system}" = { - "l" = "exec --no-startup-id ${locker}, mode default"; - "e" = "exec --no-startup-id i3-msg exit, mode default"; - "s" = "exec --no-startup-id systemctl suspend, mode default"; - "h" = "exec --no-startup-id systemctl hibernate, mode default"; - "r" = "exec --no-startup-id systemctl reboot, mode default"; - "Shift+s" = "exec --no-startup-id systemctl poweroff -i, mode default"; - "Return" = "mode default"; - "Escape" = "mode default"; - }; - }; - - bars = [ - { - fonts = [ "Terminus 12px" ]; - position = "top"; - hiddenState = "show"; - statusCommand = "${pkgs.i3status}/bin/i3status -c ~/.config/i3status/config"; - } - ]; - }; - }; -} diff --git a/user/modules/isync.nix b/user/modules/isync.nix deleted file mode 100644 index b96db87d..00000000 --- a/user/modules/isync.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.file.".mbsyncrc".source = ../isync/.mbsyncrc; -} diff --git a/user/modules/javascript.nix b/user/modules/javascript.nix deleted file mode 100644 index 4c75ea10..00000000 --- a/user/modules/javascript.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ config, pkgs, ... }: - -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 -{ home.packages = (with pkgs.unstable; [ - node - ] ++ ( - if stdenv.isDarwin - then - [ - ] - else - [ - # npm install may use any of these - binutils - gcc - gnumake - python2 - ] - )) ++ (with npmPackages; [ - node-gyp - node-gyp-build - node-pre-gyp - - tern - node2nix - nodemon - javascript-typescript-langserver - typescript-language-server - vscode-css-languageserver-bin - vscode-html-languageserver-bin - csslint - eslint_d - prettier - typescript - - node2nixPackages.bunyan - node2nixPackages.pino-pretty - node2nixPackages."pnpm-3.6.2" - node2nixPackages.prettier_d - node2nixPackages.dockerfile-language-server-nodejs - node2nixPackages.yaml-language-server - ]); - home.file.".npmrc".text = '' - prefix=''${HOME}/.local - //registry.npmjs.org/:_authToken=''${NPM_AUTH_TOKEN} - always-auth=true - sign-git-tag=true - rebuild-bundle=false - update-notifier=false - registry=https://registry.npmjs.org/ - ''; -} diff --git a/user/modules/ledger.nix b/user/modules/ledger.nix deleted file mode 100644 index 61d3df7e..00000000 --- a/user/modules/ledger.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.file.".ledgerrc".text = '' - --date-format %F - --start-of-week 1 - ''; -} diff --git a/user/modules/msmtp.nix b/user/modules/msmtp.nix deleted file mode 100644 index 45c2f460..00000000 --- a/user/modules/msmtp.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.file.".msmtprc".source = ../msmtp/.msmtprc; -} diff --git a/user/modules/nix.nix b/user/modules/nix.nix deleted file mode 100644 index d0de3cab..00000000 --- a/user/modules/nix.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, pkgs, ... }: - -{ - nixpkgs.config = import ../config.nix; -} diff --git a/user/modules/nixos.nix b/user/modules/nixos.nix deleted file mode 100644 index 64b523b8..00000000 --- a/user/modules/nixos.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ - ./nix.nix - ]; - nixpkgs.overlays = [ - (self: super: { - unstable = import { - config = config.nixpkgs.config; - }; - }) - ]; - - programs.zsh.shellAliases = { - nor = "nixos-rebuild"; - nors = "nixos-rebuild switch"; - norb = "nixos-rebuild boot"; - norr = "nixos-rebuild switch --rollback"; - }; -} diff --git a/user/modules/nixpkgs.nix b/user/modules/nixpkgs.nix deleted file mode 100644 index b89579e1..00000000 --- a/user/modules/nixpkgs.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ - ./nix.nix - ]; - nixpkgs.overlays = [ - (self: super: { - unstable = self; - }) - ]; -} diff --git a/user/modules/passwords.nix b/user/modules/passwords.nix deleted file mode 100644 index 72493cef..00000000 --- a/user/modules/passwords.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs.unstable; [ - keepassx-community - rofi-pass - pass-otp - pwgen - ]; -} diff --git a/user/modules/rofi.nix b/user/modules/rofi.nix deleted file mode 100644 index b34af881..00000000 --- a/user/modules/rofi.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, pkgs, ... }: - -{ - xdg.configFile."networkmanager-dmenu/config.ini".text = '' - [dmenu] - dmenu_command = /run/current-system/sw/bin/rofi - - [editor] - terminal = xst - gui_if_available = false - ''; - programs.rofi = { - enable = true; - extraConfig = '' - rofi.matching: glob - rofi.separator-style: none - - rofi.line-padding: 2 - - rofi.display-run: cmd - rofi.display-drun: run - rofi.display-window: win - ''; - }; -} diff --git a/user/modules/satoshipay.nix b/user/modules/satoshipay.nix deleted file mode 100644 index 6516bd59..00000000 --- a/user/modules/satoshipay.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ config, pkgs, ... }: - -let - inherit (pkgs) stdenv; - spGitConfig = { - user.email = "alan@satoshipay.io"; - }; -in -{ - imports = [ - ./javascript.nix - ]; - - home.sessionVariables = { - KUBECTX_IGNORE_FZF = "1"; - }; - home.packages = with pkgs; ([ - caddy - openssl - mongodb-tools - pgcli - s3cmd - sops - - unstable.mkcert - unstable.google-cloud-sdk - unstable.docker_compose - unstable.kubernetes - unstable.kubectx - unstable.kubernetes-helm - unstable.helmfile - ] ++ (lib.optionals (!stdenv.isDarwin) - [ - pgadmin - - unstable.redis-desktop-manager - unstable.robo3t - unstable.slack - ])); - - programs.git.includes = [ - { - condition = "gitdir:~/projects/github.com/satoshipay/"; - contents = spGitConfig; - } - { - condition = "gitdir:~/projects/gitlab.satoshipay.tech"; - contents = spGitConfig; - } - ]; - - home.file.".npmrc".text = '' - @satoshipay:registry=https://registry.npmjs.org/ - ''; -} diff --git a/user/modules/sxhkd.nix b/user/modules/sxhkd.nix deleted file mode 100644 index 7160ec08..00000000 --- a/user/modules/sxhkd.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, pkgs, ... }: - -{ - xdg.configFile."sxhkd/sxhkdrc".text = '' - XF86AudioMute - pamixer --toggle-mute - - XF86Audio{Lower,Raise}Volume - pamixer --{decrease,increase} 1 - - @XF86AudioMicMute - pamixer --source 2 --toggle-mute - - XF86MonBrightness{Down,Up} - light -{U,A} 2% - - XF86Display - disper -C - - XF86AudioPlay - cmus-remote --pause - - XF86Audio{Prev,Next} - cmus-remote --{prev,next} - - XF86Tools - networkmanager_dmenu - ''; -} diff --git a/user/modules/tabnine.nix b/user/modules/tabnine.nix deleted file mode 100644 index 8018bcca..00000000 --- a/user/modules/tabnine.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ config, pkgs, ... }: - -let - cfg = { - config = { - "language.typescript" = { - command = "typescript-language-server"; - args = ["--stdio"]; - }; - "language.javascript" = { - command = "javascript-typescript-stdio"; - args = ["--stdio"]; - }; - "language.css" = { - command = "css-languageserver"; - args = ["--stdio"]; - }; - "language.scss" = { - command = "css-languageserver"; - args = ["--stdio"]; - }; - "language.html" = { - command = "html-languageserver"; - args = ["--stdio"]; - }; - "language.dockerfile" = { - command = "docker-langserver"; - args = ["--stdio"]; - }; - "language.yaml" = { - command = "yaml-language-server"; - args = ["--stdio"]; - }; - "language.haskell" = { - command = "hie"; - args = ["--stdio"]; - }; - }; - }; - configFile = config: - pkgs.runCommand "TabNine.toml" - { - buildInputs = [ pkgs.remarshal ]; - preferLocalBuild = true; - allowSubstitutes = false; - } - '' - remarshal -if json -of toml \ - < ${pkgs.writeText "config.json" (builtins.toJSON cfg.config)} \ - > $out - ''; -in -{ - xdg.configFile."TabNine/TabNine.toml" = { - source = configFile cfg.config; - }; -} diff --git a/user/modules/trezor.nix b/user/modules/trezor.nix deleted file mode 100644 index a4f3ba75..00000000 --- a/user/modules/trezor.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.file.".ssh/agent.config" = { - text = '' - ecdsa-curve-name = ed25519 - ''; - }; -} diff --git a/user/modules/user-interface.nix b/user/modules/user-interface.nix deleted file mode 100644 index 31ba349d..00000000 --- a/user/modules/user-interface.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, pkgs, ... }: - -let - inherit (pkgs) stdenv; -in -{ - home.sessionVariables = { - TERMINAL = "${pkgs.unstable.xst}/bin/xst"; - }; - - home.packages = with pkgs; [ - unstable.xst # st, but with support for XResources - ] ++ lib.optionals (!stdenv.isDarwin) [ - pkgs.sshfs - pkgs.unstable.mu - ]; -} diff --git a/user/modules/xresources.nix b/user/modules/xresources.nix deleted file mode 100644 index 475113de..00000000 --- a/user/modules/xresources.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.file.".xresources" = { - recursive = true; - source = ../xresources/.xresources; - }; -} diff --git a/user/modules/zsh.nix b/user/modules/zsh.nix deleted file mode 100644 index 467c426b..00000000 --- a/user/modules/zsh.nix +++ /dev/null @@ -1,181 +0,0 @@ -{ config, pkgs, ... }: - -let - inherit (pkgs) stdenv; - lsOptions = if stdenv.isDarwin then "-p" else "-v --group-directories-first"; - lsIsoDate = if stdenv.isDarwin then "" else "--time-style=long-iso"; -in -{ - home.file = { - ".rm_recycle_home".text = ""; # use trash automatically in home directory - }; - home.packages = with pkgs; [ - fzf - ghq - ] ++ (if stdenv.isDarwin - then [] - else [ - pkgs.git - ]); - xdg.configFile.zsh = { - recursive = true; - source = ../zsh/.config/zsh; - }; - - home.file.".zplugin/bin" = { - source = pkgs.fetchFromGitHub { - owner = "zdharma"; - repo = "zplugin"; - rev = "028b1e1d6d3eae204b499c7f815f4eeeb5051517"; - sha256 = "1ynh323905iia3gwi9qghbywp94x306nna1yqk37frj5g7kg90fa"; - }; - }; - - programs.zsh = { - enable = true; - - enableAutosuggestions = true; - enableCompletion = true; - defaultKeymap = "emacs"; - - dotDir = ".config/zsh"; - - history = { - expireDuplicatesFirst = true; - extended = true; - path = ".cache/zsh/history"; - save = 20000; - size = 10000; - }; - - localVariables = { - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=7"; - }; - - shellAliases = { - l = "ls ${lsOptions} -Bp"; - l1="ls -1"; - ls="ls ${lsOptions} -hF"; - la="ls ${lsOptions} -hA"; - ll="ls ${lsOptions} ${lsIsoDate} -hl"; - lal="ll -A"; - lla="lal"; - llr="ll -t"; - - https = "http --default-scheme https"; - kns = "kubens"; - kx = "kubectx"; - ava = "pnpx ava"; - avt = "pnpx ava --tap"; - avat = "pnpx ava --tap"; - pino = "pino-pretty"; - mocha = "pnpx mocha"; - prettier = "pnpx prettier"; - standard = "pnpx standard"; - tsc = "pnpx tsc"; - tslint = "pnpx tslint"; - tsnode = "pnpx ts-node"; - - history = "fc -l $(( $LINES - 2 ))"; - hist-freq-lines = "fc -l -2000 | cut -d' ' -f4- | sort | uniq -c | sort -g | tail -n100 | less"; - hist-freq-commands = "fc -l -2000 | cut -d' ' -f4 | sort | uniq -c | sort -g | tail -n10 | less"; - wprop = "xprop | egrep '^WM_(CLASS|NAME|WINDOW_ROLE|TYPE)'"; - - # Enable the following commands to support aliases. - sudo = "sudo "; - watch = "watch "; - - g = "rg"; - - ga = "git add"; - gi = "git"; - gs = "git st"; - gd = "git diff"; - gf = "git fetch"; - gk = "git push"; - gj = "git pull"; - gl = "git lg"; - gr = "git remote"; - gz = "git stash"; - gzl = "git stash list"; - gzp = "git stash pop"; - gdt = "git difftool"; - grl = "git reflog"; - gri = "git rebase --interactive"; - grs = "git reset"; - grsh = "git reset --hard"; - gsh = "git show"; - gsm = "git submodule"; - gci = "git commit"; - gco = "git checkout"; - gbr = "git br"; - gbrc = "git checkout -b"; - gbrd = "git branch --delete"; - gbrm = "git branch --move"; - gmup = "git mup"; - grup = "git rup"; - - hos = "home-manager switch"; - hon = "home-manager news"; - hoh = "home-manager-help"; - - n = "nix-env"; - ni = "nix-env -iA"; - nq = "nix-env -q"; - ne = "nix-env -e"; - nup = "nix-env -u"; - ngc = "nix-collect-garbage --delete-older-than 14d"; - }; - - # move to envExtra after 19.09 - initExtra = '' - case $OSTYPE in - darwin*) - os=darwin - ;; - linux-gnu) - os=linux - ;; - freebsd*) - os=freebsd - ;; - *) - os=unknown - ;; - esac - - case $MACHTYPE in - *64) - arch=amd64 - ;; - *) - arch=386 - ;; - esac - if [[ ''${path[(I)$HOME/.local/bin ]} ]] - then - path+=($HOME/.local/bin) - fi - - if [[ ''${path[(I)$HOME/go/bin ]} ]] - then - path+=($HOME/go/bin) - fi - - if [[ $HOST =~ satoshi ]] - then - EMAIL=alan@satoshipay.io - else - EMAIL=alan@alanpearce.eu - fi - - typeset -T GHQ_ROOT ghq_root - export GHQ_ROOT="$HOME/projects:$HOME/go/src:$HOME/quicklisp/local-projects" - - function hist-freq-subcommands () { - fc -l -m "$1*" -2000 | cut -d' ' -f4- | sort | uniq -c | sort -g | tail -n100 | less - } - - '' + builtins.readFile ../zsh/.config/zsh/.zshrc; - }; -} diff --git a/user/prefect.nix b/user/prefect.nix index 3ad2ccc0..00005162 100644 --- a/user/prefect.nix +++ b/user/prefect.nix @@ -2,24 +2,24 @@ { imports = [ - ./modules/base.nix - ./modules/dunst.nix - ./modules/emacs.nix - ./modules/development/base.nix - ./modules/development/lisp.nix - ./modules/gaming.nix - ./modules/git.nix - ./modules/gnupg.nix - ./modules/i3.nix - ./modules/javascript.nix - ./modules/nixos.nix - ./modules/rofi.nix - ./modules/passwords.nix - ./modules/satoshipay.nix - ./modules/sxhkd.nix - ./modules/tabnine.nix - ./modules/user-interface.nix - ./modules/xresources.nix - ./modules/zsh.nix + ./settings/base.nix + ./settings/dunst.nix + ./settings/emacs.nix + ./settings/development/base.nix + ./settings/development/lisp.nix + ./settings/gaming.nix + ./settings/git.nix + ./settings/gnupg.nix + ./settings/i3.nix + ./settings/javascript.nix + ./settings/nixos.nix + ./settings/rofi.nix + ./settings/passwords.nix + ./settings/satoshipay.nix + ./settings/sxhkd.nix + ./settings/tabnine.nix + ./settings/user-interface.nix + ./settings/xresources.nix + ./settings/zsh.nix ]; } diff --git a/user/satoshipad.nix b/user/satoshipad.nix index 5f26c36d..3dda7bd1 100644 --- a/user/satoshipad.nix +++ b/user/satoshipad.nix @@ -2,27 +2,27 @@ { imports = [ - ./modules/autorandr.nix - ./modules/base.nix - ./modules/development/base.nix - ./modules/dunst.nix - ./modules/emacs.nix - ./modules/git.nix - ./modules/gnupg.nix - ./modules/i3.nix - ./modules/isync.nix - ./modules/javascript.nix - ./modules/msmtp.nix - ./modules/nixos.nix - ./modules/rofi.nix - ./modules/passwords.nix - ./modules/satoshipay.nix - ./modules/sxhkd.nix - ./modules/tabnine.nix - ./modules/trezor.nix - ./modules/user-interface.nix - ./modules/xresources.nix - ./modules/zsh.nix + ./settings/autorandr.nix + ./settings/base.nix + ./settings/development/base.nix + ./settings/dunst.nix + ./settings/emacs.nix + ./settings/git.nix + ./settings/gnupg.nix + ./settings/i3.nix + ./settings/isync.nix + ./settings/javascript.nix + ./settings/msmtp.nix + ./settings/nixos.nix + ./settings/rofi.nix + ./settings/passwords.nix + ./settings/satoshipay.nix + ./settings/sxhkd.nix + ./settings/tabnine.nix + ./settings/trezor.nix + ./settings/user-interface.nix + ./settings/xresources.nix + ./settings/zsh.nix ]; xsession.windowManager.i3 = { diff --git a/user/settings/autorandr.nix b/user/settings/autorandr.nix new file mode 100644 index 00000000..f63095a4 --- /dev/null +++ b/user/settings/autorandr.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + xdg.configFile.autorandr = { + recursive = true; + source = ../autorandr/.config/autorandr; + }; +} diff --git a/user/settings/base.nix b/user/settings/base.nix new file mode 100644 index 00000000..cc83cb47 --- /dev/null +++ b/user/settings/base.nix @@ -0,0 +1,31 @@ +{ config, pkgs, ... }: + +{ + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + manual = { + html.enable = true; + }; + home.packages = with pkgs; [ + pv + fd + unstable.sd + entr + file + htop + lsof + iftop + nmap + moreutils + mtr + tree + zip + telnet + ] ++ ( + if !stdenv.isDarwin + then [ + vim + unar + ] else [ + ]); +} diff --git a/user/settings/darwin.nix b/user/settings/darwin.nix new file mode 100644 index 00000000..b3c4d7d7 --- /dev/null +++ b/user/settings/darwin.nix @@ -0,0 +1,49 @@ +{ config, pkgs, ... }: + +{ + 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 + ''; + }) + ]; + home.packages = with pkgs; [ + aspell + aspellDicts.en + darwin-zsh-completions + ]; + + programs.zsh.shellAliases = { + da = "darwin-rebuild"; + das = "darwin-rebuild switch"; + }; + + # Use GPG from GPGTools + programs.git.signing.gpgPath = "/usr/local/bin/gpg"; +} diff --git a/user/settings/development/base.nix b/user/settings/development/base.nix new file mode 100644 index 00000000..3ea20fc1 --- /dev/null +++ b/user/settings/development/base.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ home.packages = with pkgs; [ + checkbashisms + editorconfig-core-c + go + + mosh + + wrk + + ag + (ripgrep.override { withPCRE2 = true; }) + + httpie + jq + + discount + ] ++ ( + if !stdenv.isDarwin + then [ + ldns + httping + http-prompt + firefox-devedition-bin + ] else [ + ] + ); +} diff --git a/user/settings/development/lisp.nix b/user/settings/development/lisp.nix new file mode 100644 index 00000000..b8d465ee --- /dev/null +++ b/user/settings/development/lisp.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ home.packages = with pkgs; [ + ccl + sbcl + lispPackages.quicklisp + asdf + cl-launch + + dust + pixie + ]; +} diff --git a/user/settings/dunst.nix b/user/settings/dunst.nix new file mode 100644 index 00000000..6d74b51b --- /dev/null +++ b/user/settings/dunst.nix @@ -0,0 +1,57 @@ +{ config, pkgs, ... }: + +{ + services.dunst = { + enable = true; + settings = { + global = { + font = "Monospace 13"; + geometry = "300x10-10+30"; + follow = "none"; + sticky_history = "yes"; + history_length = 20; + show_indicators = "yes"; + separator_height = 2; + padding = 8; + horizontal_padding = 8; + idle_threshold = 30; + + indicate_hidden = "no"; + + allow_markup = "yes"; + format = "%s\n%b"; + word_wrap = "yes"; + ignore_newline = "no"; + + separator_color = "frame"; + }; + frame = { + width = 1; + color = "#383838"; + }; + shortcuts = { + close = "mod4+apostrophe"; + close_all = "mod4+shift+apostrophe"; + history = "mod4+grave"; + context = "mod4+shift+period"; + }; + urgency_low = { + background = "#b8b8b8"; + foreground = "#f8f8f8"; + timeout = 10; + }; + + urgency_normal = { + background = "#7cafc2"; + foreground = "#f8f8f8"; + timeout = 10; + }; + + urgency_critical = { + background = "#ab4642"; + foreground = "#f8f8f8"; + timeout = 0; + }; + }; + }; +} diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix new file mode 100644 index 00000000..9f542391 --- /dev/null +++ b/user/settings/emacs.nix @@ -0,0 +1,169 @@ +{ config, pkgs, lib, ... }: + +let + inherit (pkgs) stdenv; + + pkgsUnstable = if stdenv.isDarwin then import {} else import {}; + + editorScript = pkgs.writeScriptBin "edit" '' + #!${pkgs.runtimeShell} + if [ -z "$1" ]; then + exec ${config.programs.emacs.finalPackage}/bin/emacsclient --create-frame --alternate-editor ${config.programs.emacs.finalPackage}/bin/emacs + else + exec ${config.programs.emacs.finalPackage}/bin/emacsclient --alternate-editor ${config.programs.emacs.finalPackage}/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=${editorScript}/bin/edit %F + Icon=emacs + Type=Application + Terminal=false + Categories=Development;TextEditor; + StartupWMClass=Emacs + Keywords=Text;Editor; + ''; + }; +in +{ + programs.emacs = { + enable = true; + extraPackages = epkgs: (with epkgs; [ + ace-link + all-the-icons + almost-mono-themes + add-node-modules-path + ag + all-the-icons + amx + auto-async-byte-compile + avy + basic-theme + bash-completion + caddyfile-mode + company + company-web + company-tabnine + counsel + counsel-projectile + crux + docker-compose-mode + dockerfile-mode + dired-git-info + editorconfig + 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 + evil-magit + evil-mu4e + evil-org + evil-quickscope + evil-space + evil-surround + eyebrowse + feature-mode + fish-completion + flycheck + flymake-diagnostic-at-point + general + git-gutter-fringe + git-messenger + git-timemachine + gitattributes-mode + gitconfig-mode + gitignore-mode + gitlab-ci-mode + gitlab-ci-mode-flycheck + goto-chg + haskell-mode + helpful + ivy-hydra + jinja2-mode + js2-mode + json-mode + k8s-mode + # kubernetes + # kubernetes-evil + ledger-mode + lsp-mode + lsp-ui + lsp-haskell + lsp-treemacs + magit + markdown-mode + minions + monotropic-theme + moody + nginx-mode + nix-mode + nix-update + org-journal + paredit + php-mode + posframe + prettier-js + projectile + projectile-ripgrep + quickrun + rainbow-mode + relative-buffers + restclient + ripgrep + rjsx-mode + scss-mode + spacemacs-theme + swiper + toml-mode + typescript-mode + undo-tree + use-package + web-mode + wgrep-ag + ws-butler + which-key + yaml-mode + ] ++ lib.optionals (!stdenv.isDarwin) [ + pkgs.mu + ]); + }; + home.packages = [ + editorScript + ]; + nixpkgs.overlays = [ + (self: super: { + emacsPackagesNgGen = pkgsUnstable.emacsPackagesNgGen; + emacs = pkgsUnstable.emacs; + }) + ]; + home.sessionVariables = { + EDITOR = "${editorScript}/bin/edit"; + }; + home.file.".emacs.d/init.el" = { + source = ../emacs/.emacs.d/init.el; + onChange = '' + ${config.programs.emacs.finalPackage}/bin/emacs -batch -f batch-byte-compile .emacs.d/init.el + ''; + }; + home.file.".emacs.d/eshell/" = { + recursive = true; + source = ../emacs/.emacs.d/eshell; + }; + + home.file.".local/share/applications/emacsclient.desktop".source = desktopApplicationFile; +} diff --git a/user/settings/gaming.nix b/user/settings/gaming.nix new file mode 100644 index 00000000..022846ca --- /dev/null +++ b/user/settings/gaming.nix @@ -0,0 +1,45 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + unstable.steam + ( + unstable.winePackages.unstable.override { + pngSupport = true; + jpegSupport = true; + tiffSupport = true; + gettextSupport = true; + fontconfigSupport = true; + alsaSupport = true; + gtkSupport = true; + openglSupport = true; + tlsSupport = true; + gstreamerSupport = true; + cupsSupport = true; + colorManagementSupport = true; + dbusSupport = true; + mpg123Support = true; + openalSupport = true; + openclSupport = true; + cairoSupport = true; + odbcSupport = true; + netapiSupport = true; + cursesSupport = true; + vaSupport = true; + pcapSupport = true; + v4lSupport = true; + saneSupport = true; + gsmSupport = true; + gphoto2Support = true; + ldapSupport = true; + pulseaudioSupport = true; + udevSupport = true; + xineramaSupport = true; + xmlSupport = true; + vulkanSupport = true; + sdlSupport = true; + } + ) + unstable.lutris + ]; +} diff --git a/user/settings/git.nix b/user/settings/git.nix new file mode 100644 index 00000000..503b9e3f --- /dev/null +++ b/user/settings/git.nix @@ -0,0 +1,77 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + gitAndTools.git-extras + ]; + programs.git = { + enable = true; + userName = "Alan Pearce"; + userEmail = "alan@alanpearce.eu"; + extraConfig = { + pull = { + rebase = true; + }; + push = { + default = "current"; + followTags = true; + }; + rebase = { + autosquash = true; + }; + rerere = { + enable = true; + }; + diff = { + algorithm = "patience"; + tool = "icdiff"; + }; + difftool = { + prompt = false; + }; + "difftool.icdiff" = { + cmd = "${pkgs.icdiff}/bin/icdiff --line-numbers $LOCAL $REMOTE"; + }; + "difftool.sopsdiffer" = { + textconf = "${pkgs.sops}/bin/sops -d"; + }; + "merge.npm-merge-driver" = { + name = "automatically merge npm lockfiles"; + driver = "npx npm-merge-driver merge %A %O %B %P"; + }; + remote = { + autoSetupMerge = true; + }; + "branch.master" = { + rebase = false; + }; + }; + signing = { + key = "0xCD4BEB92A8D46583"; + }; + lfs = { + enable = true; + }; + aliases = { + authors = "shortlog -s -n"; + mup = "merge FETCH_HEAD"; + rup = "rebase FETCH_HEAD"; + st = "status -sb"; + ci = "commit"; + br = "branch"; + co = "checkout"; + lasttag = "!sh -c 'git tag --sort=version:refname | grep \"^v\\\\?[0-9]\" | tail -n1'"; + pending = "!sh -c 'git log --oneline --grep=\"#\" ...$(git lasttag)'"; + lg = "log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %Cred%d%Creset'"; + prl = "log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %Cred%d%Creset' --grep='#'"; + ignored = "ls-files --others -i --exclude-standard"; + }; + ignores = [ + ".DS_Store" + "*_flymake.*" + "*~" + "\#*\#" + ".\#*" + ]; + }; +} diff --git a/user/settings/gnupg.nix b/user/settings/gnupg.nix new file mode 100644 index 00000000..6dcb31f2 --- /dev/null +++ b/user/settings/gnupg.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + home.file.".gnupg" = { + recursive = true; + source = ../gnupg/.gnupg; + }; +} diff --git a/user/settings/i3.nix b/user/settings/i3.nix new file mode 100644 index 00000000..d83ee2e7 --- /dev/null +++ b/user/settings/i3.nix @@ -0,0 +1,149 @@ +{ config, pkgs, lib, ... }: + +{ + xdg.configFile.i3status = { + recursive = true; + source = ../i3/.config/i3status; + }; + xsession.windowManager.i3 = let + mod = "Mod4"; + mode_system = "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown"; + locker = "${pkgs.xautolock}/bin/xautolock -locknow"; + in + { + enable = true; + config = { + modifier = mod; + fonts = [ "Terminus 12px" ]; + floating = { + criteria = [ + { class = "Pinentry$"; } + ]; + }; + window = { + titlebar = false; + }; + keybindings = { + "${mod}+Return" = "exec --no-startup-id xst"; + # kill focused window + "${mod}+w" = "kill"; + "${mod}+Shift+w" = "kill"; + + "--release ${mod}+Mod1+r" = "exec rofi -show run"; + "--release ${mod}+Shift+semicolon" = "exec rofi-pass"; + "--release ${mod}+space" = "exec \"rofi -show combi -combi-modi drun,window\""; + + # change focus + "${mod}+h" = "focus left"; + "${mod}+j" = "focus down"; + "${mod}+k" = "focus up"; + "${mod}+l" = "focus right"; + + "${mod}+1" = "workspace 1"; + "${mod}+2" = "workspace 2"; + "${mod}+3" = "workspace 3"; + "${mod}+4" = "workspace 4"; + "${mod}+5" = "workspace 5"; + "${mod}+6" = "workspace 6"; + "${mod}+7" = "workspace 7"; + "${mod}+8" = "workspace 8"; + "${mod}+9" = "workspace 9"; + "${mod}+0" = "workspace 10"; + + # move focused window + "${mod}+Shift+h" = "move left"; + "${mod}+Shift+j" = "move down"; + "${mod}+Shift+k" = "move up"; + "${mod}+Shift+l" = "move right"; + + "${mod}+Shift+1" = "move container to workspace 1"; + "${mod}+Shift+2" = "move container to workspace 2"; + "${mod}+Shift+3" = "move container to workspace 3"; + "${mod}+Shift+4" = "move container to workspace 4"; + "${mod}+Shift+5" = "move container to workspace 5"; + "${mod}+Shift+6" = "move container to workspace 6"; + "${mod}+Shift+7" = "move container to workspace 7"; + "${mod}+Shift+8" = "move container to workspace 8"; + "${mod}+Shift+9" = "move container to workspace 9"; + + + # move workspace + "${mod}+Mod1+h" = "move workspace to output left"; + "${mod}+Mod1+j" = "move workspace to output down"; + "${mod}+Mod1+k" = "move workspace to output up"; + "${mod}+Mod1+l" = "move workspace to output right"; + + # split in horizontal orientation + "${mod}+b" = "split h"; + + # split in vertical orientation + "${mod}+v" = "split v"; + + "${mod}+F11" = "fullscreen toggle"; + "${mod}+f" = "fullscreen toggle"; + + # change container layout (stacked, tabbed, toggle split) + "${mod}+Shift+s" = "layout stacking"; + "${mod}+Shift+t" = "layout tabbed"; + "${mod}+Shift+v" = "layout toggle split"; + + # toggle tiling / floating + "${mod}+Shift+f" = "floating toggle"; + + # change focus between tiling / floating windows + "${mod}+Tab" = "focus mode_toggle"; + + # focus the parent container + "${mod}+a" = "focus parent"; + + # focus the child container + "${mod}+d" = "focus child"; + + "${mod}+Shift+c" = "reload"; + "${mod}+Shift+p" = "restart"; + + "${mod}+Shift+r" = "mode resize"; + "${mod}+Shift+o" = "exec ${locker}"; + "${mod}+Pause" = "mode \"${mode_system}\""; + "${mod}+Escape" = "mode \"${mode_system}\""; + "${mod}+Shift+q" = "mode \"${mode_system}\""; + }; + + modes = { + resize = { + "h" = "resize shrink width 10 px or 10 ppt"; + "j" = "resize grow height 10 px or 10 ppt"; + "k" = "resize shrink height 10 px or 10 ppt"; + "l" = "resize grow width 10 px or 10 ppt"; + + "Left" = "resize shrink width 10 px or 10 ppt"; + "Down" = "resize grow height 10 px or 10 ppt"; + "Up" = "resize shrink height 10 px or 10 ppt"; + "Right" = "resize grow width 10 px or 10 ppt"; + + "Return" = "mode default"; + "Escape" = "mode default"; + }; + "${mode_system}" = { + "l" = "exec --no-startup-id ${locker}, mode default"; + "e" = "exec --no-startup-id i3-msg exit, mode default"; + "s" = "exec --no-startup-id systemctl suspend, mode default"; + "h" = "exec --no-startup-id systemctl hibernate, mode default"; + "r" = "exec --no-startup-id systemctl reboot, mode default"; + "Shift+s" = "exec --no-startup-id systemctl poweroff -i, mode default"; + "Return" = "mode default"; + "Escape" = "mode default"; + }; + }; + + bars = [ + { + fonts = [ "Terminus 12px" ]; + position = "top"; + hiddenState = "show"; + statusCommand = "${pkgs.i3status}/bin/i3status -c ~/.config/i3status/config"; + } + ]; + }; + }; +} diff --git a/user/settings/isync.nix b/user/settings/isync.nix new file mode 100644 index 00000000..b96db87d --- /dev/null +++ b/user/settings/isync.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ + home.file.".mbsyncrc".source = ../isync/.mbsyncrc; +} diff --git a/user/settings/javascript.nix b/user/settings/javascript.nix new file mode 100644 index 00000000..4c75ea10 --- /dev/null +++ b/user/settings/javascript.nix @@ -0,0 +1,59 @@ +{ config, pkgs, ... }: + +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 +{ home.packages = (with pkgs.unstable; [ + node + ] ++ ( + if stdenv.isDarwin + then + [ + ] + else + [ + # npm install may use any of these + binutils + gcc + gnumake + python2 + ] + )) ++ (with npmPackages; [ + node-gyp + node-gyp-build + node-pre-gyp + + tern + node2nix + nodemon + javascript-typescript-langserver + typescript-language-server + vscode-css-languageserver-bin + vscode-html-languageserver-bin + csslint + eslint_d + prettier + typescript + + node2nixPackages.bunyan + node2nixPackages.pino-pretty + node2nixPackages."pnpm-3.6.2" + node2nixPackages.prettier_d + node2nixPackages.dockerfile-language-server-nodejs + node2nixPackages.yaml-language-server + ]); + home.file.".npmrc".text = '' + prefix=''${HOME}/.local + //registry.npmjs.org/:_authToken=''${NPM_AUTH_TOKEN} + always-auth=true + sign-git-tag=true + rebuild-bundle=false + update-notifier=false + registry=https://registry.npmjs.org/ + ''; +} diff --git a/user/settings/ledger.nix b/user/settings/ledger.nix new file mode 100644 index 00000000..61d3df7e --- /dev/null +++ b/user/settings/ledger.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + home.file.".ledgerrc".text = '' + --date-format %F + --start-of-week 1 + ''; +} diff --git a/user/settings/msmtp.nix b/user/settings/msmtp.nix new file mode 100644 index 00000000..45c2f460 --- /dev/null +++ b/user/settings/msmtp.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ + home.file.".msmtprc".source = ../msmtp/.msmtprc; +} diff --git a/user/settings/nix.nix b/user/settings/nix.nix new file mode 100644 index 00000000..d0de3cab --- /dev/null +++ b/user/settings/nix.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ + nixpkgs.config = import ../config.nix; +} diff --git a/user/settings/nixos.nix b/user/settings/nixos.nix new file mode 100644 index 00000000..64b523b8 --- /dev/null +++ b/user/settings/nixos.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./nix.nix + ]; + nixpkgs.overlays = [ + (self: super: { + unstable = import { + config = config.nixpkgs.config; + }; + }) + ]; + + programs.zsh.shellAliases = { + nor = "nixos-rebuild"; + nors = "nixos-rebuild switch"; + norb = "nixos-rebuild boot"; + norr = "nixos-rebuild switch --rollback"; + }; +} diff --git a/user/settings/nixpkgs.nix b/user/settings/nixpkgs.nix new file mode 100644 index 00000000..b89579e1 --- /dev/null +++ b/user/settings/nixpkgs.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./nix.nix + ]; + nixpkgs.overlays = [ + (self: super: { + unstable = self; + }) + ]; +} diff --git a/user/settings/passwords.nix b/user/settings/passwords.nix new file mode 100644 index 00000000..72493cef --- /dev/null +++ b/user/settings/passwords.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs.unstable; [ + keepassx-community + rofi-pass + pass-otp + pwgen + ]; +} diff --git a/user/settings/rofi.nix b/user/settings/rofi.nix new file mode 100644 index 00000000..b34af881 --- /dev/null +++ b/user/settings/rofi.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ... }: + +{ + xdg.configFile."networkmanager-dmenu/config.ini".text = '' + [dmenu] + dmenu_command = /run/current-system/sw/bin/rofi + + [editor] + terminal = xst + gui_if_available = false + ''; + programs.rofi = { + enable = true; + extraConfig = '' + rofi.matching: glob + rofi.separator-style: none + + rofi.line-padding: 2 + + rofi.display-run: cmd + rofi.display-drun: run + rofi.display-window: win + ''; + }; +} diff --git a/user/settings/satoshipay.nix b/user/settings/satoshipay.nix new file mode 100644 index 00000000..6516bd59 --- /dev/null +++ b/user/settings/satoshipay.nix @@ -0,0 +1,55 @@ +{ config, pkgs, ... }: + +let + inherit (pkgs) stdenv; + spGitConfig = { + user.email = "alan@satoshipay.io"; + }; +in +{ + imports = [ + ./javascript.nix + ]; + + home.sessionVariables = { + KUBECTX_IGNORE_FZF = "1"; + }; + home.packages = with pkgs; ([ + caddy + openssl + mongodb-tools + pgcli + s3cmd + sops + + unstable.mkcert + unstable.google-cloud-sdk + unstable.docker_compose + unstable.kubernetes + unstable.kubectx + unstable.kubernetes-helm + unstable.helmfile + ] ++ (lib.optionals (!stdenv.isDarwin) + [ + pgadmin + + unstable.redis-desktop-manager + unstable.robo3t + unstable.slack + ])); + + programs.git.includes = [ + { + condition = "gitdir:~/projects/github.com/satoshipay/"; + contents = spGitConfig; + } + { + condition = "gitdir:~/projects/gitlab.satoshipay.tech"; + contents = spGitConfig; + } + ]; + + home.file.".npmrc".text = '' + @satoshipay:registry=https://registry.npmjs.org/ + ''; +} diff --git a/user/settings/sxhkd.nix b/user/settings/sxhkd.nix new file mode 100644 index 00000000..7160ec08 --- /dev/null +++ b/user/settings/sxhkd.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ + xdg.configFile."sxhkd/sxhkdrc".text = '' + XF86AudioMute + pamixer --toggle-mute + + XF86Audio{Lower,Raise}Volume + pamixer --{decrease,increase} 1 + + @XF86AudioMicMute + pamixer --source 2 --toggle-mute + + XF86MonBrightness{Down,Up} + light -{U,A} 2% + + XF86Display + disper -C + + XF86AudioPlay + cmus-remote --pause + + XF86Audio{Prev,Next} + cmus-remote --{prev,next} + + XF86Tools + networkmanager_dmenu + ''; +} diff --git a/user/settings/tabnine.nix b/user/settings/tabnine.nix new file mode 100644 index 00000000..8018bcca --- /dev/null +++ b/user/settings/tabnine.nix @@ -0,0 +1,57 @@ +{ config, pkgs, ... }: + +let + cfg = { + config = { + "language.typescript" = { + command = "typescript-language-server"; + args = ["--stdio"]; + }; + "language.javascript" = { + command = "javascript-typescript-stdio"; + args = ["--stdio"]; + }; + "language.css" = { + command = "css-languageserver"; + args = ["--stdio"]; + }; + "language.scss" = { + command = "css-languageserver"; + args = ["--stdio"]; + }; + "language.html" = { + command = "html-languageserver"; + args = ["--stdio"]; + }; + "language.dockerfile" = { + command = "docker-langserver"; + args = ["--stdio"]; + }; + "language.yaml" = { + command = "yaml-language-server"; + args = ["--stdio"]; + }; + "language.haskell" = { + command = "hie"; + args = ["--stdio"]; + }; + }; + }; + configFile = config: + pkgs.runCommand "TabNine.toml" + { + buildInputs = [ pkgs.remarshal ]; + preferLocalBuild = true; + allowSubstitutes = false; + } + '' + remarshal -if json -of toml \ + < ${pkgs.writeText "config.json" (builtins.toJSON cfg.config)} \ + > $out + ''; +in +{ + xdg.configFile."TabNine/TabNine.toml" = { + source = configFile cfg.config; + }; +} diff --git a/user/settings/trezor.nix b/user/settings/trezor.nix new file mode 100644 index 00000000..a4f3ba75 --- /dev/null +++ b/user/settings/trezor.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + home.file.".ssh/agent.config" = { + text = '' + ecdsa-curve-name = ed25519 + ''; + }; +} diff --git a/user/settings/user-interface.nix b/user/settings/user-interface.nix new file mode 100644 index 00000000..31ba349d --- /dev/null +++ b/user/settings/user-interface.nix @@ -0,0 +1,17 @@ +{ config, pkgs, ... }: + +let + inherit (pkgs) stdenv; +in +{ + home.sessionVariables = { + TERMINAL = "${pkgs.unstable.xst}/bin/xst"; + }; + + home.packages = with pkgs; [ + unstable.xst # st, but with support for XResources + ] ++ lib.optionals (!stdenv.isDarwin) [ + pkgs.sshfs + pkgs.unstable.mu + ]; +} diff --git a/user/settings/xresources.nix b/user/settings/xresources.nix new file mode 100644 index 00000000..475113de --- /dev/null +++ b/user/settings/xresources.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + home.file.".xresources" = { + recursive = true; + source = ../xresources/.xresources; + }; +} diff --git a/user/settings/zsh.nix b/user/settings/zsh.nix new file mode 100644 index 00000000..467c426b --- /dev/null +++ b/user/settings/zsh.nix @@ -0,0 +1,181 @@ +{ config, pkgs, ... }: + +let + inherit (pkgs) stdenv; + lsOptions = if stdenv.isDarwin then "-p" else "-v --group-directories-first"; + lsIsoDate = if stdenv.isDarwin then "" else "--time-style=long-iso"; +in +{ + home.file = { + ".rm_recycle_home".text = ""; # use trash automatically in home directory + }; + home.packages = with pkgs; [ + fzf + ghq + ] ++ (if stdenv.isDarwin + then [] + else [ + pkgs.git + ]); + xdg.configFile.zsh = { + recursive = true; + source = ../zsh/.config/zsh; + }; + + home.file.".zplugin/bin" = { + source = pkgs.fetchFromGitHub { + owner = "zdharma"; + repo = "zplugin"; + rev = "028b1e1d6d3eae204b499c7f815f4eeeb5051517"; + sha256 = "1ynh323905iia3gwi9qghbywp94x306nna1yqk37frj5g7kg90fa"; + }; + }; + + programs.zsh = { + enable = true; + + enableAutosuggestions = true; + enableCompletion = true; + defaultKeymap = "emacs"; + + dotDir = ".config/zsh"; + + history = { + expireDuplicatesFirst = true; + extended = true; + path = ".cache/zsh/history"; + save = 20000; + size = 10000; + }; + + localVariables = { + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=7"; + }; + + shellAliases = { + l = "ls ${lsOptions} -Bp"; + l1="ls -1"; + ls="ls ${lsOptions} -hF"; + la="ls ${lsOptions} -hA"; + ll="ls ${lsOptions} ${lsIsoDate} -hl"; + lal="ll -A"; + lla="lal"; + llr="ll -t"; + + https = "http --default-scheme https"; + kns = "kubens"; + kx = "kubectx"; + ava = "pnpx ava"; + avt = "pnpx ava --tap"; + avat = "pnpx ava --tap"; + pino = "pino-pretty"; + mocha = "pnpx mocha"; + prettier = "pnpx prettier"; + standard = "pnpx standard"; + tsc = "pnpx tsc"; + tslint = "pnpx tslint"; + tsnode = "pnpx ts-node"; + + history = "fc -l $(( $LINES - 2 ))"; + hist-freq-lines = "fc -l -2000 | cut -d' ' -f4- | sort | uniq -c | sort -g | tail -n100 | less"; + hist-freq-commands = "fc -l -2000 | cut -d' ' -f4 | sort | uniq -c | sort -g | tail -n10 | less"; + wprop = "xprop | egrep '^WM_(CLASS|NAME|WINDOW_ROLE|TYPE)'"; + + # Enable the following commands to support aliases. + sudo = "sudo "; + watch = "watch "; + + g = "rg"; + + ga = "git add"; + gi = "git"; + gs = "git st"; + gd = "git diff"; + gf = "git fetch"; + gk = "git push"; + gj = "git pull"; + gl = "git lg"; + gr = "git remote"; + gz = "git stash"; + gzl = "git stash list"; + gzp = "git stash pop"; + gdt = "git difftool"; + grl = "git reflog"; + gri = "git rebase --interactive"; + grs = "git reset"; + grsh = "git reset --hard"; + gsh = "git show"; + gsm = "git submodule"; + gci = "git commit"; + gco = "git checkout"; + gbr = "git br"; + gbrc = "git checkout -b"; + gbrd = "git branch --delete"; + gbrm = "git branch --move"; + gmup = "git mup"; + grup = "git rup"; + + hos = "home-manager switch"; + hon = "home-manager news"; + hoh = "home-manager-help"; + + n = "nix-env"; + ni = "nix-env -iA"; + nq = "nix-env -q"; + ne = "nix-env -e"; + nup = "nix-env -u"; + ngc = "nix-collect-garbage --delete-older-than 14d"; + }; + + # move to envExtra after 19.09 + initExtra = '' + case $OSTYPE in + darwin*) + os=darwin + ;; + linux-gnu) + os=linux + ;; + freebsd*) + os=freebsd + ;; + *) + os=unknown + ;; + esac + + case $MACHTYPE in + *64) + arch=amd64 + ;; + *) + arch=386 + ;; + esac + if [[ ''${path[(I)$HOME/.local/bin ]} ]] + then + path+=($HOME/.local/bin) + fi + + if [[ ''${path[(I)$HOME/go/bin ]} ]] + then + path+=($HOME/go/bin) + fi + + if [[ $HOST =~ satoshi ]] + then + EMAIL=alan@satoshipay.io + else + EMAIL=alan@alanpearce.eu + fi + + typeset -T GHQ_ROOT ghq_root + export GHQ_ROOT="$HOME/projects:$HOME/go/src:$HOME/quicklisp/local-projects" + + function hist-freq-subcommands () { + fc -l -m "$1*" -2000 | cut -d' ' -f4- | sort | uniq -c | sort -g | tail -n100 | less + } + + '' + builtins.readFile ../zsh/.config/zsh/.zshrc; + }; +} diff --git a/user/trillian.nix b/user/trillian.nix index f8616e51..61e7609a 100644 --- a/user/trillian.nix +++ b/user/trillian.nix @@ -2,17 +2,17 @@ { imports = [ - ./modules/base.nix - ./modules/development/base.nix - ./modules/darwin.nix - ./modules/emacs.nix - ./modules/git.nix - ./modules/gnupg.nix - ./modules/javascript.nix - ./modules/nixpkgs.nix - ./modules/satoshipay.nix - ./modules/tabnine.nix - ./modules/trezor.nix - ./modules/zsh.nix + ./settings/base.nix + ./settings/development/base.nix + ./settings/darwin.nix + ./settings/emacs.nix + ./settings/git.nix + ./settings/gnupg.nix + ./settings/javascript.nix + ./settings/nixpkgs.nix + ./settings/satoshipay.nix + ./settings/tabnine.nix + ./settings/trezor.nix + ./settings/zsh.nix ]; } -- cgit 1.4.1