Skip to content
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

Allow installing multi-user as root on macOS and Linux #6882

Merged
merged 3 commits into from
Aug 12, 2022

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Aug 8, 2022

This may work fine on a mac, but I don't have one for testing. I haven't tested this exact change on Linux yet, but it operates on the idea that you can "just" set EUID=65535 as root and the installer works fine. Going to test this shortly.

Closes #6801, cc @cole-h.

@grahamc grahamc requested a review from edolstra August 8, 2022 20:13
sudo "$@"

if is_root; then
env "$@"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this uses env because some _sudo callsites pass environment variables to the program being executed.

scripts/install-multi-user.sh Outdated Show resolved Hide resolved
scripts/install-multi-user.sh Outdated Show resolved Hide resolved
@grahamc grahamc force-pushed the allow-multi-user-as-root branch from e4a67b9 to 7bb1e91 Compare August 10, 2022 13:37
@grahamc
Copy link
Member Author

grahamc commented Aug 10, 2022

Tested the resulting installer, I think this is good to go.

@grahamc grahamc changed the title Allow installing multi-user as root on Linux Allow installing multi-user as root on macOS and Linux Aug 10, 2022
@biscuitPIMP
Copy link

You need a MacBook Air to test it? I. An fedex you one to try I have a few lying around I been hoarding them and raid ing costxo

@edolstra
Copy link
Member

It would be great to test this on macOS as root, but I'll merge it since it shouldn't break existing usage.

@edolstra edolstra merged commit af4e8b0 into NixOS:master Aug 12, 2022
@edolstra edolstra deleted the allow-multi-user-as-root branch August 12, 2022 08:19
@cole-h
Copy link
Member

cole-h commented Aug 12, 2022

FYI: it was tested on an x86 macOS VM (not aarch64 or on real hardware, but hopefully a close enough approximation?): #6882 (comment). So, ideally, everything should be fine.

@grahamc
Copy link
Member Author

grahamc commented Aug 14, 2022

I tested this on an aarch64 mac through MDM and it worked great!

@bjornfor bjornfor mentioned this pull request Dec 13, 2022
Minion3665 pushed a commit to Minion3665/nix that referenced this pull request Feb 23, 2023
…r-as-root

Allow installing multi-user as root on macOS and Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use the multi-user installer as root
4 participants