diff --git a/global/fs/bcachefs.nix b/global/fs/bcachefs.nix new file mode 100644 index 00000000..a779d7bd --- /dev/null +++ b/global/fs/bcachefs.nix @@ -0,0 +1,22 @@ +{ pkgs +, lib +, config +, ... }: with lib; let + cfg = config.global.fs; +in { + options.global.fs.bcachefs = { + options = mkOption { + type = with types; listOf str; + default = [ "noatime" "compression=zstd" ]; + description = "bcachefs mount options"; + }; + }; + + config = mkIf (cfg.type == "bcachefs") { + fileSystems."/nix" = + { inherit (cfg.bcachefs) options; + device = "/dev/disk/by-uuid/${cfg.store}"; + fsType = "bcachefs"; + }; + }; +} diff --git a/global/fs/default.nix b/global/fs/default.nix index 40aeaaea..e2c80c57 100644 --- a/global/fs/default.nix +++ b/global/fs/default.nix @@ -9,7 +9,7 @@ in { ./f2fs.nix ./xfs.nix ./zfs.nix - #./bcachefs.nix + ./bcachefs.nix ]; options.global.fs = {