<Lisanna>
nix.trustedUsers is causing my builds to break :/
<Lisanna>
when I add myself to it suddenly what's supposed to be a remote build starts trying to run x86_64-linux bash on my mac laptop, and that fails
<mightybyte>
LnL: If I include a package in environment.systemPackages and then remove it, how do I get it out of my path?
<Lisanna>
mightybyte it should be removed from your path once you do a darwin-rebuild switch
<mightybyte>
Lisanna: Hmmm, I've done that. But for some reason I have binaries for both 1.11 and 2.0 installed.
<mightybyte>
The 2.0 binaries are in /nix/var/nix/profiles/default/bin/nix and the 1.11 binaries are in /run/current-system/sw/bin/nix-shell
<mightybyte>
Unfortunately the latter comes earlier in my path so those binaries take priority.
<pxc>
you removed it from environment.systemPackages, but it's still in /run/current-system/sw/bin after `nix-darwin rebuild switch`?
<mightybyte>
pxc: After `darwin-rebuild switch`, yes.
<pxc>
whoops!
<mightybyte>
I guess I don't actually know how the /run/current-system/sw/bin/nix-shell version got there, but I assumed it was nix-darwin because I used to have nix-shell in the systemPackages there.
<pxc>
/run/current-system/ belongs to nix-darwin, yeah
<mightybyte>
How do I get rid of things in there?
<pxc>
what you're describing is a bug in the essential functionality of nix-darwin, or we've misunderstood the situation
<pxc>
what you've done should have removed it
<pxc>
I can think of some things we can do to explore what's going on here. Are you ready to try some things? I'll try to explain along the way
<mightybyte>
Sure
<pxc>
what's the output of `darwin-rebuild --list-generations`?
<mightybyte>
16 lines
<mightybyte>
14 2018-03-14 13:20:46
<mightybyte>
15 2018-03-14 13:36:58
<mightybyte>
16 2018-03-19 08:17:17 (current)
<pxc>
ok. So these generations are the successive generations of your system-- each time `darwin-rebuild` changes your system, you get a new one
<mightybyte>
ok
<pxc>
we can also look at these generations on the disk-- they're just files. They're symlinks into the Nix store, just like everything in ~/.nix-profile
<pxc>
take a look in /nix/var/nix/profiles to see them
<mightybyte>
There's default-{1-4}-link and system-{1-10}-link symlinks
<pxc>
the default profile is root's user profile
<pxc>
that's the one Nix is installed in when you install Nix with the curl|sh installer
<mightybyte>
Oh, scratch that last comment. There's system-{1-16]-link
<pxc>
the system profile is the one managed by nix-darwin, and the one that relates to configuration change in environment.systemPackages
<pxc>
yeah, it should match the number of generations you saw :-)
<pxc>
so nix-darwin uses a profile just like the Nix profiles, and it calls it the system profile (this convention is taken from NixOS)
<mightybyte>
Ok, that makes sense.
<pxc>
if you've removed software from your darwin-configuration.nix or whatever it's called by default, and then switched generations using `darwin-rebuild switch`, but you're seeing the same stuff between generations, the first thing I'd check is that you're really switching successfully. the second is that the content of each generation was right
<pxc>
so make some other change (another change in systemPackages would be easy)
<pxc>
then list generations and look around /nix/var/nix/profiles before and after `darwin-rebuild switch`
<mightybyte>
Ok
<mightybyte>
I added pkgs.wget to environment.systemPackages, then ran `darwin-rebuild switch` and wget became available.
<mightybyte>
It was not installed before.
<mightybyte>
`which wget` returned /run/current-system/sw/bin/wget
<mightybyte>
Now I removed wget and re-ran darwin-rebuild switch and it disappeared.
<mightybyte>
So it seems to be working as expected.
<mightybyte>
But for some reason /run/current-system/sw/bin/ still has a bunch of nix-1.11.16 binaries.
<pxc>
huh. could you share the whole contents of your darwin-configuration.nix?
<pxc>
my guess is nix-darwin and you (your user) are using different versions of Nixpkgs
<mightybyte>
Oh, that could be.
<mightybyte>
How do you synchronize them?
<pxc>
I forgot because my setup is different, lol
<mightybyte>
Ahh, ok.
<mightybyte>
Well thanks for teh help.
<pxc>
so first show me what's on $NIX_PATH and then the output of `nix-channel --list` as yourself and then as root
<pxc>
I forget how `sudo` works or I'd probably know a better way to do this, but to really run it as root use `sudo -i` and then `nix-channel --list`
<pxc>
on macOS sudo doesn't change your home directory by default or something
<pxc>
oh, yeah. that's it. `sudo -H nix-channel --list` will work
<pxc>
mightybyte: you there?
<mightybyte>
$NIX_PATH is "darwin-config=/Users/mightybyte/.nixpkgs/darwin-configuration.nix:/nix/var/nix/profiles/per-user/root/channels:/Users/mightybyte/.nix-defexpr/channels"
<pxc>
well, if you remove the nixpkgs channel as your own user, it'll use root's instead
<pxc>
then to update nixpkgs just use `sudo -H nix-channel --update` to update nixpkgs
<pxc>
to update ... to update -- kill me
<mightybyte>
Ahh, ok.
<pxc>
you can check which version of Nix each user sees by running `nix-build '<nixpkgs>' -A nix --no-out-link`. Whether the output differs between them will depend on which versions of Nixpkgs are in the channels of each and how they get resolved in each user's NIX_PATH
<pxc>
you can actually compare them if you look inside /nix/var/nix/profiles/per-user/*/channels, if you want to
<pxc>
you can look at each one's store path if you use `realpath`
<pxc>
you can install the GNU coreutils to a profile with Nix (I do on my Macs), but some scripts that expect other the coreutils that come with macOS will break if you do that
jtojnar_ has joined #nix-darwin
jtojnar has quit [Read error: Connection reset by peer]
<pxc>
mightybyte: are/were you and root on two different versions of nixpkgs or was I barking up the wrong tree?
jtojnar has joined #nix-darwin
jtojnar_ has quit [Ping timeout: 240 seconds]
Lisanna has quit [Quit: Lisanna]
jtojnar has quit [Quit: jtojnar]
jtojnar has joined #nix-darwin
pxc has quit [Quit: WeeChat 2.0]
jtojnar has quit [Read error: Connection reset by peer]
jtojnar_ has joined #nix-darwin
jtojnar_ is now known as jtojnar
zzamboni has joined #nix-darwin
zzamboni1 has joined #nix-darwin
zzamboni has quit [Read error: Connection reset by peer]
zzamboni1 has quit [Read error: Connection reset by peer]