The program 'killall' is not in your PATH

I am brand new at Nixos (coming from Arch) and did a fresh installation.

I frequently get a message like

The program 'killall' is not in your PATH. It is provided by several packages. You can make it available in an ephemeral shell by typing one of the following: nix-shell -p busybox nix-shell -p killall nix-shell -p psmisc nix-shell -p toybox

for programs that are usually available in the shell (killall is just an example).

Can i add a path in my shell (i am using fish), so that all those programs are permanently accessible to fish as in other OSes?

You probably would rather install a package that just adds it to the directories that are in $PATH by default.

You can do that using environment.systemPackages.

i.e., in your /etc/nixos/configuration.nix, look for the environment.systemPackages setting, and then simply add killall to the list and rebuild your system using sudo nixos-rebuild switch. Generally, when you want to make a persistent change to NixOS, that’s how you do it - the linked page allows you to search for lots of other permanent settings you can set too.

See also the entry on package management in the NixOS manual: NixOS - NixOS 22.05 manual.

I see, i didn’t realize, that also these “small” programs need to be included.

Thank you very much!