Skip to content
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

readme: prevent newcomer pitfall when disabling nix-command #1229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ The only prerequisite is a Nix implementation, both Nix and Lix are supported.
As the official Nix installer does not include an automated uninstaller, and manual uninstallation on macOS is a complex process, we recommend using one of the following installers instead:

- The [Nix installer from Determinate Systems](https://github.com/DeterminateSystems/nix-installer?tab=readme-ov-file#determinate-nix-installer) is only recommended for use with flake-based setups. **Make sure you use it without the `--determinate` flag**. The `--determinate` flag installs the Determinate Nix distribution which does not work out of the box with nix-darwin.
* The [Lix installer](https://lix.systems/install/#on-any-other-linuxmacos-system) supports both flake-based and channel-based setups.


* The [Lix installer](https://lix.systems/install/#on-any-other-linuxmacos-system) supports both flake-based and channel-based setups.

## Getting started

Expand Down Expand Up @@ -81,9 +80,13 @@ Make sure to set `nixpkgs.hostPlatform` in your `configuration.nix` to either `x
Unlike NixOS, `nix-darwin` does not have an installer, you can just run `darwin-rebuild switch` to install nix-darwin. As `darwin-rebuild` won't be installed in your `PATH` yet, you can use the following command:

```bash
nix run nix-darwin -- switch --flake ~/.config/nix-darwin
nix run --extra-experimental-features 'nix-command flakes' nix-darwin -- switch --flake ~/.config/nix-darwin
```

Remember to back up and remove your `/etc/nix/nix.conf` beforehand. If you forget, you will be reminded.

Since removing `/etc/nix/nix.conf` would disable experimental features, you must have `--extra-experimental-features 'nix-command flakes'` passed as arguments to `nix run`.

### Step 3. Using `nix-darwin`

After installing, you can run `darwin-rebuild` to apply changes to your system:
Expand All @@ -110,6 +113,7 @@ nix-darwin.lib.darwinSystem {
{ pkgs, lib, inputs }:
# inputs.self, inputs.nix-darwin, and inputs.nixpkgs can be accessed here
```

</details>

<details>
Expand Down Expand Up @@ -150,6 +154,7 @@ You can update `nix-darwin` using the following command:
```bash
nix-channel --update darwin
```

</details>

## Documentation
Expand Down Expand Up @@ -212,5 +217,6 @@ The `or` operator takes care of graceful degradation when `lib` from Nixpkgs
goes out of sync.

Also feel free to contact me if you have questions,

- Matrix - @daiderd:matrix.org, you can find me in [#macos:nixos.org](https://matrix.to/#/#macos:nixos.org)
- @LnL7 on twitter