summaryrefslogtreecommitdiff
path: root/rebuild-system
diff options
context:
space:
mode:
Diffstat (limited to 'rebuild-system')
-rw-r--r--rebuild-system13
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
3if [[ "$USER" != "root" ]]; then 3set -o errexit
4
5if [[ $(whoami) != "root" ]]; then
4 exec sudo -- $0 $@ 6 exec sudo -- $0 $@
5fi 7fi
6 8
7path=/etc/nixos 9configPath=$(nix-instantiate --eval --expr '<nixos-config>')
8 10
9git -C $path pull && \ 11@git@/bin/git -C ${configPath:h} pull
10 git -C $path submodule update && \ 12nixos-rebuild $@
11 nixos-rebuild $@