From bb31a5a879154432e11a75e69070b58004ddc07b Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Thu, 18 Sep 2025 22:33:36 -0700 Subject: big refactor --- nix/disko/btrfs-simple.nix | 92 ++++++++++++++++++++++++++++++---------------- 1 file changed, 61 insertions(+), 31 deletions(-) (limited to 'nix/disko/btrfs-simple.nix') 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; -- cgit v1.3