summaryrefslogtreecommitdiff
path: root/rebuild-system
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-04-13 12:25:38 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-04-13 12:25:38 +0200
commita649086767928e5c3f3f10c552d6baf951c08e50 (patch)
treea6e6af660b67b6bdd9c735cc2b4c747ef68def38 /rebuild-system
parent6b443335b97cc2d6479595313e5a19d2f49c6b7a (diff)
downloadutils-a649086767928e5c3f3f10c552d6baf951c08e50.tar
utils-a649086767928e5c3f3f10c552d6baf951c08e50.tar.gz
utils-a649086767928e5c3f3f10c552d6baf951c08e50.tar.bz2
utils-a649086767928e5c3f3f10c552d6baf951c08e50.tar.xz
utils-a649086767928e5c3f3f10c552d6baf951c08e50.zip
Refine rebuild-system
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 $@