Skip to content

Set a kept profile with nix build --profile - #162

Merged
clhodapp merged 1 commit into
mainfrom
feat/profiles-with-nix-build
Nov 14, 2026
Merged

clhodapp merged 1 commit into
mainfrom
feat/profiles-with-nix-build

Conversation

@clhodapp

Copy link
Copy Markdown
Contributor

The activate script of a kept profile, which the nvf, nixvim and nemacs integrations give each configuration, pointed the profile at the package with nix-env --set. It now runs nix build --no-link --profile, with nix-command enabled for that call, so the script calls no legacy command.

The generations it makes are the same links as before. On a profile with no package manifest, nix build --profile <path> <store path> sets a generation, nix profile history --profile <path> lists the generations, and nix profile rollback --profile <path> returns to the previous one. I checked that on a scratch profile. --no-link keeps the build from leaving a result link in the directory the script runs from, which a plain nix build --profile does.

The nemacs command in clhodapp/nemacs#2 lists and rolls back generations with those nix profile commands.

nix flake check --keep-going -L passes on x86_64-linux, VM tests included. CI runs the aarch64-darwin checks. The nix-env calls in the tests are left as they are: they set a profile by hand to simulate a user doing so.

🤖 Generated with Claude Code

The activate script of a kept profile, which nvf, nixvim and nemacs configurations have, pointed the profile at the package with nix-env --set. It now runs nix build --no-link --profile, with nix-command enabled for the call. The generations it makes are the same links, and nix profile history and nix profile rollback read them. --no-link keeps the build from leaving a result link in the directory the script runs from.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@clhodapp
clhodapp merged commit 82bcf40 into main Nov 14, 2026
28 of 30 checks passed
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