nix-configs/modules/common/nix.nix

29 lines
798 B
Nix
Raw Normal View History

2024-05-31 00:27:06 -04:00
{ lib, inputs, config, ... }: {
2024-05-03 00:26:20 -04:00
programs.git.enable = true;
2024-05-31 00:27:06 -04:00
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 7d";
};
2024-05-30 20:39:54 -04:00
nix = let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
2024-05-03 00:26:20 -04:00
in {
settings = {
experimental-features = [ "nix-command" "flakes" ];
flake-registry = "";
nix-path = config.nix.nixPath;
};
2024-04-27 22:10:36 -04:00
optimise.automatic = true;
2024-05-30 20:39:54 -04:00
registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
2024-05-03 00:26:20 -04:00
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
2024-04-27 22:10:36 -04:00
};
system.autoUpgrade = {
enable = true;
flake = "git+https://git.icanttype.org/cdombroski/nix-configs.git";
allowReboot = true;
2024-05-30 20:39:54 -04:00
rebootWindow = {
lower = "02:00";
upper = "06:00";
};
2024-04-27 22:10:36 -04:00
};
}