mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-14 04:52:56 +00:00
20 lines
607 B
Nix
20 lines
607 B
Nix
{ config, lib, ... }:
|
|
{
|
|
|
|
options = {
|
|
zfs.enable = lib.mkEnableOption "ZFS file system.";
|
|
};
|
|
|
|
config = lib.mkIf (config.server && config.zfs.enable) {
|
|
|
|
# Only use compatible Linux kernel, since ZFS can be behind
|
|
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
|
boot.kernelParams = [ "nohibernate" ];
|
|
boot.supportedFilesystems = [ "zfs" ];
|
|
services.prometheus.exporters.zfs.enable = config.prometheus.exporters.enable;
|
|
prometheus.scrapeTargets = [
|
|
"127.0.0.1:${builtins.toString config.services.prometheus.exporters.zfs.port}"
|
|
];
|
|
};
|
|
}
|