diff options
author | regnat <rg@regnat.ovh> | 2021-06-29 13:53:56 +0200 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2021-06-29 13:56:48 +0200 |
commit | 4cff8188a5b59303f726a2497727fff34f9711d3 (patch) | |
tree | f3f8f1928f08f6286695bee870f492069cc0aff3 /src/libexpr | |
parent | 81535022dcf80ad43ba8b8bfa2549858431b601f (diff) |
Keep the `isFlake` attribute for overriden inputs
When overriding an input that isn’t a flake, mark the override as also not
being a flake.
Fix #3774
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/flake/flake.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc index 2e94490d4..8e6f06949 100644 --- a/src/libexpr/flake/flake.cc +++ b/src/libexpr/flake/flake.cc @@ -359,7 +359,12 @@ LockedFlake lockFlake( ancestors? */ auto i = overrides.find(inputPath); bool hasOverride = i != overrides.end(); - if (hasOverride) overridesUsed.insert(inputPath); + if (hasOverride) { + overridesUsed.insert(inputPath); + // Respect the “flakeness” of the input even if we + // override it + i->second.isFlake = input2.isFlake; + } auto & input = hasOverride ? i->second : input2; /* Resolve 'follows' later (since it may refer to an input |