direnv
Nixos and direnv have great interoperability. First enable direnv on nixos:
programs.direnv.enable = true;
Enable direnv in your shell: eval "$(direnv hook zsh)"
Then you can add .envrc files which contain: use nix and direnv will
automatically run a shell.nix file in that directory:
{pkgs ? import <nixpkgs> {}}:
pkgs.mkShell {
packages = [
pkgs.gnumake
pkgs.scdoc
pkgs.go
pkgs.golines
];
}
nixos-containers
NixOS allows you to easily run other NixOS instances as containers. Containers are a light-weight approach to virtualisation that runs software in the container at the same speed as in the host system.
find which package is providing a binary
This assumes you have the binary installed and need to determine which package is providing it:
ls -la $(which pkill)
nixos-flatpak
Useful for things you want to put in a slight sandbox so they don't litter files in your homedir (steam, slack, etc).