files: fix activation under Nix 2.3

In Nix 2.3, all GC roots must be stored under `/nix/var/nix/gcroots`,
unless `--indirect` is specified. In Nix 2.4 and above, this flag is
ignored, because all GC roots created by `--add-root` are indirect.

Change-Id: I3eb3d7bc774af2ff336a2cdf312d30a99cdcb928
This commit is contained in:
V 2024-02-29 00:24:35 +01:00 committed by Robert Helgesson
parent b3a9fb9d05
commit 17431970b4
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED

View file

@ -274,7 +274,7 @@ in
run nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath"
fi
run --quiet nix-store --realise "$newGenPath" --add-root "$newGenGcPath"
run --quiet nix-store --realise "$newGenPath" --add-root "$newGenGcPath" --indirect
if [[ -e "$legacyGenGcPath" ]]; then
run rm $VERBOSE_ARG "$legacyGenGcPath"
fi