diff options
Diffstat (limited to 'rebuild-system')
-rw-r--r-- | rebuild-system | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/rebuild-system b/rebuild-system index 8f116e3..cd99ae5 100644 --- a/rebuild-system +++ b/rebuild-system | |||
@@ -1,11 +1,12 @@ | |||
1 | #!/usr/bin/env bash | 1 | #!@zsh@/bin/zsh |
2 | 2 | ||
3 | if [[ "$USER" != "root" ]]; then | 3 | set -o errexit |
4 | |||
5 | if [[ $(whoami) != "root" ]]; then | ||
4 | exec sudo -- $0 $@ | 6 | exec sudo -- $0 $@ |
5 | fi | 7 | fi |
6 | 8 | ||
7 | path=/etc/nixos | 9 | configPath=$(nix-instantiate --eval --expr '<nixos-config>') |
8 | 10 | ||
9 | git -C $path pull && \ | 11 | @git@/bin/git -C ${configPath:h} pull |
10 | git -C $path submodule update && \ | 12 | nixos-rebuild $@ |
11 | nixos-rebuild $@ | ||