nixos/global/fs/bcachefs.nix
2025-01-13 11:52:09 +08:00

31 lines
505 B
Nix

{
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";
};
};
}