niksos/modules/cli/nh.nix

44 lines
1,001 B
Nix
Raw Normal View History

2024-05-08 20:49:06 +02:00
{
config,
inputs,
lib,
pkgs,
...
}: let
2024-07-15 23:18:25 +02:00
cfg = config.poz.programs.nh;
2024-05-08 20:49:06 +02:00
2024-07-25 11:45:44 +02:00
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption mkOption;
2024-05-08 20:49:06 +02:00
inherit (lib.types) str;
in {
2024-07-15 23:18:25 +02:00
options.poz.programs.nh = {
2024-05-08 20:49:06 +02:00
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="
];
};
2024-05-08 20:49:06 +02:00
programs.nh = {
enable = true;
package = inputs.nh.packages.${pkgs.system}.default;
inherit (cfg) flake;
clean = {
enable = true;
dates = "weekly";
extraArgs = "--keep 10";
};
};
};
}