Skip to content

builtins.getFlake: Support path values - #15290

Merged
edolstra merged 3 commits into
masterfrom
getflake-path
Apr 19, 2026
Merged

edolstra merged 3 commits into
masterfrom
getflake-path

Conversation

@edolstra

Copy link
Copy Markdown
Member

Motivation

This allows getting a subflake from the current source tree by doing

builtins.getFlake ./..

instead of the hacky

builtins.getFlake (builtins.flakeRefToString { type = "path"; path = self.sourceInfo.outPath; narHash = self.narHash; });

Based on DeterminateSystems#338 and part of DeterminateSystems#337.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

This allows doing `builtins.getFlake ./subflake` instead of ugly hacks.
@edolstra edolstra changed the title Getflake path builtins.getFlake: Support path values Feb 18, 2026
@github-actions github-actions Bot added the with-tests Issues related to testing. PRs with tests have some priority label Feb 18, 2026

@roberth roberth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice!

Comment thread src/libflake/flake.cc
@edolstra
edolstra requested a review from roberth February 18, 2026 21:28
@edolstra
edolstra enabled auto-merge February 18, 2026 21:36
Comment thread doc/manual/rl-next/getflake-path.md
Comment thread src/libflake/flake-primops.cc
@edolstra
edolstra added this pull request to the merge queue Apr 19, 2026
Merged via the queue into master with commit 5164938 Apr 19, 2026
18 checks passed
@edolstra
edolstra deleted the getflake-path branch April 19, 2026 01:40
@xokdvium xokdvium mentioned this pull request Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants