mirror of
https://github.com/smg1024/homelab.git
synced 2026-05-22 20:32:58 +09:00
25 lines
716 B
Makefile
25 lines
716 B
Makefile
nixos_rebuild := "github:NixOS/nixpkgs/nixos-25.11#nixos-rebuild"
|
|
|
|
# List available homelab commands.
|
|
default:
|
|
@just --list
|
|
|
|
# Activate a host configuration without making it the boot default.
|
|
[group('homelab')]
|
|
test host:
|
|
@just _rebuild {{ host }} test
|
|
|
|
# Activate a host configuration and make it the boot default.
|
|
[group('homelab')]
|
|
switch host:
|
|
@just _rebuild {{ host }} switch
|
|
|
|
_rebuild host action:
|
|
@case "{{ host }}" in yggdrasil|midgard) ;; *) echo "unknown host: {{ host }}" >&2; exit 2;; esac
|
|
nix run {{ nixos_rebuild }} -- \
|
|
{{ action }} \
|
|
--fast \
|
|
--flake ".#{{ host }}" \
|
|
--build-host "{{ host }}" \
|
|
--target-host "{{ host }}" \
|
|
--use-remote-sudo
|