diff options
Diffstat (limited to 'hosts/enode/disko.nix')
| -rw-r--r-- | hosts/enode/disko.nix | 108 |
1 files changed, 91 insertions, 17 deletions
diff --git a/hosts/enode/disko.nix b/hosts/enode/disko.nix index 82e7d5f..d9dfb20 100644 --- a/hosts/enode/disko.nix +++ b/hosts/enode/disko.nix @@ -1,32 +1,106 @@ +let + espPartition = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "default" + ]; + }; + cryptroot = { + type = "luks"; + name = "cryptroot"; + content = { + type = "btrfs"; + extraArgs = [ + "-L" + "nixos" + "-f" + ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ + "subvol=root" + "compress=zstd" + "noatime" + ]; + }; + "/root-blank" = { + mountOptions = [ + "subvol=root-blank" + "nodatacow" + "noatime" + ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ + "subvol=home" + "compress=zstd" + "noatime" + ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "subvol=nix" + "compress=zstd" + "noatime" + ]; + }; + "/persist" = { + mountpoint = "/persist"; + mountOptions = [ + "subvol=persist" + "compress=zstd" + "noatime" + ]; + }; + "/lib" = { + mountpoint = "/var/lib"; + mountOptions = [ + "subvol=lib" + "compress=zstd" + "noatime" + ]; + }; + "/log" = { + mountpoint = "/var/log"; + mountOptions = [ + "subvol=log" + "compress=zstd" + "noatime" + ]; + }; + }; + }; + }; +in { disko.devices.disk.vm-disk = { - device = "/dev/vda"; type = "disk"; + device = "/dev/vda"; content = { type = "gpt"; partitions = { ESP = { - type = "EF00"; + label = "boot"; + name = "ESP"; size = "1G"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "umask=0077" - "nofail" - ]; - }; + type = "EF00"; + content = espPartition; }; - root = { + luks = { size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; + label = "luks"; + content = cryptroot; }; }; }; }; + + fileSystems."/var/log".neededForBoot = true; + fileSystems."/var/lib".neededForBoot = true; + fileSystems."/persist".neededForBoot = true; } |
