Skip to content

Fix from.flake sources - #33

Merged
vic merged 2 commits into
denful:mainfrom
jbgi:better-from-flake
Oct 18, 2026
Merged

vic merged 2 commits into
denful:mainfrom
jbgi:better-from-flake

Conversation

@jbgi

@jbgi jbgi commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Currently from.flake load flake inputs wrong, eg. inputs.nixpkgs in template/flake is not the same revision than with native flake load. Fixed by reusing same logic as in flake-compat.

@sini sini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed the fix. In templates/flake, the root nixpkgs points at lock node nixpkgs_2. Main picks the node literally named nixpkgs, which is home-manager's (/nix/store/kjqiqv5q…-source). This branch gives /nix/store/84xbks2h…-source, the same path as (builtins.getFlake "path:…").inputs.nixpkgs.outPath. just ci passes (53/53).

Two small things:

  • A leftover builtins.trace (inline). Any lock with a follows-path root input prints trace: <node>; I hit it with a probe lock that adds "nixpkgs-hm": ["home-manager", "nixpkgs"] to the root inputs.
  • A test would keep this from regressing: a fixture flake.lock where a root input name differs from its node name (like nixpkgs → nixpkgs_2), plus one follows-path root input.

Comment thread default.nix Outdated
@sini sini mentioned this pull request Oct 18, 2026
instead if loading all nodes, which is lead to different inputs than
native flake.

Also preserve node.locked attrs from flake.lock (not only outPath)
@jbgi
jbgi force-pushed the better-from-flake branch from aa4c79f to a2bc4f0 Compare October 18, 2026 08:29
@jbgi
jbgi requested a review from sini October 18, 2026 08:31
@vic
vic merged commit 41c1fb4 into denful:main Oct 18, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants