about summary refs log tree commit diff stats
path: root/hosts
diff options
context:
space:
mode:
authorene <ene@sils.li>2023-02-01 20:22:29 +0100
committerene <ene@sils.li>2023-02-01 20:28:24 +0100
commita806c6776ea19ec068b7a60fde211310fd41d156 (patch)
treeb34083424e759459473b13b7c2f9f75cf9e8a80e /hosts
downloadnixos-config-a806c6776ea19ec068b7a60fde211310fd41d156.tar.gz
nixos-config-a806c6776ea19ec068b7a60fde211310fd41d156.zip
Initial commit
Diffstat (limited to 'hosts')
-rw-r--r--hosts/IDOHVE/configuration.nix23
-rw-r--r--hosts/IDOHVE/gpu.nix17
-rw-r--r--hosts/IDOHVE/hardware.nix85
-rw-r--r--hosts/IDOHVE/networking.nix10
4 files changed, 135 insertions, 0 deletions
diff --git a/hosts/IDOHVE/configuration.nix b/hosts/IDOHVE/configuration.nix
new file mode 100644
index 00000000..a3cf2b2c
--- /dev/null
+++ b/hosts/IDOHVE/configuration.nix
@@ -0,0 +1,23 @@
+# vim: ts=2
+{
+  config,
+  lib,
+  nixpkgs,
+  home-manager,
+  ...
+}: {
+  imports = [
+    ./hardware.nix
+    ./gpu.nix
+    ./networking.nix
+
+    ../../system/packages.nix
+    ../../system/users.nix
+
+    ../../services/nix.nix
+    ../../services/zsh.nix
+  ];
+
+
+  system.stateVersion = "23.05";
+}
diff --git a/hosts/IDOHVE/gpu.nix b/hosts/IDOHVE/gpu.nix
new file mode 100644
index 00000000..6796d04b
--- /dev/null
+++ b/hosts/IDOHVE/gpu.nix
@@ -0,0 +1,17 @@
+{
+  config,
+  pkgs,
+  lib,
+  ...
+}: {
+  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; # TODO
+
+  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.nix b/hosts/IDOHVE/hardware.nix
new file mode 100644
index 00000000..be55c07c
--- /dev/null
+++ b/hosts/IDOHVE/hardware.nix
@@ -0,0 +1,85 @@
+{
+  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/networking.nix b/hosts/IDOHVE/networking.nix
new file mode 100644
index 00000000..67e5bd15
--- /dev/null
+++ b/hosts/IDOHVE/networking.nix
@@ -0,0 +1,10 @@
+{config, lib, ...}: {
+  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
+  # (the default) this is the recommended approach. When using systemd-networkd it's
+  # still possible to use this option, but it's recommended to use it in conjunction
+  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
+  networking.useDHCP = lib.mkDefault true;
+  # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
+  # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
+  networking.hostName = "IDOHVE";
+}