From 32e79a06e30d6e7f54f1b1f37243e1e4f4229141 Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Fri, 13 Nov 2026 20:59:31 -0800 Subject: [PATCH] refactor(integrations): set a kept profile with nix build --profile 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 --- lib-overlays/integrations/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib-overlays/integrations/default.nix b/lib-overlays/integrations/default.nix index 05a1de2..b7ab722 100644 --- a/lib-overlays/integrations/default.nix +++ b/lib-overlays/integrations/default.nix @@ -2073,7 +2073,7 @@ # `activationPackage` holds `activate`, which checks for drift # against the nearest configuration above with an activation # (`driftCheckOf`, when `warn`), and points the profile at - # `package` with `nix-env --profile`, which also makes the + # `package` with `nix build --profile`, which also makes the # profile a garbage-collector root. When the profile already # points at `package`, it changes nothing, so activating the same # generation again adds no generation to the profile. @@ -2138,7 +2138,7 @@ profile="${path}" ${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname "$profile")" if [ "$(${pkgs.coreutils}/bin/readlink -f "$profile" 2>/dev/null || true)" != '${package}' ]; then - ${pkgs.nix}/bin/nix-env --profile "$profile" --set '${package}' + ${pkgs.nix}/bin/nix --extra-experimental-features nix-command build --no-link --profile "$profile" '${package}' fi ''; };