fix(install): rewrite follows paths when grafting the upstream lock

Lock follows paths are absolute from the root node; nomarchy's nodes move
one level down in the composed downstream lock, so ["nixpkgs"] must
become ["nomarchy","nixpkgs"] — otherwise every follows dangles
("input 'nomarchy/home-manager/nixpkgs' follows a non-existent input").
Verified: the composed lock now resolves the full input tree with
`nix flake metadata --offline`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-06-10 17:53:11 +01:00
parent 7aba5fa0a8
commit 8881ad3bae

View File

@@ -40,6 +40,15 @@ def main() -> None:
if "nomarchy" in nodes:
sys.exit("compose-lock: upstream lock already has a 'nomarchy' node")
# Follows paths (list-valued inputs) are absolute from the lock's
# root; the copied nodes now live one level down, so ["nixpkgs"]
# must become ["nomarchy", "nixpkgs"]. Plain string values reference
# node keys directly and stay as they are.
for node in nodes.values():
for name, ref in node.get("inputs", {}).items():
if isinstance(ref, list):
node["inputs"][name] = ["nomarchy"] + ref
nodes["nomarchy"] = {
"inputs": nomarchy_inputs,
"locked": locked,