about summary refs log tree commit diff
path: root/justfile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--justfile36
1 files changed, 23 insertions, 13 deletions
diff --git a/justfile b/justfile
index 94877a0..992a107 100644
--- a/justfile
+++ b/justfile
@@ -3,18 +3,13 @@ SSH_OPTIONS := "-o PubkeyAuthentication=no -o UserKnownHostsFile=/dev/null -o St
 nixdisk := "vda"
 nixaddr := ""
 
+hostname := lowercase(`hostname -s`)
+
 # update dependencies
+[group('nix')]
 update-deps:
 	nix flake update --commit-lock-file
 
-# build (and only build) the configuration for darwin
-build-darwin:
-	darwin-rebuild build --flake .#$(hostname -s)
-
-# build and switch the configuration for darwin
-switch-darwin:
-	darwin-rebuild switch --flake .#$(hostname -s)
-
 # a simple check to ensure the nix configuration is OK
 test-nix:
 	nix flake check
@@ -24,11 +19,25 @@ test-nix:
 fmt:
 	nix fmt
 
-build-wildcat:
-	nixos-rebuild build --target-host fcuny.net --build-host fcuny.net --fast --use-remote-sudo --use-substitutes --flake .#wildcat
+[group('machines')]
+[macos]
+build:
+	darwin-rebuild build --flake .#{{hostname}}
+
+[group('machines')]
+[macos]
+switch:
+	darwin-rebuild switch --flake .#{{hostname}}
+
+[group('machines')]
+[linux]
+build:
+	nixos-rebuild build --flake .#{{hostname}}
 
-switch-wildcat:
-	nixos-rebuild switch --target-host fcuny.net --build-host fcuny.net --fast --use-remote-sudo --use-substitutes --flake .#wildcat
+[group('machines')]
+[linux]
+switch:
+	nixos-rebuild switch --flake .#{{hostname}}
 
 vm-bootstrap:
 	#!/usr/bin/env bash
@@ -61,5 +70,6 @@ vm-copy:
 	rsync -av -e 'ssh {{SSH_OPTIONS}}' \
 		--exclude='.git/' \
 		--exclude='result' \
+		--exclude='.direnv/' \
 		--rsync-path="sudo rsync" \
-		$(dirname justfile)/ root@{{nixaddr}}:/nix-config
+		$(dirname justfile)/ {{nixaddr}}:/nix-config