buildGoModule: use lib.toExtension

Use toExtension from Nixpkgs library instead of the one defined locally.
This commit is contained in:
Yueh-Shun Li
2024-09-14 21:47:59 +08:00
parent 53a24f4a7c
commit e31ace5cd4
+1 -15
View File
@@ -63,20 +63,6 @@ let
GO111MODULE = "on";
GOTOOLCHAIN = "local";
toExtension =
overlay0:
if lib.isFunction overlay0 then
final: prev:
if lib.isFunction (overlay0 prev) then
# `overlay0` is `final: prev: { ... }`
overlay0 final prev
else
# `overlay0` is `prev: { ... }`
overlay0 prev
else
# `overlay0` is `{ ... }`
final: prev: overlay0;
in
(stdenv.mkDerivation (finalAttrs:
args
@@ -333,7 +319,7 @@ in
# Canonicallize `overrideModAttrs` as an attribute overlay.
# `passthru.overrideModAttrs` will be overridden
# when users want to override `goModules`.
overrideModAttrs = toExtension overrideModAttrs;
overrideModAttrs = lib.toExtension overrideModAttrs;
} // passthru;
meta = {