server-configs/shared/modules/easy-zfs-mounts.nix

19 lines
388 B
Nix
Raw Permalink Normal View History

2024-08-08 12:16:04 +00:00
{ config, lib, ... }:
with lib;
let
cfg = config.mine.zfsMounts;
in {
options.mine.zfsMounts = mkOption {
type = types.attrsOf types.str;
default = {};
};
config = {
mine.zfsMounts = let
zfsFilesystems = lib.filterAttrs (_: v: v.fsType == "zfs") config.fileSystems;
in lib.mapAttrs' (_: v: lib.nameValuePair v.device v.mountPoint) zfsFilesystems;
};
}