2024-07-24 08:44:46 +00:00
|
|
|
defaultLocalType := if os() == "macos" { "darwin" } else { "nixos" }
|
|
|
|
defaultRemoteType := "nixos"
|
|
|
|
|
2024-07-24 07:54:07 +00:00
|
|
|
default:
|
|
|
|
@just --list
|
|
|
|
|
|
|
|
# Format the entire source tree
|
|
|
|
fmt:
|
|
|
|
treefmt
|
|
|
|
|
|
|
|
# Build a local machine
|
2024-07-24 08:44:46 +00:00
|
|
|
[group('build')]
|
|
|
|
build-local-machine target type=defaultLocalType:
|
2024-07-24 07:54:07 +00:00
|
|
|
nom build ".#{{type}}Configurations.{{target}}.config.system.build.toplevel"
|
|
|
|
|
|
|
|
# Build a remote machine
|
2024-07-24 08:44:46 +00:00
|
|
|
[group('build')]
|
|
|
|
build-remote-machine target type=defaultRemoteType:
|
2024-07-24 07:54:07 +00:00
|
|
|
nom build --eval-store auto \
|
|
|
|
--store 'ssh-ng://root@{{target}}.ts.kempkens.network' \
|
|
|
|
'.#{{type}}Configurations.{{target}}.config.system.build.toplevel'
|
|
|
|
|
|
|
|
# Deploy to a local machine
|
2024-07-24 08:44:46 +00:00
|
|
|
[group('deploy')]
|
|
|
|
deploy-local-machine target type=defaultLocalType: _git-pull (build-local-machine target type)
|
2024-07-24 07:54:07 +00:00
|
|
|
env TERM=xterm-256color {{type}}-rebuild switch --flake ".#{{target}}"
|
|
|
|
attic push nifoc-systems /run/current-system
|
|
|
|
|
|
|
|
# Deploy to a remote machine
|
2024-07-24 08:44:46 +00:00
|
|
|
[group('deploy')]
|
|
|
|
deploy-remote-machine target type=defaultRemoteType: _git-pull (build-remote-machine target type)
|
2024-07-24 07:54:07 +00:00
|
|
|
deploy --skip-checks '.#{{target}}'
|
|
|
|
ssh -t '{{target}}' attic push nifoc-systems /run/current-system
|
|
|
|
|
|
|
|
_git-pull:
|
|
|
|
-git pull
|