Feature request: --delete-generations with --keep-booted #723
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
Importance
High
Importance
Low
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
Release Blocking
Non-urgent
Release Blocking
Urgent
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
Urgency
High
Urgency
Low
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#723
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is your feature request related to a problem? Please describe.
From time to time I notice that I lost my currently booted generation when nix-env --delete-generationsing, because I had so many nixos-rebuild switch in between that I removed the old ones (I usualy keep 5-10 generations).
It would be a nice feature to have a flag to remove generations, but keep the currently booted one (as one can be sure that it works).
Describe the solution you'd like
--keep-bootedflag (fornix-envandnic-collect-garbage) that would prevent deleting any/nix/var/nix/profiles/system-*-linksymlink that would point to the same as/run/booted-systemEven better (but would break current behavior) would be that
--keep-bootedwould be default behavior (so no need to add flag). Because I don't see any any drawback to always keep it (since it's a gc root anyway)Additional context
Port of https://github.com/NixOS/nix/issues/1095
that's not a problem lix can solve but something nixos must do.
--keep-bootedabsolutely not going to happen because it's overly specific and ill-defined. the better option here would be for nixos to add a second profile (booted-systemor something) and updating it only on reboots, which will both solve your immediate problem and possibly even give you a booted-generation log for times when you know that reboot three generations ago worked fine. you could even add such generation maintenande in an activation script.