diff --git a/deploy.sh b/deploy.sh index 85956a2..00e7e6d 100755 --- a/deploy.sh +++ b/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 diff --git a/hosts/common/default.nix b/hosts/common/default.nix index ee3d5a1..4f49f45 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -33,6 +33,7 @@ settings = { experimental-features = "nix-command flakes"; auto-optimise-store = true; + trusted-users = ["${username}"]; }; };