Like I said above, you can do command-not-found to find the package. The NixOS channels export a database of all the executables which were built.
Haha. Oops. I didn’t realize that was a command. I thought you were showing me an error message.
So I tried that and got an error:
DBI connect('dbname=/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite','',...) failed: unable to open database file at /run/current-system/sw/bin/command-not-found line 13.
cannot open database `/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite' at /run/current-system/sw/bin/command-not-found line 13.
Also, I am interested in doing this:
To enable the script to use the command, you either need to nixify each command you call
I am still unsure about how/where to do this. configuration.nix? I assume your example is of nixifying your pipewire.sh script, which I assume creates a nix package, puts it in the store, and makes it available “places”. Not sure how it’s path gets exported. Am I close?
Lastly, in your pipewire.sh example, I notice that you repeat your PATH export, once at the top of the file:
{ lib, coreutils, gnused, pulseaudio, pipewire, writeShellScript }:
and once within writeShellScript:
PATH=${lib.makeBinPath [ coreutils gnused pulseaudio pipewire ]}
I think I understand the second one. Those are packages required to run your script. But what about the first one?
Sorry for all the questions, and thanks for your patience. They aren’t lying when they say NixOS has a bit of a steep learning curve!