From 0aa507272eba764b2af3e54ca594d2b070da6956 Mon Sep 17 00:00:00 2001 From: phanirithvij Date: Mon, 2 Feb 2026 08:46:14 +0530 Subject: [PATCH] mailpit: refactor to allow ui to be overriden can't use versionCheckHook because it cannot accept more than one argument for versionCheckProgramArg Signed-off-by: phanirithvij --- pkgs/by-name/ma/mailpit/package.nix | 48 +++++++++++++++++------------ 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/ma/mailpit/package.nix b/pkgs/by-name/ma/mailpit/package.nix index 39db6f124465..fe084a0f54b1 100644 --- a/pkgs/by-name/ma/mailpit/package.nix +++ b/pkgs/by-name/ma/mailpit/package.nix @@ -1,17 +1,19 @@ { lib, stdenv, + fetchFromGitHub, buildGoModule, + fetchNpmDeps, + npmHooks, nodejs, + python3, libtool, cctools, - npmHooks, - fetchFromGitHub, - fetchNpmDeps, - testers, + mailpit, nixosTests, + testers, }: let @@ -64,7 +66,7 @@ let in -buildGoModule { +buildGoModule (finalAttrs: { pname = "mailpit"; inherit src version vendorHash; @@ -72,35 +74,41 @@ buildGoModule { ldflags = [ "-s" - "-w" "-X github.com/axllent/mailpit/config.Version=${version}" ]; preBuild = '' - cp -r ${ui} server/ui/dist + cp -r ${finalAttrs.passthru.ui} server/ui/dist ''; - passthru.tests = { - inherit (nixosTests) mailpit; - version = testers.testVersion { - package = mailpit; - command = "mailpit version --no-release-check"; + passthru = { + tests = { + inherit (nixosTests) mailpit; + # cannot use versionCheckHook due to the extra --no-release-check flag + # for workarounds and other solutions see https://github.com/NixOS/nixpkgs/pull/486143#discussion_r2754533347 + version = testers.testVersion { + package = mailpit; + command = "mailpit version --no-release-check"; + }; }; - }; - passthru.updateScript = { - supportedFeatures = [ "commit" ]; - command = ./update.sh; + updateScript = { + supportedFeatures = [ "commit" ]; + command = ./update.sh; + }; + + inherit ui; }; __darwinAllowLocalNetworking = true; meta = { - description = "Email and SMTP testing tool with API for developers"; - homepage = "https://github.com/axllent/mailpit"; changelog = "https://github.com/axllent/mailpit/releases/tag/v${version}"; - maintainers = with lib.maintainers; [ stephank ]; + description = "Email and SMTP testing tool with API for developers"; + downloadPage = "https://github.com/axllent/mailpit"; + homepage = "https://mailpit.axllent.org"; license = lib.licenses.mit; mainProgram = "mailpit"; + maintainers = with lib.maintainers; [ stephank ]; }; -} +})