From ea6d6b16fa422d3fb0a7fea671d3637b89751721 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 12 Nov 2026 01:19:54 +0000 Subject: krops writeDeploy: pass --use-remote-sudo only with a separate build target For targets using sudo, writeDeploy runs nixos-rebuild on the target via sudo, so --use-remote-sudo has no effect there. It only matters when nixos-rebuild runs on a separate build target and activates the system on the target, so writeDeploy passes it only then. A new VM test, deploy, runs writeDeploy with a stand-in for nixos-rebuild, which records the user it runs as, NIX_PATH, and its arguments, for deploying flakes and other sources, with and without a separate build target, to every kind of target. --- tests/vm.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/vm.nix') diff --git a/tests/vm.nix b/tests/vm.nix index cb6385d..b46b015 100644 --- a/tests/vm.nix +++ b/tests/vm.nix @@ -28,7 +28,13 @@ let # system, they survive the scenarios collecting garbage. system.extraDependencies = [ plan "${./fixtures.sh}" ]; nix.settings.substituters = lib.mkForce []; - environment.systemPackages = [ pkgs.git pkgs.rsync ]; + environment.systemPackages = [ + pkgs.git + pkgs.rsync + (pkgs.writeScriptBin "nixos-rebuild" (builtins.readFile ./nixos-rebuild.sh)) + ]; + # The stand-in replaces nixos-rebuild. + system.disableInstallerTools = true; # Only warnings and errors on the console, which ends up in the log. services.journald.extraConfig = lib.mkAfter "MaxLevelConsole=warning"; boot.initrd.systemd.contents."/etc/systemd/journald.conf".text = -- cgit v1.3.1