-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to prevent flake inputs source from garbage collected #3995
Comments
For this we would need to decide what the GC roots are. E.g. if you run BTW we had some flake GC root registration, but it had to be removed because it's not compatible with lazy flake input fetching (1b49479). |
I marked this as stale due to inactivity. → More info |
This is important to me: the use case is being able to run Why is this incompatible with lazy fetching? Adding a GC root to a path shouldn't require fetching it |
Could we make gcroots depend on paths and an argument? |
A use case for this is
I think in general if you add a GC root for something that you build though
Maybe flake operations should create an “aggregate root”? One that keeps both the output and the flake inputs alive? It could be as simple as another store path that references the flake inputs as well as the output. (Side note, it is possible to get the store paths of the inputs with |
Any workarounds on this? |
collectFlakeInputs = input:
[ input ] ++ concatMap collectFlakeInputs (builtins.attrValues (input.inputs or {})); Then, in a module that uses system.extraDependencies = collectFlakeInputs inputs.foo; |
To add to the previous answer, if you want to prevent all flake sources from being garbage collected, you can just paste this somewhere in your configuration: # Don't garbage collect flakes sources
system.extraDependencies = let
collectFlakeInputs = input: [ input ] ++ builtins.concatMap collectFlakeInputs (builtins.attrValues (input.inputs or {}));
in
builtins.concatMap collectFlakeInputs (builtins.attrValues inputs); |
Nothing is more upset than reconfiguring Internet on Internet outage requires Internet access :( Ref: NixOS/nix#3995 (comment)
Something similar to
keep-outputs = true
would be nice 😄The text was updated successfully, but these errors were encountered: