feat(fs): add zfs external nix store
This commit is contained in:
parent
ffa2202f50
commit
0fd97aa5ef
|
@ -20,6 +20,7 @@ in {
|
||||||
type = with types; attrsOf str;
|
type = with types; attrsOf str;
|
||||||
description = "zfs dataset mountpoints";
|
description = "zfs dataset mountpoints";
|
||||||
};
|
};
|
||||||
|
externalStore = mkEnableOption "external nix store filesystem";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.type == "zfs") {
|
config = mkIf (cfg.type == "zfs") {
|
||||||
|
@ -29,10 +30,11 @@ in {
|
||||||
# required by impermanence
|
# required by impermanence
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
}) cfg.zfs.mountpoints) // {
|
}) cfg.zfs.mountpoints) // {
|
||||||
"/nix" =
|
"/nix" = (if !cfg.zfs.externalStore then
|
||||||
{ device = "${cfg.store}/nix";
|
{ device = "${cfg.store}/nix";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
};
|
} else
|
||||||
|
{ inherit (cfg.external) device fsType options; });
|
||||||
};
|
};
|
||||||
global.fs.zfs.mountpoints."/nix/persist" = "persist";
|
global.fs.zfs.mountpoints."/nix/persist" = "persist";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue