From fd1485d077c06414752a90d2aef84b09d8a4cca2 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 12 Nov 2026 02:33:44 +0000 Subject: populate: name inputs of generated flakes validly Generated flakes used source names as input names, but Nix accepts fewer names there than populate does, e.g. not alt-1.0 or self. Following such a source failed late, at locking, with an error mentioning neither krops nor the source. Names Nix doesn't accept get replaced by ones derived from them. An edge case follows a source named alt-1.0. --- tests/scenarios.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/scenarios.nix b/tests/scenarios.nix index 0e54054..6dbb84d 100644 --- a/tests/scenarios.nix +++ b/tests/scenarios.nix @@ -945,6 +945,17 @@ assert !(krops.isLocalTarget (targets.remote "/")); } ]; }) + (s "source-name" { + phases = twice { + sources = { + "alt-1.0".file = "/fixtures/alt"; + x.file = { path = "/fixtures/filesrc"; inputs.dep.follows = "alt-1.0"; }; + }; + check = '' + expect_eq msg "$(nix_eval_online "$T"/.populate/flakes/x#msg)" top:alt,sub + ''; + }; + }) ] ++ lib.optional (targetKind == "local") # The target has the path the input is locked to. (s "uselocal" { -- cgit v1.3.1