niksos/modules/cli/nh.nix
2024-05-08 20:49:06 +02:00

42 lines
978 B
Nix

{
config,
inputs,
lib,
pkgs,
...
}: let
cfg = config.myOptions.programs.nh;
inherit (lib) mkEnableOption mkIf mkOption;
inherit (lib.types) str;
in {
options.myOptions.programs.nh = {
enable = mkEnableOption "nh";
flake = mkOption {
type = str;
description = "flake directory";
};
};
config = mkIf cfg.enable {
nix.settings = {
substituters = [
"https://viperml.cachix.org"
];
trusted-public-keys = [
"viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8="
];
};
programs.nh = {
enable = true;
package = inputs.nh.packages.${pkgs.system}.default;
inherit (cfg) flake;
clean = {
enable = true;
dates = "weekly";
extraArgs = "--keep 10";
};
};
};
}