niksos/modules/cli/nh.nix
jacekpoz 629a57f88f
move most of the binary caches back into their modules
I actually have no idea what to do twith the nix community one
2024-09-03 01:36:22 +02:00

43 lines
1,001 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 {
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";
};
};
};
}