iH8c0ff33 has quit [Ping timeout: 256 seconds]
supersandro2000 has quit [Disconnected by services]
supersandro2000 has joined #nix-darwin
hedgie has joined #nix-darwin
hedgie_ has quit [Ping timeout: 240 seconds]
iH8c0ff33 has joined #nix-darwin
iH8c0ff33 has quit [Ping timeout: 264 seconds]
emily has quit [Ping timeout: 268 seconds]
emily has joined #nix-darwin
iH8c0ff33 has joined #nix-darwin
iH8c0ff33 has quit [Ping timeout: 256 seconds]
supersandro2000 has quit [Quit: The Lounge - https://thelounge.chat]
supersandro2000 has joined #nix-darwin
iH8c0ff33 has joined #nix-darwin
LnL has quit [Quit: exit 1]
iH8c0ff33 has quit [Ping timeout: 256 seconds]
abathur has quit [Quit: abathur]
abathur has joined #nix-darwin
LnL has joined #nix-darwin
LnL- has joined #nix-darwin
LnL has quit [Ping timeout: 256 seconds]
LnL has joined #nix-darwin
LnL- has quit [Ping timeout: 268 seconds]
LnL has quit [Ping timeout: 256 seconds]
kalbasit has quit [Ping timeout: 240 seconds]
LnL has joined #nix-darwin
LnL has quit [Quit: exit 1]
LnL has joined #nix-darwin
LnL has quit [Remote host closed the connection]
LnL has joined #nix-darwin
LnL has quit [Quit: exit 1]
LnL has joined #nix-darwin
LnL has quit [Ping timeout: 268 seconds]
LnL has joined #nix-darwin
LnL has quit [Client Quit]
LnL has joined #nix-darwin
iH8c0ff33 has joined #nix-darwin
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
<{^_^}> https://github.com/NixOS/nix/pull/3608 (by surajbarkale, 29 weeks ago, merged): Use /etc/zshenv instead of /etc/zshrc for profile
<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
<{^_^}> https://github.com/NixOS/nix/pull/3996 (by abathur, 14 weeks ago, merged): Macos big sur installer fixes
<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
<abathur> though I'm not sure either of those are released; it's still zshrc in 2.3-maintenance
<xanderle> i think this is relevant...
<xanderle> `nix (Nix) 2.3.9`
<LnL> let me check somethig
<LnL> yeah that's not released yet
<LnL> here's what happens if I replace zshenv with an empty file https://gist.github.com/LnL7/cd69b618b344398b8bb881e0e390a1d4
<LnL> what do you see with this? ls -l /etc/z*
<LnL> in that case you should definitely see an error like I showed above
<LnL> everything has been applied nicely except for zshenv
<xanderle> contents of my zshenv
<LnL> ok that's even more confusing
<xanderle> ive been at this for a few hours. let me check if i made any changes around that file
<LnL> the content is right that should be a symlink like everything else
<LnL> but*
<xanderle> ive not touched the file... just cat'ed it a bunch
philr has joined #nix-darwin
<LnL> no idea what happened there but it's probably best to remove and re run the installer
<LnL> based on the content this isn't what's loading nix-daemon.sh however
<xanderle> uninstalled, restarted shell, installed... same issue
<LnL> right but the file is linked like everything else now?
<xanderle> inside /etc/zshrc there's a line that's calling nix-daemon.sh as long as the daemon.sh file exists
<xanderle> all the z* files are the same
<xanderle> don't know if this helps but its contents of /etc/zshrc
<LnL> that doesn't look right
<LnL> the creation date is still the same
<xanderle> zshenv went from 19:06 to 21:41
<xanderle> i uninstalled nix-darwin
<xanderle> was i meant to uninstall nix as well?
<LnL> oh, I meant just removing the zshenv file and reinstalling
<xanderle> oh!
<LnL> uninstall/reinstall shouldn't do much
<LnL> alltho I think you just found a bug in there
<xanderle> i might be wrong but i think -set-environment in the zshenv is only being called once and daemon.sh is just replacing it
<LnL> are you pasting the right thing? that's the same again
<xanderle> yep, i deleted /etc/zshenv and reran the installer
<xanderle> delete zshenv or zshrc?
<xanderle> nothing in zshrc references nix-darwin
<xanderle> is it meant to?
<LnL> oh! sorry I meant zshrc
<xanderle> oh...
<LnL> brain got confused because of the earlier discussion :)
<xanderle> okay bare with me ill rerun
<LnL> this makes a lot more sense now
<LnL> ok ok I see now
<xanderle> Would you like to load darwin configuration in /etc/zshrc? [y/n] ythis question is new
<xanderle> oh my zshrc file is just one line now
<xanderle> `if test -e /etc/static/zshrc; then . /etc/static/zshrc; fi`
<LnL> yeah so that works as an alternative to just linking everything
<LnL> however somehow the nix-daemon stuff ended up _after_ that line
<LnL> the confusion with zshrc/zshenv also means the uninstaller is fine
<LnL> but first, if you start a new shell you should be able to user darwin-rebuild now correct?
<xanderle> haha yep
<LnL> ok so you could leave stuff as is if you want, but the 2 expected cases are
<LnL> either having /etc/zshrc be a straight symlink like the other files, you can do this by removing the one line file and switching again
<LnL> which is the original content with just a single line at the end
<LnL> alltho aparently my bashrc also ended up with a single line like that somehow :)
<LnL> for the ordering issue, have you re installed nix at some point?
<xanderle> i installed nix single, fully uninstalled it, then installed nix with --daemon flag (i have no idea what I'm doing)
<xanderle> oh i see, zshenv is called before zshrc
<LnL> but never reinstalled the daemon?
<xanderle> i don't think so
<xanderle> what would reinstalling daemon cause?
<LnL> well both the installers append to the file
<LnL> but you can't run the nix-darwin installer first so how did it's line end up before the other one
<xanderle> ill try remove everything
<LnL> nono
<xanderle> and see if i end up in the same place
<xanderle> oh
<LnL> you're good now :)
<LnL> hmm wait, I think I see
<LnL> nix (single user) -> nix-darwin -> zshrc and then later nix (daemon) -> zshrc
<LnL> since the nix installer isn't necessarily system wide
<xanderle> how often is __NIX_DARWIN_SET_ENVIRONMENT_DONE run?
<LnL> not sure I get the question
<xanderle> sorry, at what point does `__NIX_DARWIN_SET_ENVIRONMENT_DONE` get set.... is it as soon as a terminal opens or is it before that
<xanderle> I'm trying to copy the script that sets `__NIX_DARWIN_SET_ENVIRONMENT_DONE` inside zshrc after the daemon.sh has run...
<xanderle> because if i change to the zshrc in the gist you shared... i lose the daemon.sh call and I'm not 100% on the consequences of that
<LnL> nix-daemon.sh shouldn't run at all anymore now
<xanderle> its not needed?
<LnL> ah no you don't have to worry about that, nix-darwin takes over all of the setup
<xanderle> wait so there was no reason for me to install it with daemon
<LnL> as long as you have services.nix-daemon.enable = true in your configuration
<xanderle> oh god
<xanderle> i only installed it with daemon because i thought i was meant to... i could have just toggled the flag
<xanderle> i think i spent 3 hours on this
<LnL> just switching that flag doesn't quite work
<LnL> but if you know what to do it's just fixing a few permissions
<LnL> so not entirely pointless
<xanderle> well i learnt a lot about shells in the process so that was fun
<xanderle> ahh cool, thanks for the explanation
<xanderle> now i need to work out how to use nix-darwin and home-manager, the saga continues
<LnL> happy hacking :)
<xanderle> thanks! you too, thanks for the help as well
xanderle has quit [Ping timeout: 245 seconds]
eraserhd has quit [Read error: Connection reset by peer]
eraserhd has joined #nix-darwin
eraserhd has quit [Ping timeout: 264 seconds]
dhess has joined #nix-darwin