diff --git a/hosts/ni/default.nix b/hosts/ni/default.nix index 367b8f05..84b3d678 100644 --- a/hosts/ni/default.nix +++ b/hosts/ni/default.nix @@ -38,6 +38,10 @@ in }) ]; + disko.devices = import ./disko.nix { + disks = [ "/dev/nvme0n1" ]; + }; + services.openssh.hostKeys = [{ path = config.sops.secrets."ni/ssh-key".path; type = "ed25519"; diff --git a/hosts/ni/disko.nix b/hosts/ni/disko.nix new file mode 100644 index 00000000..564b0c8f --- /dev/null +++ b/hosts/ni/disko.nix @@ -0,0 +1,48 @@ +{ disks ? [ "/dev/nvme0n1" ], ... }: + +{ + disk.nvme0n1 = { + device = builtins.elemAt disks 0; + type = "disk"; + content = { + format = "gpt"; + type = "table"; + partitions = [ + { + name = "root"; + start = "512MiB"; + end = "-8GiB"; + part-type = "primary"; + content = { + type = "filesystem"; + mountpoint = "/"; + format = "ext4"; + }; + } + + { + name = "ESP"; + start = "0"; + end = "512MiB"; + bootable = true; + content = { + type = "filesystem"; + mountpoint = "/boot"; + format = "vfat"; + }; + } + + { + name = "swap"; + start = "-8GiB"; + end = "100%"; + part-type = "primary"; + content = { + type = "swap"; + randomEncryption = true; + }; + } + ]; + }; + }; +} diff --git a/hosts/ni/hardware-configuration.nix b/hosts/ni/hardware-configuration.nix index f36bb080..c2650f0e 100644 --- a/hosts/ni/hardware-configuration.nix +++ b/hosts/ni/hardware-configuration.nix @@ -42,22 +42,6 @@ }; boot.loader.efi.canTouchEfiVariables = true; - fileSystems."/" = { - label = "root"; - options = [ - "defaults" - "noatime" - ]; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - label = "boot"; - fsType = "vfat"; - }; - - swapDevices = [{ label = "swap"; }]; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault true;