From 704aa9566a4bc7394ea9cb3dab89a2fdf7512f88 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 24 Aug 2022 11:49:11 +0800 Subject: [PATCH] Add buildGoApplication and mkGoEnv parameters to gomod2nix expression This is so nixpkgs can inject it from another location. --- generic.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/generic.nix b/generic.nix index 92de832..ca3f547 100644 --- a/generic.nix +++ b/generic.nix @@ -9,13 +9,11 @@ , makeWrapper , installShellFiles , fetchFromGitHub +, buildGoApplication ? (callPackage ./builder { }).buildGoApplication +, mkGoEnv ? (callPackage ./builder { }).buildGoApplication }: -let - builder = callPackage ./builder { }; - -in -builder.buildGoApplication { +buildGoApplication { pname = "gomod2nix"; inherit version modules src go; @@ -25,7 +23,9 @@ builder.buildGoApplication { nativeBuildInputs = [ makeWrapper installShellFiles ]; - passthru = builder; + passthru = { + inherit buildGoApplication mkGoEnv; + }; postInstall = lib.optionalString (stdenv.buildPlatform == stdenv.targetPlatform) '' $out/bin/gomod2nix completion bash > gomod2nix.bash