feat: initial macos setup

This commit is contained in:
2026-08-02 00:29:15 -04:00
parent fc86577c27
commit 925dd4114a
12 changed files with 210 additions and 47 deletions
+10 -4
View File
@@ -1,14 +1,20 @@
set positional-arguments
host := `hostname`
# Flake host key. On macOS the LocalHostName is what matches the flake key
# (after the first rebuild); on Linux it's the plain hostname.
# Override: just host=myname rebuild
host := if os() == "macos" { `scutil --get LocalHostName` } else { `hostname` }
# Pick the rebuild tool for the current OS.
rebuild-cmd := if os() == "macos" { "darwin-rebuild" } else { "nixos-rebuild" }
# Default: list available recipes.
default:
@just --list
# Rebuild the system and switch immediately
# Rebuild the system and switch immediately. Works on NixOS and macOS.
rebuild:
sudo nixos-rebuild switch --flake .#{{host}}
sudo {{rebuild-cmd}} switch --flake .#{{host}}
# Update flake.lock
update:
@@ -18,7 +24,7 @@ update:
clean:
sudo nix-collect-garbage --delete-older-than 7d
sudo nix-store --optimise
sudo nixos-rebuild boot --flake .#{{host}}
sudo {{ if os() == "macos" { "darwin-rebuild switch" } else { "nixos-rebuild boot" } }} --flake .#{{host}}
# Generate Ed25519 SSH keys for each named service (default: github gradescope).
# Override: just gen-keys gitlab bitbucket