2023-12-15 15:18:36 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
2023-12-15 16:08:47 +00:00
|
|
|
inputs,
|
2023-12-15 15:18:36 +00:00
|
|
|
...
|
|
|
|
}: {
|
2023-06-19 19:09:13 +00:00
|
|
|
# optimizations
|
|
|
|
nix.settings.auto-optimise-store = true;
|
2024-01-12 15:07:09 +00:00
|
|
|
nix.optimise = {
|
|
|
|
automatic = true;
|
2024-10-06 14:24:21 +00:00
|
|
|
dates = ["12:00"];
|
2024-01-12 15:07:09 +00:00
|
|
|
};
|
2023-06-19 19:09:13 +00:00
|
|
|
|
|
|
|
# garbage collection
|
|
|
|
nix.gc = {
|
|
|
|
automatic = true;
|
2024-01-12 15:07:09 +00:00
|
|
|
dates = "daily";
|
|
|
|
options = "--delete-older-than 14d";
|
2023-06-19 19:09:13 +00:00
|
|
|
};
|
2023-11-29 14:35:59 +00:00
|
|
|
|
|
|
|
# experimental features
|
2023-12-15 15:18:36 +00:00
|
|
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
2023-11-29 14:35:59 +00:00
|
|
|
|
|
|
|
# pin nixpkgs registry
|
2023-12-15 16:08:47 +00:00
|
|
|
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
2023-11-29 14:35:59 +00:00
|
|
|
|
|
|
|
# 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]}
|
2023-11-29 14:35:59 +00:00
|
|
|
nvd diff $(ls -dv /nix/var/nix/profiles/system-*-link | tail -2)
|
|
|
|
'';
|
2023-06-19 19:09:13 +00:00
|
|
|
}
|