How to activate multiStdenv.mkDerivation in a nix-shell

Appendix: Here is the full script:

# shell.nix
{ pkgs ? import <nixpkgs> {} }:
(pkgs.buildFHSUserEnv {
  name = "pipzone"; # choose your own name
  targetPkgs = pkgs: (with pkgs; [
    python39 # Preferable choose version with Full postfix, e.g. python311Full
    python39Packages.pip
    python39Packages.virtualen
  ]);
  multiPkgs = pkgs: with pkgs; [ # choose your libraries
    libgcc
    binutils
    coreutils
  ];
  # exporting LIBRARY_PATH is essential so the libraries get found!
  profile = ''
    export LIBRARY_PATH=/usr/lib:/usr/lib64:$LIBRARY_PATH
    # export LIBRARY_PATH=${pkgs.libgcc}/lib # somethingl like this may also be necessary for certain libraries (change to your library e.g. pkgs.coreutils
  '';
  runScript = "bash";
}).env
1 Like