-
-
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
Allow overriding flake.lock file location via command-line #5673
Comments
This would be extremely useful. I have a wrapper script that passes through flake input overrides, but there's not a good way for me to "pass those" through into a tmux/zellij script. However, if this feature existed, I could easily apply the overrides at the "top" with this env var set, and then any child scripts would "just do the right thing". big +1 for me, this would be useful for lots of scenarios and hopefully wouldn't be too hard to support? |
I'm hacking on something: https://github.com/colemickens/nix/tree/flakes-flake-lock-loc-env-var. I think it sorta works? |
@ElvishJerricco and I have implemented this with two options (one for the lock file to reference, one for the new lock file to write) in #8042. |
Fantastic, I've come back around to wanting this again! Thanks @lheckemann ! |
Closing this as #8042 was merged. |
Is your feature request related to a problem? Please describe.
I'd like to propose allowing to override the
flake.lock
location to ease continuous integration of nix flakes (with hydra in mind).I'm currently using hydra to do CI for my (not-yet-flakes) nix-based projects, which offers the functionality to pull in the most recent versions of a jobset's inputs and then build some derivations that are derived from these. I've got some jobsets set up that always build my projects against the "bleeding edge" versions of some other project, which I do however pin down to some known good version for development using a poor-man's-flake.lock.
With flakes this would change a little. The jobset maps to a flake and the jobsets inputs are hard-coded inside the flake's
flake.lock
. One currently cannot override these locked inputs from hydra. (Thenix
CLI does however already offer a way to override individual inputs explicitly via--override-input
)This implies that to recreate the previously mentioned feature of fetching the latest versions of multiple inputs, one would have to set up a separate service that regularly updates and commits the
flake.lock
file.Describe the solution you'd like
I'd like to be able to both produce and consume a
flake.lock
file to/from an (out-of-tree) location.Thus the hydra (or other CI) workflow could be done in the following way:
flake.lock
outside of the repo vianix flake lock --recreate-lock-file --lock-file=/path/to/flake.lock
nix build --lock-file=/path/to/flake.lock
flake.lock
for the evaluation and offer it for download (Maybe with a link like:nix build --lock-file=https://hydra.nixos.org/eval/12345/flake.lock .
)Describe alternatives you've considered
default.nix
that somehow usesbuiltins.getFlake
and overrides the inputs manually.nix build
The text was updated successfully, but these errors were encountered: