From 57ded1cfdfa3a3d9ac511ca8cc936983428267c5 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 20 Jun 2018 13:28:04 +0200 Subject: Split host-specific configuration Managed using "host/current.nix" symlink. --- configuration.nix | 36 +----------------------------------- hardware-configuration.nix | 31 ------------------------------- host/asterix.nix | 34 ++++++++++++++++++++++++++++++++++ host/hardware/asterix.nix | 31 +++++++++++++++++++++++++++++++ host/hardware/obelix.nix | 31 +++++++++++++++++++++++++++++++ host/obelix.nix | 27 +++++++++++++++++++++++++++ 6 files changed, 124 insertions(+), 66 deletions(-) delete mode 100644 hardware-configuration.nix create mode 100644 host/asterix.nix create mode 100644 host/hardware/asterix.nix create mode 100644 host/hardware/obelix.nix create mode 100644 host/obelix.nix diff --git a/configuration.nix b/configuration.nix index 6c293fe..3a4be5b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,34 +4,12 @@ system.stateVersion = "18.03"; imports = [ - ./hardware-configuration.nix + ./host/current.nix ./conf/fish.nix ]; - boot = { - kernelParams = [ "vga=0x31B" ]; - - loader.grub = { - enable = true; - version = 2; - device = "/dev/sdb"; - }; - - initrd.luks.devices = [ { - name = "root"; - device = "/dev/disk/by-uuid/6205da24-b1b2-402c-b175-4036e678dea9"; - preLVM = true; - allowDiscards = true; - } ]; - }; - fileSystems."/".options = [ "noatime" "nodiratime" "discard" ]; - networking = { - hostName = "obelix"; - firewall.enable = false; - }; - sound.enable = true; hardware = { opengl.driSupport32Bit = true; @@ -79,8 +57,6 @@ layout = "de"; xkbOptions = "caps:escape"; - videoDrivers = [ "nvidiaBeta" ]; - displayManager.slim = { enable = true; autoLogin = true; @@ -91,16 +67,6 @@ }; }; - systemd.services.spin-down-storage = { - enable = true; - description = "Spin down storage drive by default"; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.hdparm}/bin/hdparm -q -S 120 -y /dev/disk/by-label/storage"; - }; - wantedBy = [ "multi-user.target" ]; - }; - users.extraUsers.common = { isNormalUser = true; uid = 1000; diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index 769981a..0000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,31 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, ... }: - -{ - imports = - [ - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "sd_mod" "sr_mod" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/ac766046-c9cd-4771-b591-f74d50aa8500"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/20ea14b0-33ef-4fa1-a861-fd1156a0b60d"; - fsType = "ext2"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/0732dc69-7d30-4e99-af6d-d12b927945eb"; } - ]; - - nix.maxJobs = lib.mkDefault 8; - powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; -} diff --git a/host/asterix.nix b/host/asterix.nix new file mode 100644 index 0000000..59ff5ca --- /dev/null +++ b/host/asterix.nix @@ -0,0 +1,34 @@ +{ + imports = [ ./hardware/asterix.nix ]; + + boot = { + loader.grub = { + enable = true; + version = 2; + device = "/dev/sda"; + }; + + initrd.luks.devices = [ { + name = "encrypted"; + device = "/dev/sda2"; + preLVM = true; + allowDiscards = true; + } ]; + }; + + networking = { + hostName = "asterix"; + firewall.enable = false; + networkmanager.enable = true; + }; + + services.xserver = { + videoDrivers = [ "intel" ]; + + synaptics = { + enable = true; + twoFingerScroll = true; + palmDetect = true; + }; + }; +} diff --git a/host/hardware/asterix.nix b/host/hardware/asterix.nix new file mode 100644 index 0000000..a0412d5 --- /dev/null +++ b/host/hardware/asterix.nix @@ -0,0 +1,31 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ]; + + boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/2f564c2d-d300-4712-a578-1cd77fcaa40d"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/ded323eb-84de-4ff5-8570-8f50e93a862e"; + fsType = "ext2"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/79b17f7c-a47e-45ea-b755-d05065a05734"; } + ]; + + nix.maxJobs = lib.mkDefault 4; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/host/hardware/obelix.nix b/host/hardware/obelix.nix new file mode 100644 index 0000000..769981a --- /dev/null +++ b/host/hardware/obelix.nix @@ -0,0 +1,31 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "sd_mod" "sr_mod" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/ac766046-c9cd-4771-b591-f74d50aa8500"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/20ea14b0-33ef-4fa1-a861-fd1156a0b60d"; + fsType = "ext2"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/0732dc69-7d30-4e99-af6d-d12b927945eb"; } + ]; + + nix.maxJobs = lib.mkDefault 8; + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; +} diff --git a/host/obelix.nix b/host/obelix.nix new file mode 100644 index 0000000..c20dbab --- /dev/null +++ b/host/obelix.nix @@ -0,0 +1,27 @@ +{ + imports = [ ./hardware/obelix.nix ]; + + boot = { + kernelParams = [ "vga=0x31B" ]; + + loader.grub = { + enable = true; + version = 2; + device = "/dev/sdb"; + }; + + initrd.luks.devices = [ { + name = "root"; + device = "/dev/disk/by-uuid/6205da24-b1b2-402c-b175-4036e678dea9"; + preLVM = true; + allowDiscards = true; + } ]; + }; + + networking = { + hostName = "obelix"; + firewall.enable = false; + }; + + services.xserver.videoDrivers = [ "nvidiaBeta" ]; +} -- cgit v1.2.3