Quickly add a non-leaf path to the nix store #555

Open
opened 2024-10-21 22:00:42 +00:00 by lolbinarycat · 1 comment

I am the developer of nix-inst. one of the primary goals of the project is performance, however, there is a major bottleneck:

the only way to create a store object that contains references to other store objects is to build a derivation.

simply using nix-store --add with a directory containing symlinks to the nix store will not work correctly with garbage collection.

Describe the solution you'd like

A nix-store flag that makes --add recurse into the directory and look for symlinks to store paths

Describe alternatives you've considered

change the default behavior of nix-store, add a new subcommand, or gate this feature behind the new cli.

Additional context

this would allow me to nearly double the performance of nix-inst on lix systems.

## Is your feature request related to a problem? Please describe. I am the developer of [nix-inst](https://codeberg.org/binarycat/nix-inst/). one of the primary goals of the project is performance, however, there is a major bottleneck: the only way to create a store object that contains references to other store objects is to build a derivation. simply using `nix-store --add` with a directory containing symlinks to the nix store will not work correctly with garbage collection. ## Describe the solution you'd like A `nix-store` flag that makes `--add` recurse into the directory and look for symlinks to store paths ## Describe alternatives you've considered change the default behavior of `nix-store`, add a new subcommand, or gate this feature behind the new cli. ## Additional context this would allow me to nearly double the performance of nix-inst on lix systems.
Owner

you are looking for nix-store --import. you will have to create the format it expects manually because we have no writers for it, and considering that the thing we think you are asking for (scanning any directory for references and adding those as dependencies) is fundamentally unsound that's about as good as it gets.

you are looking for `nix-store --import`. you will have to create the format it expects manually because we have no writers for it, and considering that the thing we think you are asking for (scanning any directory for references and adding those as dependencies) is fundamentally unsound that's about as good as it gets.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#555
No description provided.