From fcbf9c6415e9936475d05e6f1090793367b0f2ff Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Fri, 31 Mar 2023 19:32:33 +0200 Subject: [PATCH] patch-ppd-files: use `meta` and `passthru` directly When I authored the nix file in 335a9083b02d2a7034dd98c8641f019e85e50426, `makeSetupHook` didn't know about `passthru` or `meta`. So I foisted these attributes on the derivation with `.overrideAttrs`. Commits ba895a7da8f86c6f924fc96026d8f1cb1ea2af1e and 48034046bf6271d44f7dea4c1ba97196b3b105a7 enabled `makeSetupHook` to receive these attributes directly. It seems advisable to use that instead of `.overrideAttrs`. --- .../setup-hooks/patch-ppd-files/default.nix | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/pkgs/build-support/setup-hooks/patch-ppd-files/default.nix b/pkgs/build-support/setup-hooks/patch-ppd-files/default.nix index b3c7b19f373..854f857020a 100644 --- a/pkgs/build-support/setup-hooks/patch-ppd-files/default.nix +++ b/pkgs/build-support/setup-hooks/patch-ppd-files/default.nix @@ -4,22 +4,15 @@ , callPackage }: -let - patchPpdFilesHook = makeSetupHook - { - name = "patch-ppd-files"; - substitutions.which = lib.attrsets.getBin which; - substitutions.awkscript = ./patch-ppd-lines.awk; - } - ./patch-ppd-hook.sh; -in - -patchPpdFilesHook.overrideAttrs ( - lib.trivial.flip - lib.attrsets.recursiveUpdate - { - passthru.tests.test = callPackage ./test.nix {}; - meta.description = "setup hook to patch executable paths in ppd files"; - meta.maintainers = [ lib.maintainers.yarny ]; - } -) +makeSetupHook { + name = "patch-ppd-files"; + substitutions = { + which = lib.getBin which; + awkscript = ./patch-ppd-lines.awk; + }; + passthru.tests.test = callPackage ./test.nix {}; + meta = { + description = "setup hook to patch executable paths in ppd files"; + maintainers = [ lib.maintainers.yarny ]; + }; +} ./patch-ppd-hook.sh