nix store gc deletes drv files of profile entries even with keep-env-derivations #1095

Open
opened 2026-01-05 18:40:38 +00:00 by neobrain · 0 comments

Describe the bug

keep-env-derivations should prevent garbage-collection of .drv files corresponding to profile entries. Currently, Lix deletes such files even when that setting is enabled.

Notably this breaks vulnix, which reads the .drv file for each profile entry to discover dependencies.

Steps To Reproduce

  1. Add keep-env-derivations = true to your /etc/nix/nix.conf and reload the nix-daemon
  2. nix profile install ghostty
  3. Observe that nix derivation show /nix/store/<path-to-installed>-ghostty-1.2.3 successfully prints the derivation
  4. nix store gc -v (observe that it includes ghostty-1.2.3.drv)
  5. Observe that nix derivation show /nix/store/<path-to-installed>-ghostty-1.2.3 will now print error: '/nix/store/...-ghostty-1.2.3' does not have a known deriver

Expected behavior

The .drv file should survive garbage collection.

nix --version output

nix (Lix, like Nix) 2.94.0

## Describe the bug `keep-env-derivations` should prevent garbage-collection of `.drv` files corresponding to profile entries. Currently, Lix deletes such files even when that setting is enabled. Notably this breaks vulnix, which reads the `.drv` file for each profile entry to discover dependencies. ## Steps To Reproduce 0. Add `keep-env-derivations = true` to your /etc/nix/nix.conf and reload the nix-daemon 1. `nix profile install ghostty` 2. Observe that `nix derivation show /nix/store/<path-to-installed>-ghostty-1.2.3` successfully prints the derivation 3. `nix store gc -v` (observe that it includes ghostty-1.2.3.drv) 4. Observe that `nix derivation show /nix/store/<path-to-installed>-ghostty-1.2.3` will now print `error: '/nix/store/...-ghostty-1.2.3' does not have a known deriver` ## Expected behavior The `.drv` file should survive garbage collection. ## `nix --version` output `nix (Lix, like Nix) 2.94.0`
raito added this to the 2.95 milestone 2026-01-05 18:51:38 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1095
No description provided.