nixos-rebuild-ng: validate NixOS config path in target host#419006
Merged
thiagokokada merged 1 commit intoNixOS:masterfrom Jun 22, 2025
Merged
nixos-rebuild-ng: validate NixOS config path in target host#419006thiagokokada merged 1 commit intoNixOS:masterfrom
thiagokokada merged 1 commit intoNixOS:masterfrom
Conversation
Contributor
Author
In NixOS#418243 we started to validate NixOS config path to avoid a nasty bug in Nix, but this doesn't work in the `--build-host` and `--target-host` case because the configuration will not be available in the local host to check if it contains a `nixos-version`. This moves the check to `--target-host` instead, that is probably the correct choice anyway. Fix NixOS#418868.
Contributor
|
Oops... Yeah, that's a more sensible place to put it. Looks good. |
|
Seems to work for me, when it did not before ❯ nix run github:thiagokokada/nixpkgs/0f6624e21a7300a11029507e7c6638a7689ff5a5#nixos-rebuild-ng -- switch --flake .#vmcloud-server --target-host root@MYIP --build-host root@MYIP --show-trace
building the system configuration...
copying 0 paths...
activating the configuration...
setting up /etc...
reloading user units for myuser...
reloading user units for root...
restarting sysinit-reactivation.target
reloading the following units: dbus.service
Done. The new configuration is /nix/store/91f1vyhys9c2ywn2ak311pjiq6rxvkzj-nixos-system-vmcloud-server-25.11.20250619.08f2208 |
Contributor
|
Successfully created backport PR for |
1 task
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.
In #418243 we started to validate NixOS config path to avoid a nasty bug in Nix, but this doesn't work in the
--build-hostand--target-hostcase because the configuration will not be available in the local host to check if it contains anixos-version. This moves the check to--target-hostinstead, that is probably the correct choice anyway.Fix #418868.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.