From 40a0f4801e8dfa67ea7bb0f63d544f37033b77d0 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Wed, 24 Jul 2024 10:44:46 +0200 Subject: [PATCH] deploy: adjust justfile --- justfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/justfile b/justfile index c1802c4..1f50b7f 100644 --- a/justfile +++ b/justfile @@ -1,3 +1,6 @@ +defaultLocalType := if os() == "macos" { "darwin" } else { "nixos" } +defaultRemoteType := "nixos" + default: @just --list @@ -6,22 +9,26 @@ fmt: treefmt # 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" # Build a remote machine -build-remote-machine target type='nixos': +[group('build')] +build-remote-machine target type=defaultRemoteType: 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 -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}}" attic push nifoc-systems /run/current-system # 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}}' ssh -t '{{target}}' attic push nifoc-systems /run/current-system