# Nomarchy installer disk layout — single disk, GPT, 1 GiB ESP, BTRFS # root with subvolumes, optionally under LUKS2. Invoked by # nomarchy-install via: # # disko --mode destroy,format,mount \ # --argstr mainDrive /dev/nvme0n1 \ # --arg withLuks true \ # disko-config.nix # # Ported from the previous iteration's golden-path config (multi-disk # RAID and the impermanence snapshot dropped for v1 — see git history # of installer/disko-config.nix at 3bdfc35 when adding them back). # Function arguments, not sed-templating: escaping shell into Nix # proved fragile twice before. { mainDrive , withLuks ? true , ... }: let btrfsMountOptions = [ "compress=zstd" "noatime" ]; rootBtrfs = { type = "btrfs"; extraArgs = [ "-f" ]; subvolumes = { "@" = { mountpoint = "/"; mountOptions = btrfsMountOptions; }; "@home" = { mountpoint = "/home"; mountOptions = btrfsMountOptions; }; "@nix" = { mountpoint = "/nix"; mountOptions = btrfsMountOptions; }; "@log" = { mountpoint = "/var/log"; mountOptions = btrfsMountOptions; }; }; }; in { disko.devices.disk.main = { type = "disk"; device = mainDrive; content = { type = "gpt"; partitions = { # 1 GiB ESP — fits several kernel generations + initrd. ESP = { priority = 1; name = "ESP"; start = "1M"; end = "1G"; type = "EF00"; content = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; mountOptions = [ "umask=0077" ]; }; }; root = { size = "100%"; content = if withLuks then { type = "luks"; name = "crypted"; passwordFile = "/tmp/nomarchy-luks.key"; settings.allowDiscards = true; content = rootBtrfs; } else rootBtrfs; }; }; }; }; }