nix profile: build and read profiles through the store - #16395
Open
domenkozar wants to merge 1 commit into
Open
Conversation
domenkozar
force-pushed
the
store-backed-profiles
branch
4 times, most recently
from
August 31, 2026 03:40
039a849 to
0d8677d
Compare
Contributor
Hm, but I somewhat fail to see the usefulness of profiles in that case? Such profiles would be broken outside of a mount namespace that is set up for "chroot" stores. |
Member
Author
|
That’s expected. For example, while preparing a system under /mnt, its store physically lives at /mnt/nix/store, but becomes /nix/store when that system is entered or booted: $ nix profile add --store 'local?root=/mnt' --profile /mnt/root/.local/state/nix/profiles/profile … |
Member
|
I never learned why we stopped using |
xokdvium
reviewed
Sep 1, 2026
xokdvium
reviewed
Sep 1, 2026
domenkozar
force-pushed
the
store-backed-profiles
branch
from
September 1, 2026 12:49
04fd34c to
68c2cca
Compare
Build profile generations with builtin:buildenv through the store API, including support for rooted stores and max-jobs = 0. Harden manifest handling and preserve daemon-compat test expectations.
domenkozar
force-pushed
the
store-backed-profiles
branch
from
September 1, 2026 17:30
d4df0dc to
f8cd4ce
Compare
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.
Motivation
nix profileassumes that paths in the selected store are directly accessible through the host filesystem. It builds profile symlink trees in a temporary directory and readsmanifest.jsonthrough the profile path.This breaks for stores whose logical paths are not mounted locally, such as rooted or relocated stores.
Build and read profiles through the selected store instead, while preserving existing behavior for regular local profiles.
Context
Profile outputs are now produced by a
builtin:buildenvderivation in the selected store. The profile manifest is passed to the builder inline, so constructing the symlink tree no longer requires direct host-filesystem access to store paths.The supporting changes:
nix-envprofiles without silently treating them as empty;max-jobs = 0, since they cannot be offloaded;buildenvpackage encoding instead of consuming malformed input unchecked;nix profile historywith a warning.Functional coverage includes rooted-store profile creation and updates, the resulting symlink tree and manifest,
max-jobs = 0, dangling and non-store-backed profiles, and profile file conflicts.