{ pkgs , tools ? [] , envVars ? {} }: let # TODO: escape values properly exportEnvVar = k: v: ''export ${k}="${v}"; echo ${k}=\"${v}\"''; exportedEnvVars = pkgs.lib.mapAttrsToList exportEnvVar envVars; in pkgs.mkShell { buildInputs = tools; # TODO: handle case with no env variable set # TODO: handle case with no package in tools # TODO: allow custom shell shellHook = '' echo -e "\nDEVSHELL ENVIRONMENT VARIABLES:" ${pkgs.lib.concatStringsSep "\n" exportedEnvVars} echo -e "\nDEVSHELL COMMANDS:" ls "${pkgs.symlinkJoin { name = "env"; paths = tools; }}/bin" # Use the default user shell instead of Bash $(${pkgs.finger_bsd}/bin/finger $USER \ | ${pkgs.gnugrep}/bin/grep -oP 'Shell: \K.*') exit $? ''; }