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/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/default.nix') diff --git a/tests/default.nix b/tests/default.nix index e9ea769..1f3de5c 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,5 +1,5 @@ -# NixOS VM tests for populate, one test per source type, plus one for -# features spanning sources. Build all with nix-build tests, or one with, +# NixOS VM tests for populate, one test per source type, one for features +# spanning sources, and one for writeDeploy's arguments to nixos-rebuild. Build all with nix-build tests, or one with, # e.g., nix-build tests -A flake. { pkgs ? import ../pkgs {} }: @@ -12,6 +12,7 @@ let inherit (pkgs) lib; krops = import ../lib; inherit (pkgs) populate; + inherit (pkgs.krops) writeDeploy; url = "http://deployer:8000"; gitUrl = "git://deployer/gitsrc.git"; remoteHost = "target"; -- cgit v1.3.1