diff options
author | EuAndreh <eu@euandre.org> | 2019-06-01 17:35:48 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-06-01 17:35:48 -0300 |
commit | 1e6dcd188d474a080948b51e69c5f23413a5bac5 (patch) | |
tree | 99eca899b30077c5981ae584dc0562ebd2277877 /public | |
parent | TODOs.org (diff) | |
download | dotfiles-1e6dcd188d474a080948b51e69c5f23413a5bac5.tar.gz dotfiles-1e6dcd188d474a080948b51e69c5f23413a5bac5.tar.xz |
Generate /etc/nixos/password-hash.txt during execution
Diffstat (limited to 'public')
-rwxr-xr-x | public/install-nixos.sh | 15 | ||||
-rw-r--r-- | public/template.nix | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/public/install-nixos.sh b/public/install-nixos.sh index 3f0fa81..5e160da 100755 --- a/public/install-nixos.sh +++ b/public/install-nixos.sh @@ -79,7 +79,7 @@ fi green "Done." yellow "Moving presented content to '/etc/nixos/local-configuration.nix'..." -echo mv "${TMP_DIR}/local-configuration.nix" /etc/nixos/local-configuration.nix +mv "${TMP_DIR}/local-configuration.nix" /etc/nixos/local-configuration.nix green "Done." yellow "Wiping '${DEVICE}'and partitioning it..." @@ -121,7 +121,18 @@ mv /etc/nixos/configuration.nix /etc/nixos/bkp-configuration.nix mv "${TMP_DIR}/configuration.nix" /etc/nixos/configuration.nix green "Done." -blue "Now inspect '/etc/nixos/configuration.nix', " +yellow "Generating password-hash.txt file for user login..." +while true; do + read -s -p "Password: " password + echo + read -s -p "Password (again): " password_confirmation + echo + [ "$password" = "$password_confirmation" ] && break + red "Please try again" +done +mkpasswd -m sha-512 "$password" > /etc/nixos/password-hash.txt +green "Done." + yellow "Installing NixOS!" nixos-install green "Done." diff --git a/public/template.nix b/public/template.nix index 5cfc9f8..53bb695 100644 --- a/public/template.nix +++ b/public/template.nix @@ -2,5 +2,5 @@ hostName = "$HOST_NAME"; luksDevice = "$DEVICE"; passwordFile = - "/home/andreh/dev/libre/dotfiles/encrypted/$HOST_NAME/password-hash.txt"; + "/etc/nixos/password-hash.txt"; } |