infrastructure/hosts/hydrogen/system/nix/default.nix
2023-12-15 16:18:36 +01:00

29 lines
607 B
Nix

{
lib,
pkgs,
nixpkgs,
...
}: {
# optimizations
nix.settings.auto-optimise-store = true;
# garbage collection
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# experimental features
nix.settings.experimental-features = ["nix-command" "flakes"];
# pin nixpkgs registry
nix.registry.nixpkgs.flake = nixpkgs;
# print diff between two generations
system.activationScripts.nvd-report-changes = ''
PATH=$PATH:${lib.makeBinPath [pkgs.nvd pkgs.nix]}
nvd diff $(ls -dv /nix/var/nix/profiles/system-*-link | tail -2)
'';
}