59 lines
1.9 KiB
Makefile
59 lines
1.9 KiB
Makefile
set positional-arguments
|
|
|
|
host := `hostname`
|
|
|
|
# Default: list available recipes.
|
|
default:
|
|
@just --list
|
|
|
|
# Rebuild the system and switch immediately
|
|
rebuild:
|
|
sudo nixos-rebuild switch --flake .#{{host}}
|
|
|
|
# Update flake.lock
|
|
update:
|
|
nix flake update
|
|
|
|
# Clean up old generations and optimize store, then bake the result for next boot
|
|
clean:
|
|
sudo nix-collect-garbage --delete-older-than 14d
|
|
sudo nix-store --optimise
|
|
sudo nixos-rebuild boot --flake .#{{host}}
|
|
|
|
# Generate Ed25519 SSH keys for each named service (default: github gradescope).
|
|
# Override: just gen-keys gitlab bitbucket
|
|
gen-keys *services='github gradescope h2p durrantlab signing_git scienting_git scienting_static_sites':
|
|
@./scripts/gen-keys.sh {{services}}
|
|
|
|
# Download the latest NixOS installer ISO into iso/.
|
|
# Override defaults: just fetch-iso --channel nixos-unstable --edition minimal
|
|
fetch-iso *args:
|
|
@./scripts/fetch-iso.sh "$@"
|
|
|
|
# Write a bootable NixOS installer USB.
|
|
# Example: just make-usb --iso iso/latest-nixos-graphical-x86_64-linux.iso
|
|
# The script self-elevates via sudo if needed.
|
|
make-usb *args:
|
|
@./scripts/make-usb.sh "$@"
|
|
|
|
# Scaffold hosts/<name>/ and add a flake.nix entry.
|
|
# Example: just register-host blackbear
|
|
register-host name:
|
|
@./scripts/register-host.py --repo-root . "{{name}}"
|
|
|
|
# Capture the current machine's hardware into hosts/<name>/hardware.nix.
|
|
# Run this on the new machine.
|
|
# Example: just capture-hardware blackbear
|
|
capture-hardware name:
|
|
@./scripts/capture-hardware.sh "{{name}}"
|
|
|
|
# Show which hosts are currently registered in flake.nix.
|
|
hosts:
|
|
@./scripts/list-hosts.py
|
|
|
|
# Seed ~/.docker/config.json and (for pass) set up the GPG key + pass store.
|
|
# Override store: just docker-creds secretservice
|
|
# Unprotected key: just docker-creds pass --no-passphrase
|
|
docker-creds store='pass' flag='':
|
|
@./scripts/docker-creds.sh "{{store}}" "{{flag}}"
|