niksos/modules/cli/nh.nix
2024-08-06 17:46:57 +02:00

34 lines
740 B
Nix

{
config,
inputs,
lib,
pkgs,
...
}: let
cfg = config.poz.programs.nh;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) str;
in {
options.poz.programs.nh = {
enable = mkEnableOption "nh";
flake = mkOption {
type = str;
description = "flake directory";
};
};
config = mkIf cfg.enable {
programs.nh = {
enable = true;
package = inputs.nh.packages.${pkgs.system}.default;
inherit (cfg) flake;
clean = {
enable = true;
dates = "weekly";
extraArgs = "--keep 10";
};
};
};
}