From e90426e9abf1370851cd24557ae7ac897cdef297 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 13 Nov 2026 03:41:54 +0000 Subject: populate: fail on inputs drawn that the flake doesn't have Nix ignores an input that --override-input names but the flake doesn't have, with a warning, so a misspelt input name in inputs draws nothing, and the source keeps using its own input. Before changing anything, populate locks the flake of each source that draws inputs, with an empty flake in place of each input drawn, which may be unreachable, and fails, naming the source and the input, unless the flake has each input drawn. Below an input drawn from a source, the path continues in the flake of that source. An edge case misspells an input of the source's flake, and one below an input drawn from a source, both ways of drawing inputs. --- tests/scenarios.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/scenarios.nix b/tests/scenarios.nix index 89a3b09..e23d14e 100644 --- a/tests/scenarios.nix +++ b/tests/scenarios.nix @@ -1445,6 +1445,30 @@ assert !(krops.isLocalTarget (targets.remote "/")); ''; }]; }) + # Misspelt input names draw nothing, so they fail before anything + # changes: of the source's flake, and below an input drawn from a source. + (modes "inputs-typo" ({ draw, ... }: { + phases = [ + { + sources = alt // { + x.flake-input = { + url = "/fixtures/top"; name = "dep"; inherit fetchOnTarget; + } // draw { innr.follows = "alt"; }; + }; + expect.fail = "error: source x draws input innr from source alt, but its flake has no input innr"; + } + { + sources = { + x.flake = { + url = "/fixtures/top"; inherit fetchOnTarget; + } // draw { dep = { follows = "b"; inputs.qq.follows = "c2"; }; }; + b.file = "/fixtures/two"; + c2.file = "/fixtures/c2"; + }; + expect.fail = "error: source x draws input dep/qq from source c2, but the flake of source b has no input qq"; + } + ]; + })) # A signal ending populate leaves neither the ssh master nor the # temporary directory. (s "interrupt" { -- cgit v1.3.1