mirror of
https://github.com/smg1024/homelab.git
synced 2026-05-22 20:32:58 +09:00
add homelab rebuild just recipes
This commit is contained in:
parent
bfbd5a5152
commit
a06f0fb5f6
1 changed files with 25 additions and 0 deletions
25
Justfile
Normal file
25
Justfile
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue