Skip to content
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

Parse options to get the store path if it has been modified #158

Open
myclevorname opened this issue Nov 5, 2024 · 4 comments
Open

Parse options to get the store path if it has been modified #158

myclevorname opened this issue Nov 5, 2024 · 4 comments
Labels
configuration Issues about making nom configurable enhancement New feature or request

Comments

@myclevorname
Copy link

A partial solution I would propose to the limitation of the store path assumption is to parse the options provided to Nix to see if the user provided --store, and falling back to /. Then, append /nix/store to the end to get the store path. This wouldn't work if the store path was modified in nix.conf.

@maralorn
Copy link
Owner

maralorn commented Nov 5, 2024

I vaguely hope to get away from directly reading the nix store anyway and only interfacing with it via nix. That would probably help in most cases.

But I wouldn’t be strictly opposed to doing something like this. It wouldn’t make anything worse.

@maralorn maralorn added the enhancement New feature or request label Nov 5, 2024
@maralorn maralorn added the configuration Issues about making nom configurable label Nov 23, 2024
@lheckemann
Copy link

If you do this, the NIX_REMOTE environment variable should also be taken into account :)

@maralorn
Copy link
Owner

I am not certain yet, but I am kinda hoping that we can get away with never looking into the nix-store ourselves and instead just query nix for data. That way environment and config will be dealt with correctly. Only thing we need to figure out is which flags need to be forwarded to internal nix calls.

Until we solve that, are NIX_REMOTE and --store the only two options which we need to consider?

@lheckemann
Copy link

You can also set store in nix.conf, which in turn is picked up from multiple locations 🫣 I absolutely agree that only going through nix would be ideal, though I suspect we'd still have to work out what the store is?

eval-store might also be relevant -- I think the drvs end up in both eval-store and store but would usually make more sense to read from eval-store...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Issues about making nom configurable enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants