!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1163 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org188 Servers

Load older messages


SenderMessageTime
1 Oct 2025
@reckenrode:matrix.orgRandy EckenrodeAFAIK there are some Linux users.11:01:50
@skyraider256525:matrix.orgskyraider joined the room.13:59:19
@skyraider256525:matrix.orgskyraider

Hi everyone, I have recently started setting up nix-darwin and have a question regarding installation.

The installation documentation is telling me to put the flake configuration in /etc/nix-darwin, I was wondering if I can put it in ~/.config/nix.

It just feels right to me to keep my configs in my home directory, do you guys have any idea or advice I can follow?

TIA!

14:10:58
@niklaskorz:matrix.orgniklaskorz yes you can, darwin-rebuild --flake ~/.config/nix 14:29:15
@niklaskorz:matrix.orgniklaskorz or if you use nh, you can set NH_FLAKE or NH_DARWIN_FLAKE env vars to point to it 14:30:35
@skyraider256525:matrix.orgskyraider

I did not run darwin-rebuild as it is not installed.

Instead of that I am
nix run nix-darwin/nix-darwin-25.05#darwin-rebuild -- switch --flake .#macbook-air
which is giving me the output
/nix/store/0mbhwi1461n52jv98zqd40id44j2v6h4-darwin-rebuild/bin/darwin-rebuild: system activation must now be run as root

15:24:00
@skyraider256525:matrix.orgskyraiderI can run it as root, what I want to know is will this be a one time or will I need to do sudo for other commands as well?15:24:54
@samasaur:matrix.orgsamasaur you will need to use sudo for all darwin-rebuild switch calls 15:25:38
@skyraider256525:matrix.orgskyraiderWill try this after I done setting up nix-darwin15:25:42
@samasaur:matrix.orgsamasaur after the first install of your configuration, darwin-rebuild should be installed, though, so you shouldn't need to run it from the flake 15:26:13
@skyraider256525:matrix.orgskyraiderdo you mean the command I am using is wrong? Should I remove the flake flag?15:27:19
@samasaur:matrix.orgsamasaurthe command you are using is right15:28:12
@samasaur:matrix.orgsamasaurwell15:28:29
@samasaur:matrix.orgsamasaurat least the flake flag is right15:28:35
@samasaur:matrix.orgsamasauryou are correct that you need to run it as root15:28:54
@skyraider256525:matrix.orgskyraider doing sudo darwin-rebuild switch gives me this error
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring error: file 'darwin' was not found in the Nix search path (add it using $NIX_PATH or -I)
but when I add the --flake .config/nix flag it works
15:46:01
@skyraider256525:matrix.orgskyraiderWould I need to do this for all rebuilds?15:46:17
@samasaur:matrix.orgsamasauryep16:03:28
@samasaur:matrix.orgsamasaur well technically I think you wouldn't need the flake flag if /etc/nix-darwin/flake.nix exists 16:04:23
@samasaur:matrix.orgsamasaurbecause in that case it defaults to flake mode16:04:31
@samasaur:matrix.orgsamasaurbut if you don't have your config there, then you need the flag every time16:04:43
@samasaur:matrix.orgsamasaurmy secret is that I just do ctrl-R rebuil and then hit enter16:05:01
@samasaur:matrix.orgsamasaurhaving a good history program is really handy16:05:08
@skyraider256525:matrix.orgskyraideragreed16:09:47
@skyraider256525:matrix.orgskyraiderOne other question how do you guys get gui apps in the spotlight?16:10:45
@samasaur:matrix.orgsamasaurshould work by default for apps installed via nix-darwin16:15:58
@samasaur:matrix.orgsamasauroh actually you're using 25.05 not unstable16:16:08
@samasaur:matrix.orgsamasaurit works on unstable16:16:13
@ecco256:matrix.orgErik joined the room.17:15:07
@ecco256:matrix.orgErik Hey folks, I authored https://github.com/nix-darwin/nix-darwin/pull/1530. Looks like you are right; I did a fresh install of MacOS and got this error on bootstrap… and then blindly assumed therefore the issue would persist after that as well. I used nh darwin after that which does give me the error every time, but sudo darwin-rebuild doesn't. 17:29:13

Show newer messages


Back to Room ListRoom Version: 6