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

Check whether flake.lock is in sync with inputs, offline #8637

Open
roberth opened this issue Jul 3, 2023 · 0 comments
Open

Check whether flake.lock is in sync with inputs, offline #8637

roberth opened this issue Jul 3, 2023 · 0 comments
Labels
feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking flakes

Comments

@roberth
Copy link
Member

roberth commented Jul 3, 2023

Is your feature request related to a problem? Please describe.

You'll generally want your lock file to be in a state where it doesn't require an update to become valid.
This can be checked without fetching anything, and such a check should be possible to perform with a fairly simple invocation.

It seems that nix flake lock --no-update-lock-file should do this, but it appears to fetch anyway.

Describe the solution you'd like

A command or nix flake lock flag that checks whether any lock entries must be updated, but does not actually update them. Instead it reports what would be updated.

If --no-update-lock-file needs to keep its current behavior, I'd suggest nix flake lock --dry-run. It should report the entries that need an update. Exit status reflects whether anything was updated. Exit status 0 means no updates, for easy use in CI or pre-commit checks.

Describe alternatives you've considered

Use Hercules CI. It fails the job when the lock file requires an update.

CI is a bit late though.

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added feature Feature request or proposal flakes fetching Networking with the outside (non-Nix) world, input locking labels Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking flakes
Projects
None yet
Development

No branches or pull requests

1 participant