aboutsummaryrefslogtreecommitdiff
path: root/src/nix-collect-garbage/nix-collect-garbage.cc
diff options
context:
space:
mode:
authorThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2023-03-07 10:33:21 +0100
committerThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2023-03-07 13:08:04 +0100
commit2272bc6049e04f98d93f82f22497dc805fbe00cd (patch)
treebfb70378be117c0d9b66dd58bfbe13295e3b1d7d /src/nix-collect-garbage/nix-collect-garbage.cc
parentfc76852b661d90e30965c1808bd14a85645b67a0 (diff)
Fix `nix-collect-garbage -d` with the new profile location
Low-hanging fix for https://github.com/NixOS/nix/pull/5226#issuecomment-1454669399
Diffstat (limited to 'src/nix-collect-garbage/nix-collect-garbage.cc')
-rw-r--r--src/nix-collect-garbage/nix-collect-garbage.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nix-collect-garbage/nix-collect-garbage.cc b/src/nix-collect-garbage/nix-collect-garbage.cc
index 8a4fdcb93..3cc57af4e 100644
--- a/src/nix-collect-garbage/nix-collect-garbage.cc
+++ b/src/nix-collect-garbage/nix-collect-garbage.cc
@@ -77,8 +77,7 @@ static int main_nix_collect_garbage(int argc, char * * argv)
return true;
});
- auto profilesDir = settings.nixStateDir + "/profiles";
- if (removeOld) removeOldGenerations(profilesDir);
+ if (removeOld) removeOldGenerations(profilesDir());
// Run the actual garbage collector.
if (!dryRun) {