flk prune
flk prune # current project
flk prune --global # global environment
flk prune --dry-run # list what would be removed
Every flk activate, refresh or switch that rebuilds an environment keeps only the newest generation of that profile’s .flk/.nix-profile-<profile> link. flk prune cleans up what older flk versions left behind:
- old
.nix-profile-<profile>-<N>-linkgenerations, - links and stamps of profiles that no longer exist,
.flk/resultfrom olderflk exportruns.
flk does not run garbage collection itself. Run nix-collect-garbage (or nix store gc) afterwards to free the store paths.