1
0
Fork 0
dotfiles/justfile

38 lines
1.1 KiB
Makefile
Raw Normal View History

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 \
2024-11-08 23:27:59 +00:00
--store 'ssh-ng://root@{{target}}' \
2024-07-24 07:54:07 +00:00
'.#{{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}}"
2024-11-11 20:39:52 +00:00
sync
2024-07-24 07:54:07 +00:00
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