mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 11:36:11 +01:00
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:
parent
3888383341
commit
2e82170f06
1 changed files with 3 additions and 5 deletions
8
direnvrc
8
direnvrc
|
|
@ -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}")
|
||||
extra_args+=("--file" "$nixfile")
|
||||
if [[ -n $attribute ]]; then
|
||||
extra_args+=("$attribute")
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue