| 1 Oct 2025 |
Randy Eckenrode | AFAIK there are some Linux users. | 11:01:50 |
| skyraider joined the room. | 13:59:19 |
skyraider | 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 | yes you can, darwin-rebuild --flake ~/.config/nix | 14:29:15 |
niklaskorz | or if you use nh, you can set NH_FLAKE or NH_DARWIN_FLAKE env vars to point to it | 14:30:35 |
skyraider | 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 |
skyraider | I 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 | you will need to use sudo for all darwin-rebuild switch calls | 15:25:38 |
skyraider | Will try this after I done setting up nix-darwin | 15:25:42 |
samasaur | 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 |
skyraider | do you mean the command I am using is wrong?
Should I remove the flake flag? | 15:27:19 |
samasaur | the command you are using is right | 15:28:12 |
samasaur | well | 15:28:29 |
samasaur | at least the flake flag is right | 15:28:35 |
samasaur | you are correct that you need to run it as root | 15:28:54 |
skyraider | 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 |
skyraider | Would I need to do this for all rebuilds? | 15:46:17 |
samasaur | yep | 16:03:28 |
samasaur | well technically I think you wouldn't need the flake flag if /etc/nix-darwin/flake.nix exists | 16:04:23 |
samasaur | because in that case it defaults to flake mode | 16:04:31 |
samasaur | but if you don't have your config there, then you need the flag every time | 16:04:43 |
samasaur | my secret is that I just do ctrl-R rebuil and then hit enter | 16:05:01 |
samasaur | having a good history program is really handy | 16:05:08 |
skyraider | agreed | 16:09:47 |
skyraider | One other question how do you guys get gui apps in the spotlight? | 16:10:45 |
samasaur | should work by default for apps installed via nix-darwin | 16:15:58 |
samasaur | oh actually you're using 25.05 not unstable | 16:16:08 |
samasaur | it works on unstable | 16:16:13 |
| Erik joined the room. | 17:15:07 |
Erik | 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 |