nixos-config/system/nix.nix
Felix Schröter 4f22b0857d
feat(flake): add nix-community cachix to nix substituters
Also sets substituters on flake.nix's `nixConfig` in addition to
`nixosConfiguration`s `nix.settings`.
2023-09-13 16:01:57 +02:00

26 lines
603 B
Nix

{ lib, inputs, nixConfig, ... }:
let flakes = lib.filterAttrs (name: value: value ? outputs) inputs;
in {
nix.gc = {
automatic = true;
dates = "04:00";
options = "--delete-older-than 30d";
};
nix.settings = {
trusted-users = [ "@wheel" ];
auto-optimise-store = true;
substituters = nixConfig.extra-substituters;
trusted-public-keys = nixConfig.extra-trusted-public-keys;
};
system.autoUpgrade = {
enable = true;
dates = "03:00";
flake = "/etc/nixos";
flags = with lib;
flatten (mapAttrsToList (n: _: [ "--update-input" n ]) flakes);
};
}