From 0fdae315315686d180d924a7c33066fbc5b4c14d Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 21 Jun 2023 17:30:32 +0300 Subject: stdenv: let overrideAttrs accept attrset OR function Makes overrideAttrs usable in the same way that `override` can be used. It allows the first argument of `overrideAttrs` to be either a function or an attrset, instead of only a function: hello.overrideAttrs (old: { postBuild = "echo hello"; }) hello.overrideAttrs { postBuild = "echo hello"; } Previously only the first example was possible. Co-authored-by: adisbladis Co-authored-by: matthewcroughan --- pkgs/stdenv/generic/make-derivation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/stdenv/generic') diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 40ad357739b..d3593b6e809 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -41,7 +41,7 @@ let else x; in makeDerivationExtensible - (self: let super = rattrs self; in super // f self super); + (self: let super = rattrs self; in super // (if builtins.isFunction f0 || f0?__functor then f self super else f0)); finalPackage = mkDerivationSimple overrideAttrs args; -- cgit 1.4.1