From a06f0fb5f60eb6fea2de44348ec2936fc0b941c2 Mon Sep 17 00:00:00 2001 From: Poby <87608318+smg1024@users.noreply.github.com> Date: Thu, 21 May 2026 21:06:37 +0900 Subject: [PATCH] add homelab rebuild just recipes --- Justfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Justfile diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..5bab3f5 --- /dev/null +++ b/Justfile @@ -0,0 +1,25 @@ +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