Determinate Nix Installer

The opinionated part is that the Determinate Nix Installer installs Nix with Nix flakes and the unified CLI enabled in nix.conf. Although flakes and the unified CLI remain experimental features of Nix, we’re confident that new users should adopt them now and that more seasoned Nix users should start making the transition. discourse page github

Nix flakes page

The unified CLI page

The Determinate Nix Installer also stores an installation receipt (for uninstalling) at /nix/receipt.json and a copy of the install binary at /nix/nix-installer.

You can give it a try by running the following in a terminal:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

info: downloading installer https://install.determinate.systems/nix/tag/v0.13.1/nix-installer-x86_64-darwin `nix-installer` needs to run as `root`, attempting to escalate now via `sudo`... Password: Nix install plan (v0.13.1) Planner: macos (with default settings) Planned actions: * Create an encrypted APFS volume `Nix Store` for Nix on `disk1` and add it to `/etc/fstab` mounting on `/nix` * Fetch `https://releases.nixos.org/nix/nix-2.18.1/nix-2.18.1-x86_64-darwin.tar.xz` to `/nix/temp-install-dir` * Create a directory tree in `/nix` * Move the downloaded Nix into `/nix` * Create build users (UID 300-332) and group (GID 30000) * Configure Time Machine exclusions * Setup the default Nix profile * Place the Nix configuration in `/etc/nix/nix.conf` * Configure the shell profiles * Configure Nix daemon related settings with launchctl * Remove directory `/nix/temp-install-dir` Proceed? ([Y]es/[n]o/[e]xplain):

INFO Step: Create an encrypted APFS volume `Nix Store` for Nix on `disk1` and add it to `/etc/fstab` mounting on `/nix` INFO Step: Provision Nix INFO Step: Create build users (UID 300-332) and group (GID 30000) INFO Step: Configure Time Machine exclusions INFO Step: Configure Nix INFO Step: Configure Nix daemon related settings with launchctl INFO Step: Remove directory `/nix/temp-install-dir` Nix was installed successfully! To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh`

~

Error: 0: Planner error 1: Error executing action 2: Action `encrypt_apfs_volume` errored 3: The keychain has an existing password for a non-existing "Nix Store" volume on disk `disk1`, consider removing the password with `sudo security delete-generic-password -a "Nix Store" -s "Nix Store" -l "disk1 encryption password" -D "Encrypted volume password"`. Note that it's possible to have several passwords stored, so you may need to run this command several times until receiving the message `The specified item could not be found in the keychain.

sudo security delete-generic-password -a "Nix Store" -s "Nix Store" -l "disk1 encryption password" -D "Encrypted volume password"

To get started using Nix, open a new shell or run

. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh

nix --version nix (Nix) 2.18.1

/nix/nix-installer uninstall `nix-installer` needs to run as `root`, attempting to escalate now via `sudo`... Password: `nix-darwin` installation detected, it must be removed before uninstalling Nix. Please refer to https://github.com/LnL7/nix-darwin#uninstalling for instructions how to uninstall `nix-darwin`.

Nix modules for darwin, /etc/nixos/configuration.nix for macOS. page

nix-darwin#uninstalling page

nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A uninstaller

./result/bin/darwin-uninstaller

Can't uninstall on darwin, fail to remove nix-darwin github

Nix modules for darwin (re-)installed on mbp-bs.

nix --version nix (Nix) 2.17.0

~

You will want to use the nix-community binary cache. github cachix

error: unable to download 'https://cache.nixos.org/37xgmkxdp1qmzfq0xj3s4bchsdg616hg.narinfo': Problem with the SSL CA cert (path? access rights?) (77)

Multi-user installation on OSX - SSL cert problem for user, not for root github page

SSL CA cert error on MacOS discourse

sudo launchctl setenv NIX_SSL_CERT_FILE $NIX_SSL_CERT_FILE

Could not set environment: 150: Operation not permitted while System Integrity Protection is engaged

How to Disable System Integrity Protection on a Mac (and Why You Shouldn't) page

csrutil

- [x] csrutil enable

nix-shell -p nix-info --run "nix-info -m" /nix/var/nix/profiles/per-user warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring - system: `"x86_64-darwin"` - host os: `Darwin 23.0.0, macOS 10.16` - multi-user?: `yes` - sandbox: `no` - version: `nix-env (Nix) 2.17.0` - nixpkgs: `/Users/rgb_admin/.nix-defexpr/channels/nixpkgs`

So we got a working nix-darwin on mbp-bs. We uninstalled Nix and reinstalled it with Determinate Nix Installer.

Since uninstalling with Determinate Nix did not work – it detected an installation of nix-darwin even after uninstalling it – we reinstalled nix-darwin. So unfortunately we could not test the uninstall function of Determinate Nix Installer, but we have a working nix-darwin.

Note: Configured https://nix-community.cachix.org binary cache in /etc/nix/nix.conf @mbp-bs

@mbp-rgb multi-user installation page without using the Determinate Nix Installer

nix-shell -p nix-info --run "nix-info -m" - system: `"x86_64-darwin"` - host os: `Darwin 23.0.0, macOS 10.16` - multi-user?: `yes` - sandbox: `no` - version: `nix-env (Nix) 2.8.1` - channels(rgb_admin): `"darwin, home-manager"` - channels(rgb): `""` - channels(root): `"nixpkgs-22.05pre379834.41cc1d5d958, darwin, home-manager"` - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

nix --version nix (Nix) 2.8.1