rely on function autocalling

Instead of the current behavior of always trying to call the expression
as a function, or alternatively, trying to implement autocalling
manually with `builtins.isFunction`.
This commit is contained in:
Charles Hall 2025-02-14 10:41:18 -08:00 committed by mergify[bot]
parent 3888383341
commit 2e82170f06

View file

@ -492,11 +492,9 @@ use_nix() {
if [[ -n $packages ]]; then
extra_args+=("--expr" "with import <nixpkgs> {}; mkShell { buildInputs = [ $packages ]; }")
else
# figure out what attribute we should build
if [[ -z $attribute ]]; then
extra_args+=("--file" "$nixfile")
else
extra_args+=("--expr" "(import ${nixfile} {}).${attribute}")
if [[ -n $attribute ]]; then
extra_args+=("$attribute")
fi
fi