Skip to content

Instantly share code, notes, and snippets.

@r00tvvm
Forked from ykomatsu/nix-macos.md
Created March 23, 2024 22:59
Show Gist options
  • Select an option

  • Save r00tvvm/7cf19645a80fa8f6e6328b91571426f9 to your computer and use it in GitHub Desktop.

Select an option

Save r00tvvm/7cf19645a80fa8f6e6328b91571426f9 to your computer and use it in GitHub Desktop.

Revisions

  1. @ykomatsu ykomatsu created this gist Oct 22, 2017.
    46 changes: 46 additions & 0 deletions nix-macos.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    # Installing Nix on macOS in single-user mode

    * [Nix manual](https://nixos.org/nix/manual/)
    * [Using Nix's "Single-user Mode" on macOS](http://zzamboni.org/post/using-nixs-single-user-mode-on-macos/)

    ```
    $ curl https://nixos.org/nix/install | sh
    ```

    ```
    $ sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist
    $ sudo launchctl stop org.nixos.nix-daemon
    ```

    Add the following line to `~/.profile`:

    ```
    NIX_REMOTE=""
    ```

    Comment out the following line in `/etc/nix/nix.conf`:

    ```
    build-users-group = nixbld
    ```

    ```
    $ sudo dscl . -delete /Users/nixbld1
    $ sudo dscl . -delete /Users/nixbld2
    $ sudo dscl . -delete /Users/nixbld3
    $ sudo dscl . -delete /Users/nixbld4
    $ sudo dscl . -delete /Groups/nixbld
    ```

    ```
    $ sudo -i nix-channel --remove nixpkgs
    ```

    ```
    $ sudo chown -R ykomatsu:staff /nix
    ```

    ```
    $ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
    $ nix-channel --update
    ```