diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-13 12:25:38 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-13 12:25:38 +0200 |
commit | a649086767928e5c3f3f10c552d6baf951c08e50 (patch) | |
tree | a6e6af660b67b6bdd9c735cc2b4c747ef68def38 /rebuild-system | |
parent | 6b443335b97cc2d6479595313e5a19d2f49c6b7a (diff) | |
download | utils-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-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 $@ | ||