infrastructure/hosts/hydrogen/system/nix/default.nix

29 lines
607 B
Nix
Raw Normal View History

2023-12-15 15:18:36 +00:00
{
lib,
pkgs,
nixpkgs,
...
}: {
2023-06-19 19:09:13 +00:00
# optimizations
nix.settings.auto-optimise-store = true;
# garbage collection
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# experimental features
2023-12-15 15:18:36 +00:00
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 = ''
2023-12-15 15:18:36 +00:00
PATH=$PATH:${lib.makeBinPath [pkgs.nvd pkgs.nix]}
nvd diff $(ls -dv /nix/var/nix/profiles/system-*-link | tail -2)
'';
2023-06-19 19:09:13 +00:00
}