From 8d8b0013ca1690a118e54432607eaa1860865a23 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sat, 3 Feb 2024 03:05:46 +0300 Subject: [PATCH] Nix : Tmpshell now uses flakes. --- .config/bash/module/Nix.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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"