From 176141410a00dc8ef4376ea9d67b87a0b96ec68c Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 18 Oct 2025 10:39:01 -0700 Subject: move the disk configuration for rivendell as a profile --- profiles/disk/btrfs-on-luks.nix | 74 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 profiles/disk/btrfs-on-luks.nix (limited to 'profiles/disk/btrfs-on-luks.nix') diff --git a/profiles/disk/btrfs-on-luks.nix b/profiles/disk/btrfs-on-luks.nix new file mode 100644 index 0000000..3fe57f7 --- /dev/null +++ b/profiles/disk/btrfs-on-luks.nix @@ -0,0 +1,74 @@ +{ ... }: +let + btrfsopt = [ + "compress=zstd" + "noatime" + ]; +in +{ + services.btrfs.autoScrub.enable = true; + services.btrfs.autoScrub.fileSystems = [ + "/nix" + "/data" + ]; + + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "2G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "fmask=0022" + "dmask=0022" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "nixos"; + passwordFile = "/tmp/pass"; + settings = { + allowDiscards = true; + }; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "@root" = { + mountpoint = "/"; + mountOptions = btrfsopt; + }; + "@home" = { + mountpoint = "/home"; + mountOptions = btrfsopt; + }; + "@nix" = { + mountpoint = "/nix"; + mountOptions = btrfsopt; + }; + "@data" = { + mountpoint = "/data"; + mountOptions = btrfsopt; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} -- cgit v1.2.3