diff --git a/.config/bash/module/Nix.sh b/.config/bash/module/Nix.sh index ba761a2..d84f51b 100644 --- a/.config/bash/module/Nix.sh +++ b/.config/bash/module/Nix.sh @@ -89,14 +89,20 @@ alias shell="nix_shell" # Spawn nix-shell with specified packages. # Usage: nix_tmpshell function nix_tmpshell() { - local pkgs="${@}" + local IFS=$'\n' + local input=("${@}") + local pkgs=() - if [[ "${pkgs}" = "" ]]; then + if [[ "${input}" = "" ]]; then help nix_tmpshell return 2 fi - nix_shell="${1}" nix-shell -p ${pkgs} + for pkg in ${input[@]}; do + pkgs+=("nixpkgs#${pkg}") + done + + nix_shell="${1}" nix shell ${pkgs[@]} } alias tmpshell="nix_tmpshell"