summaryrefslogtreecommitdiff
path: root/rebuild-system
blob: 93678baa4ac0f2156894e35d3f8875a9d52f3000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!@zsh@/bin/zsh

set -o errexit

if [[ $(whoami) != "root" ]]; then
    exec sudo -- $0 $@
fi

configPath=$(nix-instantiate --eval --expr '<nixos-config>')

@git@/bin/git -C ${configPath:h} pull --recurse-submodules
nixos-rebuild $@