latest
This commit is contained in:
1 parent
c24749e281
commit
d67dbd92d0
4 files changed
+64
-25
No files matched your search
@@ -20,6 +20,10 @@ def main [] {
|
||||
help main
|
||||
}
|
||||
|
||||
def "main profiles" [] {
|
||||
valid_profiles | print
|
||||
}
|
||||
|
||||
# Build configuration
|
||||
def "main build" [] {
|
||||
nh os build | print
|
||||
@@ -56,10 +60,10 @@ def "main update" [input_name:string = ""] {
|
||||
def "main remote" [cmd:string, target:string = ""] {
|
||||
mut target_host = $"root@($target).lab.internal"
|
||||
mut profile = $"hl-($target)"
|
||||
if not (is-valid-profile $profile) {
|
||||
print $"Invalid Profile ($profile), please select one of:"
|
||||
return valid_profiles
|
||||
}
|
||||
# if not (is-valid-profile $profile) {
|
||||
# print $"Invalid Profile ($profile), please select one of:"
|
||||
# return valid_profiles
|
||||
# }
|
||||
$"Using [($profile)]" | print
|
||||
const valid_cmds = [
|
||||
"test" , "dry-activate" , "run" , "switch" , "build"
|
||||
@@ -69,7 +73,7 @@ def "main remote" [cmd:string, target:string = ""] {
|
||||
return $valid_cmds
|
||||
}
|
||||
$"($cmd) on ($target_host) with ($profile)" | print
|
||||
mut runcmd = $"nixos-rebuild ($cmd) --target-host ($target_host) --use-remote-sudo --flake .#($profile)"
|
||||
mut runcmd = $"nixos-rebuild ($cmd) --target-host ($target_host) --sudo --flake .#($profile)"
|
||||
$runcmd | print
|
||||
bash -c $runcmd
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user