main
 1#!/usr/bin/env just --justfile
 2
 3set shell := ["bash", "-cu"]
 4
 5current_hostname:= `hostname`
 6
 7[private]
 8run-nh mode hostname=current_hostname *flags:
 9    nh os {{mode}} -f ./default.nix nixosConfigurations.{{hostname}} --hostname={{hostname}} \
10        {{if hostname != current_hostname {"--target-host=hpcesia@" + hostname} else {""}}} \
11        {{flags}}
12# Build system profile of specific host
13@build *args:
14    just run-nh build {{args}}
15# Build system profile of specific host, make it boot default
16@boot *args:
17    just run-nh boot {{args}}
18# Build and activate system profile of specific host, make it boot default
19@switch *args:
20    just run-nh switch {{args}}
21
22# REPL current configuration
23repl:
24    nix repl -f ./default.nix -v --show-trace
25
26# Write flake-files config into "flake.nix"
27write-flake:
28    nix run .#write-flake
29    nix flake lock