Skip to content

Instantly share code, notes, and snippets.

@nasyxx
Forked from ykomatsu/nix-macos.md
Created August 3, 2018 12:10
Show Gist options
  • Select an option

  • Save nasyxx/30e8fe25394d8a90b4ffa683779fbc12 to your computer and use it in GitHub Desktop.

Select an option

Save nasyxx/30e8fe25394d8a90b4ffa683779fbc12 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
    ```