all repos — nixfiles @ db88d0acb16a929fb112365e3256669a299a3313

System and user configuration, managed by nix and home-manager

os update: take target host from arg instead of basename

Alin
commit

db88d0acb16a929fb112365e3256669a299a3313

parent

a2ccc352c122adc4f8be07d368ccb0db89169c08

5 files changed, 33 insertions(+), 29 deletions(-)

changed files
A scripts/os/update
@@ -0,0 +1,33 @@
+#!/usr/bin/env fish +# update server with nixos-rebuild + +if test (path basename $PWD) != nixfiles + echo "not in nixfiles directory!" >&2 + return 1 +end + +argparse --move-unknown "r/remote&" "b/build-host=&" -- $argv + +set --local target "$argv[1]" +if test -z $target + echo "please specify target hostname" >&2 + return 1 +end + +set --local targetPlainHostname (string split --fields 1 --max 1 . $target) +set --local actions $argv[2] switch +set --local action $actions[1] +set --local build_host $_flag_build_host $target + +if set --query _flag_remote; or set --query _flag_build_host + set --function build_host_arg --build-host $build_host[1] +end + +nh os $action \ + --file . nixosConfigurations.{$targetPlainHostname} \ + $build_host_arg \ + --use-substitutes \ + --target-host {$target} \ + --show-trace \ + --elevation-strategy=passwordless \ + $argv_opts
D scripts/os/update/buk
@@ -1,1 +0,0 @@
-smrk
D scripts/os/update/prefect
@@ -1,1 +0,0 @@
-smrk
D scripts/os/update/r5
@@ -1,1 +0,0 @@
-smrk
D scripts/os/update/smrk
@@ -1,26 +0,0 @@
-#!/usr/bin/env fish -# update server with nixos-rebuild - -if test (path basename $PWD) != nixfiles - echo "not in nixfiles directory!" >&2 - return 1 -end - -argparse --move-unknown "r/remote&" "b/build-host=&" -- $argv - -set --local target (status basename) -set --local action (if test -n "$argv[1]"; echo $argv[1]; else echo "switch"; end) -set --local build_host $_flag_build_host $target - -if set --query _flag_remote; or set --query _flag_build_host - set --function build_host_arg --build-host $build_host[1] -end - -nh os $action \ - --file . nixosConfigurations.{$target} \ - $build_host_arg \ - --use-substitutes \ - --target-host {$target} \ - --show-trace \ - --elevation-strategy=passwordless \ - $argv_opts