diff options
| author | Preston Pan <ret2pop@gmail.com> | 2025-09-18 22:33:36 -0700 |
|---|---|---|
| committer | Preston Pan <ret2pop@gmail.com> | 2025-09-18 22:33:36 -0700 |
| commit | bb31a5a879154432e11a75e69070b58004ddc07b (patch) | |
| tree | 4bd092f8808e32947629b75e708830699d4773dc /nix/disko | |
| parent | cae70df061d9fc4f33a2da66a21c86eb3eb1fa3b (diff) | |
big refactor
Diffstat (limited to 'nix/disko')
| -rw-r--r-- | nix/disko/btrfs-simple.nix | 92 |
1 files changed, 61 insertions, 31 deletions
diff --git a/nix/disko/btrfs-simple.nix b/nix/disko/btrfs-simple.nix index 08fafd4..b49558d 100644 --- a/nix/disko/btrfs-simple.nix +++ b/nix/disko/btrfs-simple.nix @@ -1,37 +1,68 @@ { lib, config, ... }: let spec = { - disko.devices = { - disk = { - main = { - type = "disk"; - device = config.monorepo.vars.device; - content = { - type = "gpt"; - partitions = { - ESP = { - priority = 1; - name = "ESP"; - start = "1M"; - end = "128M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; + disko.devices = { + disk = { + main = { + type = "disk"; + device = config.monorepo.vars.device; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; }; - }; - root = { - size = "100%"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; # Override existing partition - mountpoint = "/"; - mountOptions = [ - "compress=zstd" - "noatime" - ]; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + passwordFile = "/tmp/secret.key"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + + "/home" = { + mountpoint = "/home"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + + "/persistent" = { + mountpoint = "/persistent"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + }; + }; + }; }; }; }; @@ -39,7 +70,6 @@ let }; }; }; -}; in { monorepo.vars.diskoSpec = spec; |
