You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nix modules for darwin, `/etc/nixos/configuration.nix` for macOS.
14
+
## About
8
15
9
16
This project aims to bring the convenience of a declarative system approach to macOS.
10
17
nix-darwin is built up around [Nixpkgs](https://github.com/NixOS/nixpkgs), quite similar to [NixOS](https://nixos.org/).
@@ -15,18 +22,15 @@ The only prerequisite is a Nix implementation; both Nix and Lix are supported.
15
22
16
23
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:
17
24
18
-
* 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.
25
+
- 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.
19
26
It can install one of two distributions of Nix:
27
+
- To install the **recommended** vanilla upstream [Nix](https://nixos.org), you will need to explicitly say `no` when prompted to install `Determinate Nix`.
20
28
21
-
* To install the **recommended** vanilla upstream [Nix](https://nixos.org), you will need to explicitly say `no` when prompted to install `Determinate Nix`.
22
-
23
-
* When run with the `--determinate` flag, it will install the [Determinate](https://docs.determinate.systems/) distribution.
29
+
- When run with the `--determinate` flag, it will install the [Determinate](https://docs.determinate.systems/) distribution.
24
30
As Determinate manages the Nix installation itself, you will need to set `nix.enable = false;` in your configuration to disable nix-darwin’s own Nix management.
25
31
Some nix-darwin functionality that relies on managing the Nix installation, like the `nix.*` options to adjust Nix settings or configure a Linux builder, will be unavailable.
26
32
27
-
* The [Lix installer](https://lix.systems/install/#on-any-other-linuxmacos-system) supports both flake-based and channel-based setups.
28
-
29
-
33
+
- The [Lix installer](https://lix.systems/install/#on-any-other-linuxmacos-system) supports both flake-based and channel-based setups.
30
34
31
35
## Getting started
32
36
@@ -73,8 +77,8 @@ Add the following to `flake.nix` in the same folder as `configuration.nix`:
73
77
inputs = {
74
78
# Use `github:NixOS/nixpkgs/nixpkgs-25.05-darwin` to use Nixpkgs 25.05.
@@ -98,9 +102,9 @@ Unlike NixOS, `nix-darwin` does not have an installer, you can just run `darwin-
98
102
99
103
```bash
100
104
# To use Nixpkgs unstable:
101
-
sudo nix run nix-darwin/master#darwin-rebuild -- switch
105
+
sudo nix run github:xinux-org/nix-darwin/master#darwin-rebuild -- switch
102
106
# To use Nixpkgs 25.05:
103
-
sudo nix run nix-darwin/nix-darwin-25.05#darwin-rebuild -- switch
107
+
sudo nix run github:xinux-org/nix-darwin/nix-darwin-25.05#darwin-rebuild -- switch
104
108
```
105
109
106
110
### Step 3. Using `nix-darwin`
@@ -129,6 +133,7 @@ nix-darwin.lib.darwinSystem {
129
133
{ pkgs, lib, inputs }:
130
134
# inputs.self, inputs.nix-darwin, and inputs.nixpkgs can be accessed here
131
135
```
136
+
132
137
</details>
133
138
134
139
<details>
@@ -142,9 +147,9 @@ Copy the [simple](./modules/examples/simple.nix) example to `/etc/nix-darwin/con
142
147
143
148
```bash
144
149
# If you use Nixpkgs unstable (the default):
145
-
sudo nix-channel --add https://github.com/nix-darwin/nix-darwin/archive/master.tar.gz darwin
150
+
sudo nix-channel --add https://github.com/xinux-org/nix-darwin/archive/master.tar.gz darwin
146
151
# If you use Nixpkgs 25.05:
147
-
sudo nix-channel --add https://github.com/nix-darwin/nix-darwin/archive/nix-darwin-25.05.tar.gz darwin
152
+
sudo nix-channel --add https://github.com/xinux-org/nix-darwin/archive/nix-darwin-25.05.tar.gz darwin
148
153
149
154
sudo nix-channel --update
150
155
```
@@ -173,11 +178,12 @@ You can update Nixpkgs and `nix-darwin` using the following command:
173
178
```bash
174
179
sudo nix-channel --update
175
180
```
181
+
176
182
</details>
177
183
178
184
## Documentation
179
185
180
-
`darwin-help` will open up a local copy of the reference documentation, it can also be found online [here](https://nix-darwin.github.io/nix-darwin/manual/index.html).
186
+
`darwin-help` will open up a local copy of the reference documentation, it can also be found online [here](https://nix-darwin.uz/manual/stable/).
181
187
182
188
The documentation is also available as manpages by running `man 5 configuration.nix`.
183
189
@@ -235,5 +241,11 @@ The `or` operator takes care of graceful degradation when `lib` from Nixpkgs
235
241
goes out of sync.
236
242
237
243
Feel free to contact us on Matrix if you have questions:
0 commit comments