!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1161 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
10 Nov 2025
@ieda:matrix.org@ieda:matrix.org left the room.13:33:38
11 Nov 2025
@mlenz:matrix.orgMirko Lenz changed their display name from mlenz to Mirko Lenz.08:07:19
@purrtner:matrix.orgpurrtnerInteresting. On my machine nixpkgs-review is broken, which is surprising.08:18:22
@delafthi:matrix.orgdelafthiI‘m usually running nixpks-review with https://github.com/Defelo/nixpkgs-review-gha. But let me test it on my local machine.11:48:38
@saige:szp.lolleah changed their display name from saige leah to leah.12:23:35
@delafthi:matrix.orgdelafthino, nixpks-review works fine for me16:38:59
@benjaminsparks:chat.alugha.appBen Sparks
In reply to @purrtner:matrix.org
Interesting. On my machine nixpkgs-review is broken, which is surprising.
Are you getting an error related to a schema?
16:40:35
@niklaskorz:matrix.orgniklaskorzI was gonna say "what version are you running"16:41:01
@niklaskorz:matrix.orgniklaskorz
In reply to @benjaminsparks:chat.alugha.app
Are you getting an error related to a schema?
That's been fixed though (the biome thingy)
16:41:12
@oak:universumi.fioak 🏳️‍🌈♥️ changed their profile picture.19:20:44
12 Nov 2025
@jonhermansen:matrix.orgjonhermansen Is it normal that darwin-rebuild wants to clobber /etc/bashrc and /etc/zshrc ?

user@desktop mac-flake % sudo nix --extra-experimental-features "nix-command flakes" run nix-darwin/master#darwin-rebuild -- switch --flake .#desktop
warning: $HOME ('/Users/user') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
building the system configuration...
error: Unexpected files in /etc, aborting activation
The following files have unrecognized content and would be overwritten:

  /etc/bashrc
  /etc/zshrc

Please check there is nothing critical in these files, rename them by adding .before-nix-darwin to the end, and then try again.
00:53:20
@jonhermansen:matrix.orgjonhermansenIt's a fairly fresh install of Tahoe, I guess I was just surprised it was necessary. Oh, maybe this is how Nix stuff gets injected into PATH?00:59:19
@samasaur:matrix.orgsamasaurit is, yes. that said what we normally do is add the hashes of the macOS-provided files to nix-darwin itself so that they are "recognized" and can be overwritten automatically01:49:46
@samasaur:matrix.orgsamasaurare you on the latest nix-darwin?01:49:56
@jonhermansen:matrix.orgjonhermansenI think I'm on the latest nix-darwin (trying to install master). I think I actually caused this problem 😇 because I messed with the Nix installer. My /nix and /nix/store are on ZFS and so I had to disable the launchd service which attaches and mounts the APFS disk. Hmm, OK, mea culpa. I didn't realize nix-darwin would try to manage the plist file too. I actually made the plist immutable, ran darwin-rebuild switch again, and got this cp: cannot remove '/Library/LaunchDaemons/org.nixos.nix-daemon.plist': Operation not permitted01:53:58
@jonhermansen:matrix.orgjonhermansenI'll have to find a way to import and mount my ZFS filesytems before the nix-daemon service fires01:54:24
@samasaur:matrix.orgsamasaur the nix-daemon service runs /bin/wait4path, so you should be okay to just replace the org.nixos.darwin-store.plist file? 01:55:53
@samasaur:matrix.orgsamasaurnot to trivialize that ofc01:56:05
@jonhermansen:matrix.orgjonhermansenDuring the Nix installation, it also modified /etc/bashrc I think. I thought I accepted the Nix installer's copy of /etc/bashrc. My install is not typical, but I was curious about the "first-time installation" step of darwin-rebuild01:56:06
@jonhermansen:matrix.orgjonhermansenThat makes sense, except I deleted it :p I can find it and put it back01:56:27
@samasaur:matrix.orgsamasaur re: your original issue, there's no special first-time installation logic. nix-darwin will refuse to overwrite any files in /etc that aren't either a) managed by nix-darwin; b) have a "known hash" 01:58:01
@jonhermansen:matrix.orgjonhermansenI wasn't sure exactly where to add my ZFS import / mount steps, and so I had put them into the nix-daemon plist but clearly that was not the right idea01:58:01
@jonhermansen:matrix.orgjonhermansenIt makes me wonder what the hell I did to those files so that they didn't have a known hash.01:58:38
@samasaur:matrix.orgsamasaurwe just include known hashes for the macOS-provided, upstream nix installer–provided, and determinate nix installer–provided zshrc, zprofile, bashrc, etc.01:58:42
@jonhermansen:matrix.orgjonhermansenThat makes good sense, and its reasonable that it asked me if I wanted to clobber them in that case!01:59:31
@samasaur:matrix.orgsamasaur most of them are listed here, and you can see how they are set 02:00:19
@samasaur:matrix.orgsamasaurnot entirely uncommon. often global installs of things (via non-nix) will modify these files so that the tools are in PATH02:01:13
@jonhermansen:matrix.orgjonhermansen It looks like I have two backups. One which was before I installed Nix, and the other was the one that didn't match a known hash.

user@desktop:~/ > cat /etc/bashrc.backup-before-nix 
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
user@desktop:~/ > cat /etc/bashrc.bak              

# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
  . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix

# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
02:03:31
@samasaur:matrix.orgsamasaur that's actually the happy path to some extent, because the main alternative (/etc/paths.d) is ignored by nix-darwin 02:03:31
@samasaur:matrix.orgsamasaurat least this way you catch it02:03:37

Show newer messages


Back to Room ListRoom Version: 6