-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add setting 'allow-dirty-locks' #12220
base: master
Are you sure you want to change the base?
Conversation
Nice! A flag with the note "don't push/publish this" seems far. Just to confirm: Once a flake lock is created with |
This allows writing lock files with dirty inputs, so long as they have a NAR hash. (Currently they always have a NAR hash, but with lazy trees that may not always be the case.) Generally dirty locks are bad for reproducibility (we can detect if the dirty input has changed, but we have no way to fetch it except substitution). Hence we don't allow them by default. Fixes NixOS#11181.
f19226a
to
e161393
Compare
No, currently you also need it when using the flake. But as I noted in the PR description, maybe we should lift this restriction. |
Silly me. I stopped reading after "Fixes #11181". I would recommend / welcome it that the flag is only used when locking. While one shouldn't get "dirty" locked flakes from others, I don't think that a preemptive refusal to work with them is helpful. And if one created the dirty flake, then that's already acknowledged. Maybe print a warning that a dirty input is being used (though too many warnings also have a numbing effect). |
First of all: Thanks @edolstra for the implementation of this fix! @NiklasGollenstede just to offer a different perspective: "allow-dirty-locks" should ease the development workflow, it should by no means be used in production. Regarding the mentioned APIs not supporting the passing of nix-flags:
|
Motivation
This allows writing lock files with dirty inputs, so long as they have a NAR hash. (Currently they always have a NAR hash, but with lazy trees that may not always be the case.)
Generally dirty locks are bad for reproducibility (we can detect if the dirty input has changed, but we have no way to fetch it except substitution). Hence we don't allow them by default.
Fixes #11181.
Note that currently you have to enable
allow-dirty-locks
both when locking and when using the lock file. The latter may be overkill. We could accept any existing lock entry so long as it has a NAR hash.Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.