summaryrefslogtreecommitdiff
path: root/justfile
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-01-04 21:31:17 -0800
committerFuwn <[email protected]>2025-01-04 21:31:17 -0800
commitd4c69a95f8f9e923081735b33cccc79311f93bb2 (patch)
tree4621f50878fd9deaff3bf0de484199d4adfed40f /justfile
parentnara: pearcleaner (diff)
downloadnixos-config-d4c69a95f8f9e923081735b33cccc79311f93bb2.tar.xz
nixos-config-d4c69a95f8f9e923081735b33cccc79311f93bb2.zip
just: default target to hostname
Diffstat (limited to 'justfile')
-rw-r--r--justfile6
1 files changed, 4 insertions, 2 deletions
diff --git a/justfile b/justfile
index 31874cc..05fecc3 100644
--- a/justfile
+++ b/justfile
@@ -1,10 +1,12 @@
+hostname := shell("hostname | sed 's/\\..*//' | tr '[:upper:]' '[:lower:]'")
+
default:
@just --list
action target action:
git add . && rui --allow-unfree --allow-insecure {{target}} {{action}} -- --impure
-build target:
+build target=hostname:
@uname | \
grep -q Darwin \
&& just darwin_action {{target}} build \
@@ -13,7 +15,7 @@ build target:
darwin_action target action:
nix run nix-darwin -- {{action}} --flake .#{{target}}
-switch target:
+switch target=hostname:
@uname | \
grep -q Darwin \
&& just darwin_action {{target}} switch \