createGeneration(): Always create an indirect root

This means profiles outside of /nix/var/nix/profiles don't get
garbage-collected. It also means we don't need to scan
/nix/var/nix/profiles for GC roots anymore, except for compatibility
with previously existing generations.
This commit is contained in:
Eelco Dolstra 2020-09-03 11:12:38 +02:00
parent b74f5cdd23
commit b07167be5a
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -105,7 +105,7 @@ Path createGeneration(ref<LocalFSStore> store, Path profile, StorePath outPath)
user environment etc. we've just built. */
Path generation;
makeName(profile, num + 1, generation);
store->addPermRoot(outPath, generation, false, true);
store->addPermRoot(outPath, generation, true);
return generation;
}