summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-07-03 21:34:50 +0300
committerArtturin <Artturin@artturin.com>2023-07-03 21:34:50 +0300
commit42c94d06fdb683ab9bd72a9cd624868386d0f0cd (patch)
tree2612eead7fcbfea48d0c98f7faed36c43af4039a /pkgs/stdenv/generic
parentaafa2b2c3d46081f1009d87ad55d438390875254 (diff)
downloadnixpkgs-42c94d06fdb683ab9bd72a9cd624868386d0f0cd.tar
nixpkgs-42c94d06fdb683ab9bd72a9cd624868386d0f0cd.tar.gz
nixpkgs-42c94d06fdb683ab9bd72a9cd624868386d0f0cd.tar.bz2
nixpkgs-42c94d06fdb683ab9bd72a9cd624868386d0f0cd.tar.lz
nixpkgs-42c94d06fdb683ab9bd72a9cd624868386d0f0cd.tar.xz
nixpkgs-42c94d06fdb683ab9bd72a9cd624868386d0f0cd.tar.zst
nixpkgs-42c94d06fdb683ab9bd72a9cd624868386d0f0cd.zip
stdenv: fix overriding with attrset when finalAttrs isn't used
```
nix-repl> (pkgs.htop.overrideAttrs { pname = "hello-overriden"; }).pname
error:
       … while evaluating a branch condition

         at /nix/store/phn5cahwacv9wjgalygw62x8l4xbl6x3-source/lib/customisation.nix:86:7:

           85|     in
           86|       if builtins.isAttrs result then
             |       ^
           87|         result // {

       … while calling the 'isAttrs' builtin

         at /nix/store/phn5cahwacv9wjgalygw62x8l4xbl6x3-source/lib/customisation.nix:86:10:

           85|     in
           86|       if builtins.isAttrs result then
             |          ^
           87|         result // {

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attempt to call something which is not a function but a set

       at /nix/store/phn5cahwacv9wjgalygw62x8l4xbl6x3-source/pkgs/stdenv/generic/make-derivation.nix:58:21:

           57|           f = self: super:
           58|             let x = f0 super;
             |                     ^
           59|             in
```
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 8af162da7f2..74542691598 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -62,7 +62,7 @@ let
                 f0 self super
               else x;
         in
-          makeDerivationExtensible (self: attrs // f self attrs))
+          makeDerivationExtensible (self: attrs // (if builtins.isFunction f0 || f0?__functor then f self attrs else f0)))
       attrs;
 
   mkDerivationSimple = overrideAttrs: