New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos-installer: retry setting password on mismatch #34058
Conversation
Just passing this through shellcheck: Line 12:
echo "Wrong password - Attempt $(expr $ATTEMPT + 1) of $MAX_PASSWD_ATTEMPTS."
^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
^-- SC2086: Double quote to prevent globbing and word splitting. Looks good otherwise. I'll try it soon. |
Works perfectly! |
ping |
Any updates on this pull request, please? |
It was pratically ready before the conflict. It should be rebased. |
@lschuermann are you interested in rebasing this work please? |
I'm interested in rebasing this, but I'm pretty busy currently. It should be really easy however. I'd give myself a deadline of mid-september, if this is okay @rnhmjoj? I'm really sorry that this PR is open that long already. |
@lschuermann No problem. I had some spare time so I rebased the change myself and tested it again. |
Wow, that was fast! If you don't mind, I'd like to give this a quick test myself too. To keep the PR nice and tidy, I'd pull your changes onto my branch, this should avoid opening another PR fixing the same issue. Should be done in the next few hours. |
Sure, it's better to double check.
Perfect |
Works like a charm, thank you! I've integrated your changes. Instead of moving my branch-reference to your commit, I've merged the current master and used yours as a resolution. Now you're the merge author. Checked the diff with the current master, looks fine to me, nothing overwritten. If you diff the file, it should be exactly the same, but IMHO this better reflects attribution and history. Also, the maintainers know who to I'd cc maintainers @edolstra and @Ma27 as they've both significantly contributed to the relevant parts of the script. |
No problem at all, thank you. |
Now that #66588 is through, I should probably change this to use the newly introduced |
@GrahamcOfBorg test installer |
ping |
pong. Let's get this PR closed today :) |
@GrahamcOfBorg test installer |
Technically my promise wasn't kept, but better late than never, right? @mmahut Tested it in a VM, ofborg says it's good, so there's a go from me. |
Sure thing.
I also tested it, on a physical disk and everything looks just about right. |
👎, this adds a lot of code and it's not really necessary since you can just run |
I agree with @edolstra. This doesn't seem necessary to me. |
Too bad, we have spent quite some time on this. Could we al least pick up the fixes for shellcheck? |
@edolstra We might just have a different definition of what a lot of code (8 lines) means. It's not absolutely necessary alright, but I talked to at least 5 people having this minor issue. As installing is one of the first things a user might do, and from a new user perspective Closing this for now, feel free to reopen when you've changed your mind. Please confirm if @rnhmjoj or I should open a separate PR for the shellcheck fixes. I'm gonne be on vacation for the next two weeks and won't respond. |
As someone who gives a new laptop to a person and ask them to install NixOS frequently, I see this way too often (typo in password retype using a new laptop that a person is not used to). Too bad, changing few lines to improve user experience is always worth it in my opinion. |
Motivation for this change
The
nixos-install
script should retry setting the password if it failed. This way, one can make a mistake when typing and retry instead of running the installer again or setting the password manually.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)