diff --git a/global/fs/zfs.nix b/global/fs/zfs.nix index 66252da3..149273c5 100644 --- a/global/fs/zfs.nix +++ b/global/fs/zfs.nix @@ -20,6 +20,7 @@ in { type = with types; attrsOf str; description = "zfs dataset mountpoints"; }; + externalStore = mkEnableOption "external nix store filesystem"; }; config = mkIf (cfg.type == "zfs") { @@ -29,10 +30,11 @@ in { # required by impermanence neededForBoot = true; }) cfg.zfs.mountpoints) // { - "/nix" = + "/nix" = (if !cfg.zfs.externalStore then { device = "${cfg.store}/nix"; fsType = "zfs"; - }; + } else + { inherit (cfg.external) device fsType options; }); }; global.fs.zfs.mountpoints."/nix/persist" = "persist";