niksos/modules/cli/nh.nix

34 lines
725 B
Nix
Raw Normal View History

2024-05-08 20:49:06 +02:00
{
config,
inputs,
lib,
pkgs,
...
}: let
cfg = config.myOptions.programs.nh;
2024-07-24 18:47:53 +02:00
inherit (lib.modules) mkEnableOption mkIf mkOption;
2024-05-08 20:49:06 +02:00
inherit (lib.types) str;
in {
options.myOptions.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";
};
};
};
}