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
|
2024-12-07 23:36:10 +00:00
|
|
|
nix path-info --derivation /run/current-system | xargs attic push nifoc-systems ;
|
2024-11-11 23:05:14 +00:00
|
|
|
find ./.direnv -maxdepth 1 -name 'flake-profile-*' -type l -exec attic push nifoc-systems {} \;
|
2024-07-24 07:54:07 +00:00
|
|
|
|
|
|
|
# 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}}'
|
2024-12-07 23:36:10 +00:00
|
|
|
ssh -t '{{target}}' 'attic push nifoc-systems /run/current-system'
|
|
|
|
ssh -t '{{target}}' 'nix path-info --derivation /run/current-system | xargs attic push nifoc-systems ;'
|
2024-07-24 07:54:07 +00:00
|
|
|
|
|
|
|
_git-pull:
|
|
|
|
-git pull
|