Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

mailpit: fix build by splitting off nodejs part

+33 -10
+33 -10
pkgs/servers/mail/mailpit/default.nix
··· 1 { lib 2 , buildGoModule 3 , nodejs 4 , python3 ··· 8 , fetchNpmDeps 9 }: 10 11 - buildGoModule rec { 12 - pname = "mailpit"; 13 version = "1.7.1"; 14 15 src = fetchFromGitHub { ··· 19 hash = "sha256-jT9QE0ikp9cJlT8qtfPPjKOUuqWyQk94D3UbkyaGXa8="; 20 }; 21 22 - vendorHash = "sha256-XBYIO7fdo5EahJB7EcAuY9SGKZb8dsvoJHp/D5LO5Qo="; 23 24 - npmDeps = fetchNpmDeps { 25 - inherit src; 26 - hash = "sha256-6VCs8125fTJkZW+eZgK56j7ccK8tcGhIXiq2HkYp4XM="; 27 }; 28 29 - nativeBuildInputs = [ nodejs python3 libtool npmHooks.npmConfigHook ]; 30 31 - preBuild = '' 32 - npm run package 33 - ''; 34 35 CGO_ENABLED = 0; 36 37 ldflags = [ "-s" "-w" "-X github.com/axllent/mailpit/config.Version=${version}" ]; 38 39 meta = with lib; { 40 description = "An email and SMTP testing tool with API for developers";
··· 1 { lib 2 + , stdenv 3 , buildGoModule 4 , nodejs 5 , python3 ··· 9 , fetchNpmDeps 10 }: 11 12 + let 13 + 14 version = "1.7.1"; 15 16 src = fetchFromGitHub { ··· 20 hash = "sha256-jT9QE0ikp9cJlT8qtfPPjKOUuqWyQk94D3UbkyaGXa8="; 21 }; 22 23 + # Separate derivation, because if we mix this in buildGoModule, the separate 24 + # go-modules build inherits specific attributes and fails. Getting that to 25 + # work is hackier than just splitting the build. 26 + ui = stdenv.mkDerivation { 27 + pname = "mailpit-ui"; 28 + inherit src version; 29 + 30 + npmDeps = fetchNpmDeps { 31 + inherit src; 32 + hash = "sha256-6VCs8125fTJkZW+eZgK56j7ccK8tcGhIXiq2HkYp4XM="; 33 + }; 34 + 35 + nativeBuildInputs = [ nodejs python3 libtool npmHooks.npmConfigHook ]; 36 + 37 + buildPhase = '' 38 + npm run package 39 + ''; 40 41 + installPhase = '' 42 + mv server/ui/dist $out 43 + ''; 44 }; 45 46 + in 47 + 48 + buildGoModule { 49 + pname = "mailpit"; 50 + inherit src version; 51 52 + vendorHash = "sha256-XBYIO7fdo5EahJB7EcAuY9SGKZb8dsvoJHp/D5LO5Qo="; 53 54 CGO_ENABLED = 0; 55 56 ldflags = [ "-s" "-w" "-X github.com/axllent/mailpit/config.Version=${version}" ]; 57 + 58 + preBuild = '' 59 + cp -r ${ui} server/ui/dist 60 + ''; 61 62 meta = with lib; { 63 description = "An email and SMTP testing tool with API for developers";