| 3 Mar 2026 |
K900 | It absolutely is | 12:29:50 |
raitobezarius | like nix develop | 12:29:53 |
K900 | Yes | 12:30:01 |
goldstein | I’m actually not sure how to reproduce nix shell with nix2 only | 12:30:16 |
raitobezarius | (but I'm not trying to be convinced, we are already aligned :D) | 12:30:19 |
raitobezarius | nix-shell -A | 12:31:22 |
goldstein | wait, really? wouldn’t nix-shell -A also enter a development environment? | 12:31:56 |
raitobezarius | nix-shell '<nixpkgs>' -A systemd will debug the systemd drv | 12:32:20 |
goldstein | e.g. it runs hooks instead of just populating PATH
$ nix-shell -A hello '<nixpkgs>'
Using versionCheckHook
| 12:33:10 |
raitobezarius | sorry, i got shell and develop mixed as always | 12:33:39 |
raitobezarius | nix-shell -p hello then | 12:33:44 |
raitobezarius | this will get you $PATH populated | 12:33:54 |
goldstein | yeah, but that only works for stuff from nixpkgs? | 12:34:01 |
K900 | -p also runs setup hooks | 12:34:14 |
goldstein | if I want to populate PATH with a derivation from a file, I’m not sure how to do this with nix2 cli | 12:34:17 |
K900 | nix shell does not | 12:34:17 |
K900 | There is no direct equivalent | 12:34:21 |
raitobezarius | `nix-shell -p '(import ./..)...' should work? | 12:34:26 |
raitobezarius | * nix-shell -p '(import ./..)...' should work? | 12:34:31 |
raitobezarius | i mean, -p just wrap the thing in a mkShell call somewhat | 12:34:45 |
goldstein | oh, that’s fun, manpage says that -p takes names from nixpkgs, but at the very top it actually lists {packages | expressions} | 12:35:47 |
goldstein | I have a habit of ignoring the top part and just grepping for the option, so I’ve never seen that | 12:35:54 |
emily | (fwiw I explained how to fix it when you were working on a CLI replacement I believe?) | 12:39:01 |
sorrel | my hot take is that the ui of `nix-store -q` is garbage; I have to look up whether I want "references" or "requisites" or "referrers" or wtf else literally every single time I use it | 12:39:36 |
WeetHet | Yeah but that required to change nixpkgs as far as I remember | 12:39:49 |
emily | yes, fixing layering violations requires sorting out the layers | 12:45:17 |
raitobezarius | I'm curious, what's your idea emily to fix this? | 12:57:38 |
emily | I think run is the only sane primitive although mainProgram has its own issues | 12:58:35 |
emily | the Bash stdenv logic should be in Nixpkgs itself and dev shells should be exposed as attrs hanging off derivations | 12:59:11 |
emily | nix search/nix-env -q/recurseForDerivations are another thorn in my side but that's another matter | 13:01:51 |