feat: nix buildpack#206
Draft
olevski wants to merge 5 commits into
Draft
Conversation
gabyx
reviewed
Apr 8, 2026
Comment on lines
+14
to
+17
| while IFS= read -r path; do | ||
| echo "---> Copying $path" | ||
| cp -rL "$path" "$nix_layer/nix/store/" | ||
| done < <(nix path-info --no-sandbox --recursive .#) |
There was a problem hiding this comment.
suggestion:
I would use nix copy to only copy the derivation you build
- build with
nix build --json --print-out-paths ".#default" --json | jq ".[].outputs.out"ornix build --print-out-paths ".#my-package" - Then you copy the closure to a new location with
nix copy /nix/store/... --to "$nix_layer/nix/store
There was a problem hiding this comment.
future: Also the attrset path in the installable .#default could be customized maybe ...: <flake-path>#<attribute>
./tools/nix#my-stuffor so...
maybe not so important....
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This works. The only thing left to do is that there is an order and grouping to image extensions. And by adding the 2nd one that installs nix in a build image if I flip the image extension order things break. I will check if you can have 2 groups of image extensions, rather than 1.
The buildpack works by:
nix build .... which places a bunch of symlinks to/nix/storein the buildpack layer/nix/storepoint to the buildpack layer with all the real filesSo usually when you run nix it produces stuff that symlinks to
/nix/storebut in this case we flip that around./nix/storein the run image is a symlink to the layer that contains the full store created from the buildpack. We cannot avoid/nix/storeand symlinks because the exectuables from nix are hardcoded to expect stuff exclusively in/nix/store.