iH8c0ff33 has quit [Remote host closed the connection]
laduke-132 has quit [Ping timeout: 256 seconds]
__monty__ has joined #nix-darwin
philr has quit [Ping timeout: 264 seconds]
laduke-132 has joined #nix-darwin
laduke-132 has quit [Ping timeout: 264 seconds]
kalbasit has joined #nix-darwin
kalbasit has quit [Ping timeout: 268 seconds]
kalbasit has joined #nix-darwin
kalbasit has quit [Remote host closed the connection]
xanderle has joined #nix-darwin
<xanderle>
trying to setup nix-darwin on a fresh install. when I run darwin-rebuild switch I get a file 'darwin' was not found... and I'm trying to work out why...
<xanderle>
looking at my /etc/zshenv file I can see if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; and if I manually execute the line within the if statement I can see everything is properly in my path... is __NIX_DARWIN_SET_ENVIRONMENT_DONE meant to be evaluating to true?
<cransom>
it's expecting a darwin channel, `nix-channel --list` should include one.
<xanderle>
running nix-channel --list shows darwin
<xanderle>
so that if statement is checking for empty string?
<__monty__>
If you're not on a single-user install that should be one of root's channels I think? So `sudo nix-channel --list`.
<xanderle>
this is kinda my first dive into nix... `sudo nix-channel --list` returns the same as `nix-channel --list` I used the `--daemon` flag when I installed nix
<xanderle>
ive had a dig around, i can't find anywhere I'm potentially overwriting the NIX_PATH variable... i don't even have a user zshrc file. adding the path to my ZSHRC file is an option, but i was kinda hoping to work out what was causing the break
<abathur>
did you start a new shell or re-start the existing shell after installing Nix with --daemon?
<xanderle>
yep! i have
<xanderle>
started a new shell, also rebooted as a last resort
<abathur>
what happens if you `echo $__NIX_DARWIN_SET_ENVIRONMENT_DONE`?
<xanderle>
I get a 1 back
<xanderle>
i was looking at the ` if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ];` line which even if 1 gets passed to... it'll evaluate as false since "1" isn't an empty string... right?
<abathur>
that's just a guard to keep it from running more than once
<xanderle>
oh so its actually supposed to be added in else where
<abathur>
so if it is set, it's already been sourced by your shell somewhere
<abathur>
the script that it sources inside will set it
<xanderle>
if i manually run the inside lines everything works... so i am indeed somehow overwriting it
<abathur>
I think so
<xanderle>
this is a fresh install of nix + darwin on m1 mbpro... i don't even have a zshrc
xanderle has quit [Remote host closed the connection]
xanderle has joined #nix-darwin
<abathur>
I'm not sure how this goes in zsh, but it sounds like your profile/rc scripts are minimal so it may be feasible to just trace it on startup and look through to see if NIX_PATH is getting set again. at least in bash I can `set -x` early on in shell setup so that it traces during init
<xanderle>
so edit the zshenv file, put a set -x after the source and #pray
<xanderle>
interesting, so i added set -x into a `/etc/zprofile.local`
<xanderle>
i can only see 1 NIX_PATH and that's from nix-daemon.sh
<xanderle>
so if I'm not seeing it... is nix-daemon.sh overwriting nix-darwin?!
<LnL>
yeah if __NIX_DARWIN is set then everything is loaded properly, so something else is overriding stuff declared there
<LnL>
and indeed nix-daemon.sh is from the installer so if that's still present it will override stuff if applied later
<abathur>
LnL hmm; surely someone's running nix-daemon+nix-darwin though; have there been other complaints about this after a stock install?
<LnL>
where does that happen tho? the things that load that should get replaced
<abathur>
oh, hmm
<abathur>
how do you mean replaced? I do remember there has been some fiddling in the installer to get zsh "right" on macOS
<abathur>
and iirc it moved files? I'm not sure if that change is actually released yet though
<abathur>
but if nix-darwin is checking a specific file, it's at least possible that it moving would explain
<LnL>
well either way all of those are declarative in this case
<LnL>
unless the change requires a whitelist in the installer
<LnL>
xanderle: did you see warnings when switching?
<xanderle>
switching from what to what?
<LnL>
when switching the system
<abathur>
darwin-rebuild switch I think he means
<xanderle>
`error: file 'darwin' was not found in the Nix search path (add it using $NIX_PATH or -I)` is what i got
<LnL>
yeah or re running the installer
<xanderle>
re running the installer gives no errors
<abathur>
LnL in nix#3608 the installer changed from /etc/zshrc to /etc/zshenv
<abathur>
and then in nix#3996 I updated that to create zshenv if it didn't exist because it wasn't actually working if you didn't already have it created
<LnL>
yeah, so either that results in a warning message that zshenv has unknown content and won't be replaced or it's not a problem but then everything should just work