justfile: add deploy2

This commit is contained in:
41666 2024-03-30 01:39:34 -04:00
parent 9277d55791
commit 4af658a0ae

View file

@ -75,6 +75,10 @@ deploy target_host extra_flags="":
@test -f nixos/hosts/{{target_host}}/.target || { echo "Host cannot be deployed, add a .target file with SSH destination"; exit 1; } @test -f nixos/hosts/{{target_host}}/.target || { echo "Host cannot be deployed, add a .target file with SSH destination"; exit 1; }
ssh -A `cat nixos/hosts/{{target_host}}/.target` sudo nixos-rebuild switch {{extra_flags}} --accept-flake-config --flake \"git+https://codeberg.org/noe/nixos.git?ref={{branch}}\&rev={{commit}}#{{target_host}}\" ssh -A `cat nixos/hosts/{{target_host}}/.target` sudo nixos-rebuild switch {{extra_flags}} --accept-flake-config --flake \"git+https://codeberg.org/noe/nixos.git?ref={{branch}}\&rev={{commit}}#{{target_host}}\"
deploy2 target_host extra_flags="":
@test -f nixos/hosts/{{target_host}}/.target || { echo "Host cannot be deployed, add a .target file with SSH destination"; exit 1; }
nixos-rebuild switch {{extra_flags}} --target-host root@`cat nixos/hosts/{{target_host}}/.target` --accept-flake-config --flake .#{{target_host}}
# #
ssh target_host *args='': ssh target_host *args='':
@test -f nixos/hosts/{{target_host}}/.target || { echo "Cannot SSH, add a .target file with SSH destination"; exit 1; } @test -f nixos/hosts/{{target_host}}/.target || { echo "Cannot SSH, add a .target file with SSH destination"; exit 1; }