mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-05 20:56:33 +05:30
add remote build support
This commit is contained in:
11
deploy.sh
11
deploy.sh
@ -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
|
||||
|
@ -33,6 +33,7 @@
|
||||
settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
trusted-users = ["${username}"];
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user