add remote build support

This commit is contained in:
2024-10-01 15:18:59 +05:30
parent b5e35948af
commit 58fd2639f7
2 changed files with 6 additions and 6 deletions

View File

@ -1,16 +1,15 @@
#!/usr/bin/env bash
export NIX_SSHOPTS="-A"
build_remote=false
hosts="$1"
hostname=$(hostname)
target_hosts="$1"
shift
if [ -z "$hosts" ]; then
if [ -z "$target_hosts" ]; then
echo "No hosts to deploy"
exit 2
fi
for host in ${hosts//,/ }; do
nixos-rebuild --flake .\#$host switch --target-host $host --use-remote-sudo --log-format internal-json -v |& nom --json $@
for target_host in ${target_hosts//,/ }; do
nixos-rebuild switch --flake .#$target_host --target-host $target_host --build-host $hostname --use-remote-sudo --use-substitutes --log-format internal-json -v $@
done

View File

@ -33,6 +33,7 @@
settings = {
experimental-features = "nix-command flakes";
auto-optimise-store = true;
trusted-users = ["${username}"];
};
};