diff --git a/modules/nixos/disko/aarch64-linux/default.nix b/modules/nixos/disko/aarch64-linux/default.nix index 9c66f36..f674801 100644 --- a/modules/nixos/disko/aarch64-linux/default.nix +++ b/modules/nixos/disko/aarch64-linux/default.nix @@ -59,59 +59,45 @@ in }; root = { - name = "btrfs-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 = { - "home" = { - mountOptions = [ "compress=zstd" ]; - mountpoint = "/home"; - }; - "root" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/root"; - }; - "nix" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/nix"; - }; - "etc" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/etc"; - }; - "tmp" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/tmp"; - }; - "log" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/var/log"; - }; - }; + type = "bcachefs"; + # This refers to a filesystem in the `bcachefs_filesystems` attrset below. + filesystem = "mounted_subvolumes_in_multi"; + label = "ssd.ssd1"; + extraFormatArgs = [ + "--discard" + ]; }; }; }; }; }; + + bcachefs_filesystems = { + mounted_subvolumes_in_multi = { + type = "bcachefs_filesystem"; + # passwordFile = "/etc/nixos/pool.jwe"; + extraFormatArgs = [ + "--compression=zstd" + ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + }; + "/persistent" = { + mountpoint = "/persistent"; + }; + "/nix" = { + mountOptions = [ + "noatime" + ]; + mountpoint = "/nix"; + }; + }; + mountpoint = "/partition-root"; + }; + }; }; }; }