diff options
Diffstat (limited to 'hosts/IDOHVE/hardware')
-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 | 16 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/hardware.nix | 19 |
5 files changed, 112 insertions, 0 deletions
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/hardware/gpu.nix b/hosts/IDOHVE/hardware/gpu.nix new file mode 100644 index 00000000..49197c2b --- /dev/null +++ b/hosts/IDOHVE/hardware/gpu.nix @@ -0,0 +1,16 @@ +{ + config, + pkgs, + lib, + ... +}: { + + hardware.opengl.extraPackages = with pkgs; [ + rocm-opencl-icd # open-cl + amdvlk # or directly through mesa + amd-media-driver # libva + ]; + + # Force radv, TODO is this logical? + environment.variables.AMD_VULKAN_ICD = "RADV"; +} 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"; +} + |