-
-
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: chown bootstrap store contents #7442
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -810,6 +810,24 @@ install_from_extracted_nix() { | |
_sudo "to make the new store non-writable at $NIX_ROOT/store" \ | ||
chmod -R ugo-w "$NIX_ROOT/store/" | ||
|
||
# This is copied from create_directories, see it for why we do all this stuff just to find chown. | ||
local get_chr_own="$(PATH="$(getconf PATH 2>/dev/null)" command -vp chown)" | ||
if [[ -z "$get_chr_own" ]]; then | ||
get_chr_own="$(command -v chown)" | ||
fi | ||
|
||
if [[ -z "$get_chr_own" ]]; then | ||
reminder <<EOF | ||
I wanted to change ownership of new Nix store files, | ||
but I couldn't locate 'chown'. (You may need to fix your PATH.) | ||
To manually change file ownership, you can run: | ||
sudo chown -R 'root:$NIX_BUILD_GROUP_NAME' '$NIX_ROOT/store' | ||
EOF | ||
else | ||
_sudo "to change ownership of Nix store files" \ | ||
"$get_chr_own" -R "root:$NIX_BUILD_GROUP_NAME" "$NIX_ROOT/store" || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this use |
||
fi | ||
|
||
if [ -d "$NIX_INSTALLED_NIX" ]; then | ||
echo " Alright! We have our first nix at $NIX_INSTALLED_NIX" | ||
else | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of copying, this could be factored out into a function? Or just moved up in the script so it's done only once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #7442 (comment) for @abathur and I's previous discussion on this.