Using `nix run` with several packages

glibcLocales relies on setup hook to set the LOCALE_ARCHIVE environment variable. Unlike nix-shell, nix shell or other new command will not run setup hooks as that is too much Nixpkgs-specific behaviour. To be precise, nix-shell created a derivation using a helper from Nixpkgs – with new commands, you will need to create it explicitly using something like the following:

nix develop --impure --expr 'let pkgs = import (builtins.getFlake "nixpkgs/nixos-unstable") {}; in pkgs.mkShell { buildInputs = with pkgs; [ python3 glibcLocales ]; }'

See Qt development environment on a flake system - #5 by jtojnar for more details about creating shells this way.

5 Likes