feat: improve deploy script so it works with sudo, tell agents to use it.

This commit is contained in:
Gabriel Fontes
2026-06-14 21:46:57 -03:00
parent 6c8edbb05c
commit ea31f2b813
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ Conventional commits: `type(scope): description`
- Format check: `nix fmt`
- Build a host: `nixos-rebuild build --flake .#{host}`
- Deploy a host: `./deploy.sh {host}` or `nixos-rebuild --flake .#{host} switch --target-host {host} --use-remote-sudo`
- Deploy a host: `./deploy.sh {host}`
- Home-manager standalone: `home-manager switch --flake .#{user}@{host}`
- CI/CD: Hydra at `hydra.m7.rs` builds all hosts on push; hosts auto-upgrade from the latest successful build (see `modules/nixos/hydra-auto-upgrade.nix`).
+2 -3
View File
@@ -1,8 +1,7 @@
#!/usr/bin/env bash
# Helper script to quickly deploy config to a host. Use it for rapid iteration.
export NIX_SSHOPTS="-A"
build_remote=false
hosts="$1"
shift
@@ -12,5 +11,5 @@ if [ -z "$hosts" ]; then
fi
for host in ${hosts//,/ }; do
nixos-rebuild --flake .\#$host switch --target-host $host --use-remote-sudo --use-substitutes $@
nixos-rebuild --flake .\#$host test --target-host $host --ask-sudo-password --use-substitutes $@
done