feat(build-img): add -P/--add-package for extra base image packages - #42
Merged
Conversation
Extra packages are added on top of BASE_PACKAGES. The resulting package list is recorded in /nix/.base.packages (packaged and hashed with the image), and `pkg` reads it to know which packages are built-in, falling back to BASE_PACKAGES for older images. Remove the unused --flake-dir option. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XG7ZPAubVzGgDUEXVbT7Sa
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.
Summary
-P/--add-packageflag tobuild-img. The packages are added to the defaultBASE_PACKAGESlist, which is then sorted and deduplicated./nix/.base.packages. It is included in the image tarball and in the base image hash.pkgreads/nix/.base.packagesto decide which packages are built-in, so packages added with-Pshow up inpkg list.pkg installrefuses them as already installed, andpkg removerefuses them as built-in. Older images without the file fall back toBASE_PACKAGES.-f/--flake-diroption. It wasn't used by the Makefile, CI, or docs.-Pin the README's "Custom builds" section.Testing
build-img -P hello -P jq --uncompressedbuilt an image. The tarball contains.base.packageswith 36 entries: the 35 defaults plushello.jqis already a default, so it appears only once. Thehellostore path is in the image.pkg liston a host without.base.packageslists the 35 defaults as built-in, which exercises the fallback.cargo fmt --checkpasses. Clippy reports no new warnings (thepid_lookup.rswarning was already there).pkg listinside a realdivesession using a newly built image.🤖 Generated with Claude Code
https://claude.ai/code/session_01XG7ZPAubVzGgDUEXVbT7Sa