all repos — nixfiles @ a1ac76f2f16b4950343b0b9b507510879adf4cef

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

scripts/os/update/smrk (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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

nixos-rebuild $action \
    --flake .?submodules=1#{$target} \
    $build_host_arg \
    --target-host {$target} \
    --no-reexec \
    --sudo \
    $argv_opts