1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

focus on golden-path covering most scenarios

This should handle installation scenarios we can handle with
anything resembling confidence. Goal is approximating the existing
setup--not enforcing a best-practice...

Approaches (+ installer-handled, - manual) and configs each covers:

+ no change needed; /nix OK on boot volume:
  All pre-Catalina (regardless of T2 or FileVault use)

+ create new unencrypted volume:
  Catalina, pre-T2, no FileVault

+ create new encrypted-at-rest volume:
  Catalina, pre-T2, FileVault
  Catalina, T2, no FileVault

- require user to pre-create encrypted volume
  Catalina, T2, FileVault
This commit is contained in:
Travis A. Everett 2020-05-14 21:59:10 -05:00 committed by Daiderd Jordan
parent 477d7c2d07
commit 2b0a81d92d
No known key found for this signature in database
GPG key ID: D02435D05B810C96
3 changed files with 331 additions and 115 deletions

View file

@ -52,7 +52,7 @@ while [ $# -gt 0 ]; do
NIX_INSTALLER_NO_CHANNEL_ADD=1;;
--no-modify-profile)
NIX_INSTALLER_NO_MODIFY_PROFILE=1;;
--create-volume)
--darwin-use-unencrypted-nix-store-volume)
CREATE_DARWIN_VOLUME=1;;
*)
(
@ -77,12 +77,13 @@ while [ $# -gt 0 ]; do
echo ""
) >&2
if [ "$(uname -s)" = "Darwin" ]; then
# darwin and Catalina+
if [ "$(uname -s)" = "Darwin" ] && [ "$macos_major" -gt 14 ]; then
(
echo " --create-volume: Create an APFS volume for the store and create the /nix"
echo " mountpoint for it using synthetic.conf."
echo " (required on macOS >=10.15)"
echo " See https://nixos.org/nix/manual/#sect-apfs-volume-installation"
echo " --darwin-use-unencrypted-nix-store-volume: Create an APFS volume for the Nix"
echo " store and mount it at /nix. This is the recommended way to create"
echo " /nix with a read-only / on macOS >=10.15."
echo " See: https://nixos.org/nix/manual/#sect-macos-installation"
echo ""
) >&2
fi
@ -98,12 +99,12 @@ if [ "$(uname -s)" = "Darwin" ]; then
fi
info=$(diskutil info -plist / | xpath "/plist/dict/key[text()='Writable']/following-sibling::true[1]" 2> /dev/null)
if ! [ -e $dest ] && [ -n "$info" ]; then
if ! [ -e $dest ] && [ -n "$info" ] && [ "$macos_major" -gt 14 ]; then
(
echo ""
echo "Installing on macOS >=10.15 requires relocating the store to an apfs volume."
echo "Use sh <(curl https://nixos.org/nix/install) --create-volume or run the preparation steps manually."
echo "See https://nixos.org/nix/manual/#sect-apfs-volume-installation"
echo "Use sh <(curl https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume or run the preparation steps manually."
echo "See https://nixos.org/nix/manual/#sect-macos-installation"
echo ""
) >&2
exit 1