nix-configs/modules/common/nix.nix

29 lines
875 B
Nix

{pkgs, lib, inputs, config, ...}: {
environment.systemPackages = with pkgs; [
nix-output-monitor
];
programs.git.enable = true;
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = {
experimental-features = [ "nix-command" "flakes" ];
flake-registry = "";
nix-path = config.nix.nixPath;
};
gc = {
automatic = true;
options = "--delete-older-than 30d";
dates = "weekly";
};
optimise.automatic = true;
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
system.autoUpgrade = {
enable = true;
flake = "git+https://git.icanttype.org/cdombroski/nix-configs.git";
allowReboot = lib.mkDefault true;
rebootWindow = { lower = "02:00"; upper = "06:00"; };
};
}