diff options
| author | Simon Holywell <simon@holywell.com.au> | 2019-10-30 15:11:00 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-30 15:11:00 +1000 |
| commit | 983dce6d7034ec4cd2ef0ab8a07207e896fefbf0 (patch) | |
| tree | 328a6d84fc573c5f52913cc15aa46ef326987a8d | |
| parent | da52dc006c42e25757f7b2f4aac398cf448a389d (diff) | |
Moves build & rebuild to after user creation
If the users do not already exist then installers who already have a configuration containing
```nix
services.nix-daemon.enable = false;
```
will not be able to complete an initial bootstrap on a clean machine. This is because the bootstrap script currently only creates users after an initial rebuild.
The users must exist before the rebuild is completed or the whole thing fails.
| -rwxr-xr-x | bootstrap.sh | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/bootstrap.sh b/bootstrap.sh index 9d0235c..a17a902 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -174,18 +174,6 @@ install(){ fi fi - # Bootstrap build using default nix.nixPath - echo "Bootstrapping..." - export NIX_PATH=darwin=$HOME/.nix-defexpr/channels/darwin:darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$NIX_PATH - $(nix-build '<darwin>' -A system --no-out-link)/sw/bin/darwin-rebuild switch || exit - - # Source generated bashrc - . /etc/static/bashrc - - # Run first darwin-rebuild switch - echo -e "Running first "$YELLOW"darwin-rebuild switch"$ESC"..." - darwin-rebuild switch && echo -e ""$GREEN"Success!"$ESC"" || exit_message "Problem running darwin-rebuild switch" - echo -e ""$BLUE_UL"Nix daemon"$ESC"" echo "Optionally, this script can also create the group and users" echo -e "needed for running the Nix "$YELLOW"multi-user support daemon"$ESC"." @@ -212,6 +200,18 @@ install(){ esac done fi + + # Bootstrap build using default nix.nixPath + echo "Bootstrapping..." + export NIX_PATH=darwin=$HOME/.nix-defexpr/channels/darwin:darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$NIX_PATH + $(nix-build '<darwin>' -A system --no-out-link)/sw/bin/darwin-rebuild switch || exit + + # Source generated bashrc + . /etc/static/bashrc + + # Run first darwin-rebuild switch + echo -e "Running first "$YELLOW"darwin-rebuild switch"$ESC"..." + darwin-rebuild switch && echo -e ""$GREEN"Success!"$ESC"" || exit_message "Problem running darwin-rebuild switch" # Finish echo -e ""$GREEN"You're all done!"$ESC"" |
