Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9c78f7f19645
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6e7f252ea656
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 3, 2020

  1. Make --override-input sticky

    When we do something like 'nix flake update --override-input nixpkgs
    ...', the override is now kept on subsequent calls. (If you don't want
    this behaviour, you can use --no-write-lock-file.)
    edolstra committed Apr 3, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6e7f252 View commit details
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/libexpr/flake/flake.cc
9 changes: 8 additions & 1 deletion src/libexpr/flake/flake.cc
Original file line number Diff line number Diff line change
@@ -458,8 +458,15 @@ LockedFlake lockFlake(
if (input.isFlake) {
auto inputFlake = getFlake(state, input.ref, {}, lockFlags.useRegistries, flakeCache);

/* Note: in case of an --override-input, we use
the *original* ref (input2.ref) for the
"original" field, rather than the
override. This ensures that the override isn't
nuked the next time we update the lock
file. That is, overrides are sticky unless you
use --no-write-lock-file. */
auto childNode = std::make_shared<LockedNode>(
inputFlake.lockedRef, inputFlake.originalRef, inputFlake.sourceInfo->info);
inputFlake.lockedRef, input2.ref, inputFlake.sourceInfo->info);

node->inputs.insert_or_assign(id, childNode);