diff --git a/machines/thinkman/configuration.nix b/machines/thinkman/configuration.nix index bdf232f..7ac3371 100644 --- a/machines/thinkman/configuration.nix +++ b/machines/thinkman/configuration.nix @@ -7,14 +7,11 @@ ./profiles.nix ./services.nix ./system.nix + ./disko-config.nix ]; networking.hostName = "thinkman"; - disko.devices = import ./disko-config.nix { - disks = [ "/dev/disk/by-id/nvme-eui.0025385b01410682" ]; - }; - sops = { defaultSopsFile = ./secrets.yaml; age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; diff --git a/machines/thinkman/disko-config.nix b/machines/thinkman/disko-config.nix index d2de2c1..90250b5 100644 --- a/machines/thinkman/disko-config.nix +++ b/machines/thinkman/disko-config.nix @@ -1,71 +1,72 @@ -{ disks ? [ "/dev/nvme0" ], ... }: { - disk = { - vdb = { - type = "disk"; - device = builtins.head disks; - content = { - type = "gpt"; - partitions = { - boot = { - size = "1M"; - type = "EF02"; # for grub MBR - }; - ESP = { - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "defaults" - ]; + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/disk/by-id/nvme-eui.0025385b01410682"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; # for grub MBR }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "encrypted"; - extraOpenArgs = [ "--allow-discards" ]; - passwordFile = "/tmp/disk.key"; + ESP = { + size = "512M"; + type = "EF00"; content = { - type = "lvm_pv"; - vg = "pool"; + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "encrypted"; + extraOpenArgs = [ "--allow-discards" ]; + passwordFile = "/tmp/disk.key"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; }; }; }; }; }; }; - }; - lvm_vg = { - pool = { - type = "lvm_vg"; - lvs = { - root = { - size = "100G"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + root = { + size = "100G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; }; - }; - home = { - size = "450G"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/home"; + home = { + size = "450G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/home"; + }; }; - }; - swap = { - size = "32G"; - content = { - type = "swap"; - randomEncryption = true; - resumeDevice = true; + swap = { + size = "32G"; + content = { + type = "swap"; + randomEncryption = true; + resumeDevice = true; + }; }; }; };