-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
nixFlakes: can't figure out nix-instantiate equivalent #3908
Comments
I think it's on purpose, Eelco wanted to hide the .drv implementation detail. With the idea that it will allow us to change the format down the line. |
This blocks "the good way" of doing large remote nix builds. I sympathize with the desire to iterate on the format, but can that be done in a backward compatible way that still allows all of the places where I've been using drvs? I know I'm not the only one that nix-instantiates, copies drvs, and then uses cachix to move binaries. |
We do the same but on-premise cache. |
I remembered that |
It should always possible to get the drv path with something like |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/to-flake-or-not-to-flake/10047/4 |
I marked this as stale due to inactivity. → More info |
Please un-stale. |
It's worth saying that this is the current approach taken by |
My primary use case is for |
More generally, most of the new-style commands that act on a derivation or a store path indifferently accept a litteral store path or a Nix expression/flake ref as input (and will transparently build it or not depending on whether it needs to) |
Going back to the original motivation for the issue (fast remote builds by instantiating locally, copying the drv and building remotely), it's worth pointing out that this is possible with: $ nix build --eval-store auto --store ${remoteMachine} .#foo |
|
I've found out |
This is brilliant, thank you @plietar , this effectively answers the question and closes the ticket. Solid! |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tool-for-evaluating-stateversion-changes/31043/6 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/webkit-2-36-3-keeps-trying-to-build-from-source-nixos-22-05/19874/12 |
How would this be used in a flake with only nixosConfigurations? like this:
it complains that it does not provide an atribute:
|
I think you're looking for:
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/webkit-2-36-3-keeps-trying-to-build-from-source-nixos-22-05/19874/13 |
Describe the bug
I can't figure out the equivalent for many
nix-instantiate
commands. Another bug #???? describes hownix eval
andnix eval --{raw|json}
behave differently. And the latter that works for me, returns the out path, rather than the derivation (this feels similar to how nix copy aggressively builds instead of just copying drvs #3696).How do I get the drv path for a flake output? This is what I have now, I don't like it:
EDIT (workaround)
You can do something like this instead:
This gives you a
/nix/store/abc123..thing.drv
path that you can thennix copy --derivation
ornix-copy-closure
to a remote machine to build, etc.The text was updated successfully, but these errors were encountered: