-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the bug
I expected nix flake update --inputs-from ~/another-flake nixpkgs to copy the input from another-flake to the flake in $PWD.
It fails with:
warning: not writing lock file of flake 'git+file:///path-to-current-flake' because it has an unlocked input ('github:NixOS/nixpkgs/nixos-unstable?narHash=sha256-<hash>')
~/another-flake has a lockfile entry for nixpkgs which includes a rev and a narHash.
It seems to me that rather than failing, a useful natural behaviour would be to make use of the lock file entry in ~/another-flake. I'm not totally certain though what the intended behaviour of inputs-from is, and whether what I'm asking for is really a new feature request with a different name than --inputs-from.
Steps To Reproduce
- Have two flakes
- From the directory of one, the nixpkgs input from one to the other:
nix flake update --inputs-from ~/another-flake nixpkgs - Observe warning and that the lockfile is left unmodified.
Expected behavior
I expected the flake lock entry for the requested input (nixpkgs) to be essentially copied from one to the other.
Metadata
nix (Nix) 2.31.2
Additional context
If I supply --option allow-dirty-locks true, then the command succeeds, but it records the ref rather than the rev into the locked entry.
There is --reference-lock-file, but this does not seem to do what I'm after either.
Checklist
- checked latest Nix manual (source)
- checked open bug issues and pull requests for possible duplicates
Add 👍 to issues you find important.