diff --git a/users/pbsds/home/profiles/bashrc.d/nix-shell.sh b/users/pbsds/home/profiles/bashrc.d/nix-shell.sh index f21753a..e515fa1 100644 --- a/users/pbsds/home/profiles/bashrc.d/nix-shell.sh +++ b/users/pbsds/home/profiles/bashrc.d/nix-shell.sh @@ -1,8 +1,13 @@ function ns() { local args=() for pkg in "$@"; do - args+=(nixpkgs#"$pkg") + if [[ "$pkg" =~ ^.*[#:/].*$ ]]; then + args+=("$pkg") + else + args+=(nixpkgs#"$pkg") + fi done + >&2 echo + exec nix shell "${args[@]}" local outpaths="$( export NIXPKGS_ALLOW_BROKEN @@ -21,11 +26,13 @@ function ns() { readarray -d $'\n' -t storepaths_build <<<"$outpaths" # traverse propagated inputs + # TODO: rethink this logic local -i idx=-1 while [[ $((++idx)) -lt "${#storepaths_native[@]}" ]]; do if [[ -f "${storepaths_native[$idx]}"/nix-support/propagated-native-build-inputs ]]; then storepaths_native+=($(cat "${storepaths_native[$idx]}"/nix-support/propagated-native-build-inputs)) fi + # TODO: needed? if [[ -f "${storepaths_native[$idx]}"/nix-support/propagated-build-inputs ]]; then storepaths_build+=($(cat "${storepaths_native[$idx]}"/nix-support/propagated-build-inputs)) fi