Skip to content

Implement support for floating output paths#375

Open
poly2it wants to merge 3 commits into
serokell:masterfrom
poly2it:poly/ca-derivations
Open

Implement support for floating output paths#375
poly2it wants to merge 3 commits into
serokell:masterfrom
poly2it:poly/ca-derivations

Conversation

@poly2it

@poly2it poly2it commented May 16, 2026

Copy link
Copy Markdown

I took a shot at resolving the issues with ca-derivations (#164) since I use them quite frequently. This resolves the issues I was having, but you might want to test the changes further. The changes were implemented with help from Claude Opus 4.7. If this is an issue, I would like to make you aware of it.

This branch keeps the user-facing API unchanged. A Nix transformation, applied in both flake and non-flake eval modes, walks nodes.*.profiles.*. When path evaluates to a derivation, it is transformed such that path becomes outPath and a sibling drvPath is added. The binary picks up the new drvPath field on ProfileSettings and builds the .drv directly. The realised output is then resolved by calling nix path-info <drv>^out against the local or remote store. That resolved path is used throughout copy, activate, confirm, and revoke, so no stage falls back to the eval-time placeholder.

@poly2it poly2it marked this pull request as ready for review May 16, 2026 17:01
@poly2it

poly2it commented May 21, 2026

Copy link
Copy Markdown
Author

I pushed two additional commits to resolve an issue which was only made evident after initial support was implemented.

In Nix 2.34, path-info on a placeholder drv looked up its hash-modulo-keyed build trace directly and found the output. I updated to the Git version of Nix 2.35 for stability reasons, and found that the placeholder no longer has its own build-trace entry. Only the resolved derivation does, and the lookup must walk through the resolution step. The resolution does however still work through nix build, which is now used instead.

See this document in the Nix repository for an explanation to the changes:

https://github.com/NixOS/nix/blob/41b28ad2ed0f4dcde548fa9714136f714a7fd789/doc/manual/rl-next/build-trace-rework.md

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.

1 participant