scripts/os/update/linde (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #!/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 r/remote -- $argv
set --local target (status basename)
set --local action (if test -n "$argv[1]"; echo $argv[1]; else echo "switch"; end)
if set --query _flag_remote
set --function build_host --build-host root@{$target}
end
nixos-rebuild $action \
--flake .?submodules=1#{$target} \
$build_host \
--target-host root@{$target} \
--no-reexec
|