diff options
author | ene <ene@sils.li> | 2023-02-01 21:33:11 +0100 |
---|---|---|
committer | ene <ene@sils.li> | 2023-02-03 17:34:11 +0100 |
commit | 871d3f95963eac25765427ecca9a8e4812071439 (patch) | |
tree | 5dcf241ece31050cf0c74219852242abe504e068 /hosts | |
parent | Build(flake): Added Flake.lock (diff) | |
download | nixos-config-871d3f95963eac25765427ecca9a8e4812071439.tar.gz nixos-config-871d3f95963eac25765427ecca9a8e4812071439.zip |
Feat: Split the config apart
Diffstat (limited to 'hosts')
-rw-r--r-- | hosts/IDOHVE/configuration.nix | 9 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware.nix | 85 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/boot.nix | 32 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/cpu.nix | 4 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/filesystems.nix | 41 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/gpu.nix (renamed from hosts/IDOHVE/gpu.nix) | 1 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/hardware.nix | 19 |
7 files changed, 99 insertions, 92 deletions
diff --git a/hosts/IDOHVE/configuration.nix b/hosts/IDOHVE/configuration.nix index a3cf2b2c..e9ddc69d 100644 --- a/hosts/IDOHVE/configuration.nix +++ b/hosts/IDOHVE/configuration.nix @@ -7,15 +7,12 @@ ... }: { imports = [ - ./hardware.nix - ./gpu.nix + ./hardware/hardware.nix ./networking.nix - ../../system/packages.nix - ../../system/users.nix + ../../system/system.nix - ../../services/nix.nix - ../../services/zsh.nix + ../../services/services.nix ]; diff --git a/hosts/IDOHVE/hardware.nix b/hosts/IDOHVE/hardware.nix deleted file mode 100644 index be55c07c..00000000 --- a/hosts/IDOHVE/hardware.nix +++ /dev/null @@ -1,85 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: let - main_disk = "/dev/disk/by-uuid/<uuid>"; -in { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") # TODO is this necessary? - ]; - - boot = { - initrd = { - compressor = "lz4"; - compressorArgs = ["-9"]; - - # TODO check this: - availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"]; - }; - - kernelModules = ["kvm-amd"]; - kernelPackages = pkgs.linuxPackages_latest; - loader = { - grub = { - enable = true; - version = 2; - theme = pkgs.nixos-grub2-theme; - splashImage = ./grub_boot_image.png; - efiSupport = true; - device = "nodev"; # TODO add this - }; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot"; - }; - }; - }; - - fileSystems = { - "/" = { - device = "none"; - fsType = "tmpfs"; - options = ["defaults" "size=2G" "mode=755"]; - }; - "/nix" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@nix" "compress-force=zstd:9"]; - }; - "/boot" = { - device = "/dev/disk/by-uuid/<uuid>"; - fsType = "vfat"; - }; - - "/srv/home" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@home" "compress-force=zstd:9"]; - }; - "/srv/nixos-config" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@nixos-config" "compress-force=zstd:9"]; - }; - - "/etc/nixos" = { - device = "/srv/nix-config"; - options = ["bind"]; - }; - "/home" = { - device = "/srv/home"; - options = ["bind"]; - }; - }; - - swapDevices = []; - - - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; -} - diff --git a/hosts/IDOHVE/hardware/boot.nix b/hosts/IDOHVE/hardware/boot.nix new file mode 100644 index 00000000..932155a4 --- /dev/null +++ b/hosts/IDOHVE/hardware/boot.nix @@ -0,0 +1,32 @@ +{ + config, + pkgs, + ... +}: { + boot = { + initrd = { + compressor = "lz4"; + compressorArgs = ["-9"]; + + # TODO check this: + availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"]; + }; + + kernelModules = ["kvm-amd"]; + kernelPackages = pkgs.linuxPackages_latest; + loader = { + grub = { + enable = true; + version = 2; + theme = pkgs.nixos-grub2-theme; + splashImage = ./grub_boot_image.png; + efiSupport = true; + device = "nodev"; # only for efi + }; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + }; +} diff --git a/hosts/IDOHVE/hardware/cpu.nix b/hosts/IDOHVE/hardware/cpu.nix new file mode 100644 index 00000000..5d61d02f --- /dev/null +++ b/hosts/IDOHVE/hardware/cpu.nix @@ -0,0 +1,4 @@ +{config, ...}: { + powerManagement.cpuFreqGovernor = "powersave"; + hardware.cpu.amd.updateMicrocode = true; # Why not? +} diff --git a/hosts/IDOHVE/hardware/filesystems.nix b/hosts/IDOHVE/hardware/filesystems.nix new file mode 100644 index 00000000..a188df18 --- /dev/null +++ b/hosts/IDOHVE/hardware/filesystems.nix @@ -0,0 +1,41 @@ +{config, ...}: let + main_disk = "/dev/disk/by-uuid/<uuid>"; +in { + fileSystems = { + "/" = { + device = "none"; + fsType = "tmpfs"; + options = ["defaults" "size=2G" "mode=755"]; + }; + "/nix" = { + device = main_disk; + fsType = "btrfs"; + options = ["subvol=@nix" "compress-force=zstd:9"]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/<uuid>"; + fsType = "vfat"; + }; + + "/srv/home" = { + device = main_disk; + fsType = "btrfs"; + options = ["subvol=@home" "compress-force=zstd:9"]; + }; + "/srv/nixos-config" = { + device = main_disk; + fsType = "btrfs"; + options = ["subvol=@nixos-config" "compress-force=zstd:9"]; + }; + + "/etc/nixos" = { + device = "/srv/nix-config"; + options = ["bind"]; + }; + "/home" = { + device = "/srv/home"; + options = ["bind"]; + }; + }; + swapDevices = []; +} diff --git a/hosts/IDOHVE/gpu.nix b/hosts/IDOHVE/hardware/gpu.nix index 6796d04b..49197c2b 100644 --- a/hosts/IDOHVE/gpu.nix +++ b/hosts/IDOHVE/hardware/gpu.nix @@ -4,7 +4,6 @@ lib, ... }: { - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; # TODO hardware.opengl.extraPackages = with pkgs; [ rocm-opencl-icd # open-cl diff --git a/hosts/IDOHVE/hardware/hardware.nix b/hosts/IDOHVE/hardware/hardware.nix new file mode 100644 index 00000000..20e4c4f3 --- /dev/null +++ b/hosts/IDOHVE/hardware/hardware.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}:{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") # TODO is this necessary? + ./cpu.nix + ./gpu.nix + ./boot.nix + ./filesystems.nix + ]; + + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} + |