From f8e1b886bef4529fe1cf89521c0ebf2104060e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 25 Jul 2020 09:56:03 +0100 Subject: [PATCH] refactor foureighty hardware config --- nixos/boxes/foureighty/default.nix | 57 +++++-------------- .../foureighty/hardware-configuration.nix | 39 ++++++++++--- nixos/boxes/skinnyv/default.nix | 8 ++- 3 files changed, 52 insertions(+), 52 deletions(-) diff --git a/nixos/boxes/foureighty/default.nix b/nixos/boxes/foureighty/default.nix index f7190fe1..21e15b64 100644 --- a/nixos/boxes/foureighty/default.nix +++ b/nixos/boxes/foureighty/default.nix @@ -2,38 +2,27 @@ { networking.hostName = "foureighty"; - boot = { - # need unlocked kernel for throttled daemon - kernelPackages = pkgs.linuxPackages_latest; + imports = [ + + ./hardware-configuration.nix + ../../boot.nix + ../../common.nix + ../../gfx-nvidia-optimus.nix + ../../zerotier.nix + ../../distributed-builds.nix + ../../libvirt.nix + ../../backups.nix + ../../gnome + ]; - kernelModules = [ "acpi_call" ]; - extraModulePackages = with config.boot.kernelPackages; [ acpi_call ]; - - initrd.luks.devices = { - root = { - device = "/dev/disk/by-uuid/a9e8a44f-15be-4844-a0a1-46892cc5e44e"; - allowDiscards = true; - }; - }; - - loader.grub = { - device = "nodev"; - efiSupport = true; - }; - - loader.efi.canTouchEfiVariables = true; - }; + boot.kernelPackages = pkgs.linuxPackages_latest; time.hardwareClockInLocalTime = true; time.timeZone = "Europe/London"; - hardware.trackpoint.enable = true; services.throttled.enable = true; - zramSwap = { - enable = true; - algorithm = "zstd"; - memoryPercent = 25; - }; + + hardware.trackpoint.enable = true; services.hardware.bolt.enable = true; services.fprintd = { enable = true; @@ -61,20 +50,4 @@ home.file.".config/i3/status.toml".source = ../../../.config/i3/status-double-bat.toml; }; - imports = [ - - ./hardware-configuration.nix - ../../boot.nix - ../../common.nix - ../../gfx-nvidia-optimus.nix - ../../zerotier.nix - ../../distributed-builds.nix - ../../libvirt.nix - ../../backups.nix - ../../gnome - ]; - - - nix.maxJobs = 2; - nix.buildCores = 6; } diff --git a/nixos/boxes/foureighty/hardware-configuration.nix b/nixos/boxes/foureighty/hardware-configuration.nix index 2570d180..be29ae74 100644 --- a/nixos/boxes/foureighty/hardware-configuration.nix +++ b/nixos/boxes/foureighty/hardware-configuration.nix @@ -3,13 +3,31 @@ { imports = [ ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot = { + kernel.sysctl = { + "vm.swappiness" = 75; + }; - boot.kernel.sysctl = { - "vm.swappiness" = 75; + kernelModules = [ "kvm-intel" "acpi_call" ]; + extraModulePackages = with config.boot.kernelPackages; [ acpi_call ]; + + initrd = { + kernelModules = [ "dm-snapshot" ]; + availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + luks.devices = { + root = { + device = "/dev/disk/by-uuid/a9e8a44f-15be-4844-a0a1-46892cc5e44e"; + allowDiscards = true; + }; + }; + }; + + loader.grub = { + device = "nodev"; + efiSupport = true; + }; + + loader.efi.canTouchEfiVariables = true; }; fileSystems."/" = { device = "/dev/disk/by-uuid/7ae9348d-604e-4196-a27b-24a7495438c3"; fsType = "ext4"; }; @@ -18,5 +36,12 @@ swapDevices = [ ]; - nix.maxJobs = lib.mkDefault 8; + zramSwap = { + enable = true; + algorithm = "zstd"; + memoryPercent = 25; + }; + + nix.maxJobs = 2; + nix.buildCores = 6; } diff --git a/nixos/boxes/skinnyv/default.nix b/nixos/boxes/skinnyv/default.nix index 1569d3a2..2b108ca4 100644 --- a/nixos/boxes/skinnyv/default.nix +++ b/nixos/boxes/skinnyv/default.nix @@ -23,9 +23,11 @@ fonts.fontconfig.enable = true; home-manager.users.cyryl = {...}: { imports = [ - ../../home-common.nix - ../../programs/git.nix - ../../gui.nix + imports = [ + ../../home-manager + ../../home-manager/gui.nix + ../../home-manager/programs/git.nix + ]; ]; home.stateVersion = config.system.stateVersion;