add a script to deploy a single machine

This commit is contained in:
Andreas Zweili 2022-01-25 06:45:44 +01:00
parent 50b0be4198
commit a5b87a660f
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#!/usr/bin/env xonsh
rsa_key = "~/.nixos/secrets/ssh_keys/ansible/ansible.key"
$NIX_SSHOPTS="-t -i " + rsa_key
host = input("Please enter the host to deploy: ")
fqdn = "{}.2li.local".format(host)
print(fqdn)
print("-" * len(fqdn))
nixos-rebuild switch --use-remote-sudo --build-host localhost --target-host @(fqdn) --flake @(".#" + host)
#echo @(fqdn) @(".#" + host)
print("")
print("")