urbanists.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
We're a server for people who like bikes, transit, and walkable cities. Let's get to know each other!

Server stats:

572
active users

The docs have a reputation for being not-great, and I got to experience that after reviewing the "Ad hoc Shell Environments" page and attempting to try some things there:

nix.dev/tutorials/first-steps/

```
❯ nix-shell -p nodejs-20_x
error: getting status of '/nix/var/nix/daemon-socket/socket': Permission denied
```

Now, why would creating an env specific to my current user require access to a socket owned by another user?

nix.devAd hoc shell environments — nix.dev documentation

I read somewhere that to solve this error I needed to add my current user to the `nix-users` group, which I did, but then I got another error:

```
❯ nix-shell -p nodejs-20_x
error: creating directory '/nix/store': Permission denied
```

Again, I'm not running the command as root or with `sudo`, so it's unclear why Nix insists on attempting to run as another user.

`nix-shell` could also provide more useful error messages than "permission denied".

Not a great first impression.

So I created that directory and there's a new error:

```
❯ nix-shell -p nodejs-20_x
error: creating directory '/nix/store/.links': Permission denied
```

Created that directory, and there's another error:

```
❯ nix-shell -p nodejs-20_x
error: creating directory '/nix/var/nix/temproots': Permission denied
```

has an missed opportunity to here to check for these error states and produce a more useful diagnostic message than "permission denied".

Mark Stosberg

I manually resolved those directory issues with , only to reveal a new category of error:

```
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
```

Sorry, if trying Nix was supposed to a step towards using , the out of the box experience has been poor for me on Arch Linux.

Apparently this issue might be that first `nix-channel` needs to download something? That could have been done automatically or the diagnostic message could say that.

After I setup `nix-channel` with I was able confirm that I could easily create different shell environments, one with Node 20 and one with Node 22:

❯ nix-shell -p nodejs_20
❯ nix-shell -p nodejs_22

But I wanted the shells to run Fish and not Bash.

`man nix-shell` suggests that perhaps setting NIX_BUILD_SHELL might fix this, but it doesn't, it results in the error:

```
bash: unrecognized option '--rcfile'
```

So far, this is not yet a workflow improvement.