-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
install-multi-user.sh
asks user to "edit this script" when it's invoked by the curl | sh
script
#4915
Comments
@zhaofengli I agree this isn't helpful. I'm not sure if the two of you are actually hoping to follow the process the error suggests, but just in case here's what I remember doing for an unrelated reason a while back:
Feel free to ignore the section below; I'm just connecting dots/cross-referencing.
|
As an interim workaround, would it be reasonable to let users override NIX_BUILD_GROUP_ID without editing the script? I believe it would be a very small change that should not complicate future improvements: diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh
index 7d1cb8c5a..a1e44dc4f 100644
--- a/scripts/install-multi-user.sh
+++ b/scripts/install-multi-user.sh
@@ -23,7 +23,7 @@ readonly RED='\033[31m'
# installer allows overriding build user count to speed up installation
# as creating each user takes non-trivial amount of time on macos
readonly NIX_USER_COUNT=${NIX_USER_COUNT:-32}
-readonly NIX_BUILD_GROUP_ID="30000"
+readonly NIX_BUILD_GROUP_ID=${NIX_BUILD_GROUP_ID:-30000}
readonly NIX_BUILD_GROUP_NAME="nixbld"
# darwin installer needs to override these
NIX_FIRST_BUILD_UID="30001"
@@ -438,12 +438,11 @@ create_build_group() {
if [ "$primary_group_id" -ne "$NIX_BUILD_GROUP_ID" ]; then
failure <<EOF
It seems the build group $NIX_BUILD_GROUP_NAME already exists, but
-with the UID $primary_group_id. This script can't really handle
+with the GID $primary_group_id. This script can't really handle
that right now, so I'm going to give up.
-You can fix this by editing this script and changing the
-NIX_BUILD_GROUP_ID variable near the top to from $NIX_BUILD_GROUP_ID
-to $primary_group_id and re-run.
+You can fix this by setting NIX_BUILD_GROUP_ID=$primary_group_id in
+your shell environment and re-running the installer.
EOF
else
row " Exists" "Yes" |
I think it is roughly this simple, though it overlaps with a (stalled?) effort at making both UIDs and GIDs resilient without user input in #4346. Not that perfect should be the enemy of incremental improvement. Perhaps @matthewbauer has thoughts on whether it's better to open a PR along the lines of your diff above, or if the effort in #4346 can be jumpstarted. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/can-i-install-nix-as-root/19577/6 |
still an issue. unless I'm missing something, I'd honestly recommend the script just doing this itself on failure as the stopgap? Especially when the script telling you what to edit isn't the actual script that needs editing. |
feels retarded to be asked to do something that i do not even have script file for if used nix-install.sh only |
It looks like these were made configurable via environment in installer: allow overriding nix user GID and UIDs by bjornfor · Pull Request #4345 · NixOS/nix · GitHub, but the message didn't get changed. |
Fix the error message given when nix build group already exists. The existing message gives a misleading solution when the script is typically not downloaded and executed directly. The solution given in the new message is permitted now by https://github.com/NixOS/nix/pull/4345/files Fixes: NixOS#4915
Describe the bug
Currently,
install-multi-user.sh
asks the user to "edit this script" when it's invoked by thecurl | sh
script, which can be confusing.Steps To Reproduce
Was helping a friend resolve some Nix issue on Arch Linux. He had a previous multi-user Nix installation with archlinux-nix and wanted to reinstall with the official script. The script outputs the following:
Expected behavior
The script should not ask the user to edit it when it's invoked by
install-nix-from-closure.sh
or through the thecurl | sh
command (manual). The user is unlikely to find the correct file to edit.The text was updated successfully, but these errors were encountered: