Nix : Tmpshell now uses flakes.
This commit is contained in:
parent
0c16bad826
commit
8d8b0013ca
|
@ -89,14 +89,20 @@ alias shell="nix_shell"
|
||||||
# Spawn nix-shell with specified packages.
|
# Spawn nix-shell with specified packages.
|
||||||
# Usage: nix_tmpshell <PACKAGES>
|
# Usage: nix_tmpshell <PACKAGES>
|
||||||
function nix_tmpshell() {
|
function nix_tmpshell() {
|
||||||
local pkgs="${@}"
|
local IFS=$'\n'
|
||||||
|
local input=("${@}")
|
||||||
|
local pkgs=()
|
||||||
|
|
||||||
if [[ "${pkgs}" = "" ]]; then
|
if [[ "${input}" = "" ]]; then
|
||||||
help nix_tmpshell
|
help nix_tmpshell
|
||||||
return 2
|
return 2
|
||||||
fi
|
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"
|
alias tmpshell="nix_tmpshell"
|
||||||
|
|
||||||
|
|
Reference in a new issue