1
0
Fork 0

deploy: adjust justfile

This commit is contained in:
Daniel Kempkens 2024-07-24 10:44:46 +02:00
parent a62e395a20
commit 40a0f4801e
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM

View file

@ -1,3 +1,6 @@
defaultLocalType := if os() == "macos" { "darwin" } else { "nixos" }
defaultRemoteType := "nixos"
default: default:
@just --list @just --list
@ -6,22 +9,26 @@ fmt:
treefmt treefmt
# Build a local machine # Build a local machine
build-local-machine target type='darwin': [group('build')]
build-local-machine target type=defaultLocalType:
nom build ".#{{type}}Configurations.{{target}}.config.system.build.toplevel" nom build ".#{{type}}Configurations.{{target}}.config.system.build.toplevel"
# Build a remote machine # Build a remote machine
build-remote-machine target type='nixos': [group('build')]
build-remote-machine target type=defaultRemoteType:
nom build --eval-store auto \ nom build --eval-store auto \
--store 'ssh-ng://root@{{target}}.ts.kempkens.network' \ --store 'ssh-ng://root@{{target}}.ts.kempkens.network' \
'.#{{type}}Configurations.{{target}}.config.system.build.toplevel' '.#{{type}}Configurations.{{target}}.config.system.build.toplevel'
# Deploy to a local machine # Deploy to a local machine
deploy-local-machine target type='darwin': _git-pull (build-local-machine target type) [group('deploy')]
deploy-local-machine target type=defaultLocalType: _git-pull (build-local-machine target type)
env TERM=xterm-256color {{type}}-rebuild switch --flake ".#{{target}}" env TERM=xterm-256color {{type}}-rebuild switch --flake ".#{{target}}"
attic push nifoc-systems /run/current-system attic push nifoc-systems /run/current-system
# Deploy to a remote machine # Deploy to a remote machine
deploy-remote-machine target type='nixos': _git-pull (build-remote-machine target type) [group('deploy')]
deploy-remote-machine target type=defaultRemoteType: _git-pull (build-remote-machine target type)
deploy --skip-checks '.#{{target}}' deploy --skip-checks '.#{{target}}'
ssh -t '{{target}}' attic push nifoc-systems /run/current-system ssh -t '{{target}}' attic push nifoc-systems /run/current-system