-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Don't stop user from installing the nix store on an unencrypted volume #3692
Don't stop user from installing the nix store on an unencrypted volume #3692
Conversation
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.
The installer already handles this for cases where filevault is not enabled, the combination of filevault and an unencrypted store is nonsensical and shouldn't be automated by the installer.
If you're really ok with this for your usecase, create the volume yourself outside of the installer with diskutility and continue from there.
sudo diskutil apfs addVolume diskX APFS 'Nix Store' -mountpoint /nix
sh <(curl https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
Thanks for the fast response :) Any reasons why the installer cannot run that
But why does it fail in certain cases then (like the issue I linked above, or the 2017 MBP I tested it with)? |
I don't understand the question, as stated above and in the manual if filevault is enabled for the boot volume and no hardware encryption is available some kind of encryption also needs to be setup for the store volume. Just doing it anyway and relying on the user noticing that their installation is in a bad state, while convenient, isn't a good default. Anybody that has enabled filevault on their machine should also care about this.
|
Got your point now :-) I guess then we should point the user into the right direction (e.g. explain which steps need to be done). Right now the linked documentation doesn't really explain what to do next. Thus the user is stuck. Alternative: Can't we ask the user for a password during installation and then set it up automatically? Like
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/installation-on-macos-catalina/7804/4 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/installing-nix-on-macos-catalina-with-encrypted-boot-volume/7833/2 |
I think we have to do better, most of macos users expect things to just work and that's one of the main reasons they have a mac opposed to a linux machine. The reason we have to care is because that's the experience you get just when you install Nix, before doing anything useful. Currently it's not clear why they are getting the error and what they should really do. I think changing nix store location or symlinks shouldn't even be mentioned as both have significant downsides. It's not clear to me why we can't offer more automation with encrypting the volume and how would the user decrypt it then? |
I can see the security perspective, but to me adding |
I'm not sure this PR is the right place for the whole discussion spool out, but I'm not sure where it should move and we're here now so I'll do a bit of a braindump with the intent of porting it elsewhere (with corrections if anyone sees something I've got wrong or missed) as needed :) How we got where we are@LnL7 put forward the PR to fix the installer that endured months of hammering and multiple stalls before reaching completion. On the technical side, I recall it breaking down around a few points:
The PR had stalled out around documentation issues. At the time, the installer was punting to documentation. LnL had asked for help documenting the various options multiple times, but hadn't gotten any. Over time, threads on this issue were devolving into a Lord-of-the-Flies situation. After one of these dust-ups I jumped in (despite feeling out of my depth dealing with the installer) to help document the options and try to advocate for solving any cases we could automatically solve. We:
Outside of the scope of closing out the PR, there was a parallel effort to add a walk-through of the recommended encryption workflow that fell through. I think the current state sucks, but it's a lot better than having no working installer, sending everyone out on their own to invent their own bespoke solutions, and having various threads and blog posts devolving towards abuse. Where it seems like it should go from hereSomeone else independently figured out an encryption workflow that, as far as we know, works. If it does indeed skirt the decrypt race condition, the key appears to be putting the credential in the system keychain. You can find this discussed on IRC, and implemented (in ruby) in this gist. Edit: I'll start adding additional substantive discussions as I become aware of them: There's still at least one question here: is it acceptable to just generate a password and use it to encrypt the store for everyone with FileVault enabled on their boot volume. If the answer is yes, it needs someone to dive in on the implementation and confirm it delivers. (It may be gratifying to be the hero here, but I'm juggling multiple projects that are all falling behind lately and I'm in "no" mode for a while.) |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
The work in #4289 will make this moot if/when it lands. It'll encrypt the volume if FV is enabled, and remove the flag/message at issue, here. |
@abathur thanks a lot for working on this :) Will close this issue as this looks to be resolved very soon. |
Right now the nix installer will abort on macOS when the installation will result in an unencrypted store volume being created. This problem affects lots of common mac hardware like 13-inch 2017 Macbook Pro. It leads to the following unhelpful error message being printed:
After that the installer exits with an error code.
This will block certain people from adopting nix (e.g. digitallyinduced/ihp#93).
Users should be able to make the tradeoff themselves. By passing
--darwin-use-unencrypted-nix-store-volume
they already give consent that they are ok with using an unencrypted store volume. Therefore we should not exit the installer and instead just warn the user.