Something went wrong. Try again.
forked from nix-community/disko
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143{ disko.devices = { disk = { vdb = { device = "/dev/vdb"; type = "disk"; content = { type = "gpt"; partitions = { vdb1 = { type = "EF00"; size = "100M"; content = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; mountOptions = [ "umask=0077" ]; }; };
vdb2 = { size = "100%"; content = { type = "bcachefs"; # This refers to a filesystem in the `bcachefs_filesystems` attrset below. filesystem = "mounted_subvolumes_in_multi"; label = "group_a.vdb2"; extraFormatArgs = [ "--discard" ]; }; }; }; }; };
vdc = { device = "/dev/vdc"; type = "disk"; content = { type = "gpt"; partitions = { vdc1 = { size = "100%"; content = { type = "bcachefs"; filesystem = "mounted_subvolumes_in_multi"; label = "group_a.vdc1"; extraFormatArgs = [ "--discard" ]; }; }; }; }; };
vdd = { device = "/dev/vdd"; type = "disk"; content = { type = "gpt"; partitions = { vdd1 = { size = "100%"; content = { type = "bcachefs"; filesystem = "mounted_subvolumes_in_multi"; label = "group_b.vdd1"; extraFormatArgs = [ "--force" ]; }; }; }; }; };
vde = { device = "/dev/vde"; type = "disk"; content = { type = "gpt"; partitions = { vdd1 = { size = "100%"; content = { type = "bcachefs"; filesystem = "relies_on_external_subvolume"; label = "group_a.vde1"; }; }; }; }; }; };
bcachefs_filesystems = { # Example showing mounted subvolumes in a multi-disk configuration. mounted_subvolumes_in_multi = { type = "bcachefs_filesystem"; passwordFile = "/tmp/secret.key"; extraFormatArgs = [ "--compression=lz4" "--background_compression=lz4" ]; subvolumes = { # Subvolume name is different from mountpoint. "subvolumes/root" = { mountpoint = "/"; mountOptions = [ "verbose" ]; }; # Subvolume name is the same as the mountpoint. "subvolumes/home" = { mountpoint = "/home"; }; # Nested subvolume doesn't need a mountpoint as its parent is mounted. "subvolumes/home/user" = { }; # Parent is not mounted so the mountpoint must be set. "subvolumes/nix" = { mountpoint = "/nix"; }; # This subvolume will be created but not mounted. "subvolumes/test" = { }; }; };
# Example showing a bcachefs filesystem without subvolumes, # which relies on a subvolume in another filesystem being mounted # and uses a hard-coded UUID. relies_on_external_subvolume = { type = "bcachefs_filesystem"; mountpoint = "/home/Documents"; uuid = "64e50034-ebe2-eaf8-1f93-cf56266a8d86"; }; }; };}