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 +- 98 files changed, 1115 insertions(+), 1115 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 (limited to 'system') 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 = { -- cgit 1.4.1