-
Notifications
You must be signed in to change notification settings - Fork 3
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
Require flake.lock to be up-to-date if it exists #96
Conversation
We allow flakes without a flake.lock checked in (similar to how, in the Rust ecosystem, sometimes library authors don't commit their Cargo.lock), but we require flakes that do have a flake.lock to be up-to-date.
55ab445
to
8b56f4d
Compare
Tested with:
(Looks similar to below)
|
.arg("flake") | ||
.arg("metadata") | ||
.arg("--json") | ||
.arg("--no-update-lock-file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the special sauce right here: if nix flake metadata --json
would have updated the flake.lock, this causes Nix (and thus the entire upload) to fail (which we want).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: constuct vec of args, use (Command).args() to add it to the command, then you can re-use the args for the error message instead of repeating it. (Just in case we change the command again later, so we don't to change error strings too). But this is mostly just golfing.
but LGTM
This will prevent uploading of flakes that need to be re-locked.