diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-03-16 17:16:21 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-03-16 22:36:36 +0000 |
commit | cb6d0ec12187e0c2c11b203f3d8fa62790628141 (patch) | |
tree | 0ca0fedc67d5676e89438cffa3e0865eee0962e4 /nixpkgs/nixos/modules/installer | |
parent | 4d83b8e578d3a0b78d2694921c944172b009036a (diff) | |
parent | da1a2b1eeafa66b4419b4f275396d8a731eccb61 (diff) | |
download | nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.gz nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.bz2 nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.lz nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.xz nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.zst nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.zip |
Merge commit 'da1a2b1eeafa66b4419b4f275396d8a731eccb61'
Diffstat (limited to 'nixpkgs/nixos/modules/installer')
-rw-r--r-- | nixpkgs/nixos/modules/installer/tools/nixos-install.sh | 13 | ||||
-rw-r--r-- | nixpkgs/nixos/modules/installer/virtualbox-demo.nix | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/nixpkgs/nixos/modules/installer/tools/nixos-install.sh b/nixpkgs/nixos/modules/installer/tools/nixos-install.sh index defc46ad2a72..8685cb345e1e 100644 --- a/nixpkgs/nixos/modules/installer/tools/nixos-install.sh +++ b/nixpkgs/nixos/modules/installer/tools/nixos-install.sh @@ -138,7 +138,18 @@ fi # Ask the user to set a root password, but only if the passwd command # exists (i.e. when mutable user accounts are enabled). if [[ -z $noRootPasswd ]] && [ -t 0 ]; then - nixos-enter --root "$mountPoint" -c '[[ -e /nix/var/nix/profiles/system/sw/bin/passwd ]] && echo "setting root password..." && /nix/var/nix/profiles/system/sw/bin/passwd' + if nixos-enter --root "$mountPoint" -c 'test -e /nix/var/nix/profiles/system/sw/bin/passwd'; then + set +e + nixos-enter --root "$mountPoint" -c 'echo "setting root password..." && /nix/var/nix/profiles/system/sw/bin/passwd' + exit_code=$? + set -e + + if [[ $exit_code != 0 ]]; then + echo "Setting a root password failed with the above printed error." + echo "You can set the root password manually by executing \`nixos-enter --root ${mountPoint@Q}\` and then running \`passwd\` in the shell of the new system." + exit $exit_code + fi + fi fi echo "installation finished!" diff --git a/nixpkgs/nixos/modules/installer/virtualbox-demo.nix b/nixpkgs/nixos/modules/installer/virtualbox-demo.nix index 2e1b4b3998b5..af3e1aecca71 100644 --- a/nixpkgs/nixos/modules/installer/virtualbox-demo.nix +++ b/nixpkgs/nixos/modules/installer/virtualbox-demo.nix @@ -57,7 +57,5 @@ with lib; # Enable the OpenSSH daemon. # services.openssh.enable = true; - - system.stateVersion = mkDefault "18.03"; ''; } |