20 lines
607 B
Nix
Raw Normal View History

2024-04-20 09:42:06 -04:00
{ config, lib, ... }:
{
2023-02-25 11:22:31 -05:00
2024-04-20 09:42:06 -04:00
options = {
zfs.enable = lib.mkEnableOption "ZFS file system.";
};
2023-02-25 11:22:31 -05:00
config = lib.mkIf (config.server && config.zfs.enable) {
2023-02-25 11:22:31 -05:00
# Only use compatible Linux kernel, since ZFS can be behind
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.kernelParams = [ "nohibernate" ];
boot.supportedFilesystems = [ "zfs" ];
2024-04-20 09:42:06 -04:00
services.prometheus.exporters.zfs.enable = config.prometheus.exporters.enable;
prometheus.scrapeTargets = [
2024-04-20 09:42:06 -04:00
"127.0.0.1:${builtins.toString config.services.prometheus.exporters.zfs.port}"
];
};
2023-02-25 11:22:31 -05:00
}