I’ve set up a few repos with a shell.nix. One example:
let
pkgs = import
(
fetchTarball {
name = "21.05";
url = "https://github.com/NixOS/nixpkgs/archive/7e9b0dff974c89e070da1ad85713ff3c20b0ca97.tar.gz";
sha256 = "1ckzhh24mgz6jd1xhfgx0i9mijk6xjqxwsshnvq789xsavrmsc36";
})
{ };
in
pkgs.mkShell {
packages = [
pkgs.gnumake
pkgs.pre-commit
];
}
Even though I’ve pinned to a particular hash of nixpkgs and I activate this Nix shell almost every day this seems to rebuild every day. What could be causing that?
My configuration.nix has the following cleanup code based on the wiki:
nix = {
allowedUsers = [ "@wheel" ];
autoOptimiseStore = true;
extraOptions = ''
min-free = ${toString (100 * 1000 * 1000)}
max-free = ${toString (1000 * 1000 * 1000)}
'';
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 30d";
};
};
If I understand correctly this should only garbage collect 30 day old derivations, but something is removing very recent derivations.