diff --git a/hosts/common/disks/btrfs-impermanence-disk.nix b/hosts/common/disks/btrfs-impermanence-disk.nix new file mode 100644 index 0000000..f8e4091 --- /dev/null +++ b/hosts/common/disks/btrfs-impermanence-disk.nix @@ -0,0 +1,71 @@ +{ + lib, + disk ? "/dev/vda", + withSwap ? false, + swapSize, + config, + ... +}: { + disko.devices = { + disk = { + disk0 = { + type = "disk"; + device = disk; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + start = "1M"; + end = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = ["defaults"]; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = ["-f"]; # Override existing partition + # Subvolumes must set a mountpoint in order to be mounted, + # unless their parent is mounted + subvolumes = { + "@root" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@persist" = { + mountpoint = "${config.hostSpec.persistFolder}"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@swap" = lib.mkIf withSwap { + mountpoint = "/.swapvol"; + swap.swapfile.size = "${swapSize}G"; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/common/disks/zfs-impermanence-disk.nix b/hosts/common/disks/zfs-impermanence-disk.nix deleted file mode 100644 index 4ea9de9..0000000 --- a/hosts/common/disks/zfs-impermanence-disk.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - lib, - pkgs, - disk ? "/dev/vda", - withSwap ? false, - swapSize, - config, - ... -}: { - disko.devices = { - disk = { - disk0 = { - }; - }; - }; -}