nixpkgs-suyu/pkgs/by-name/li/listmonk/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, callPackage, stuffbin, nixosTests }:
2022-08-06 00:41:24 +02:00
buildGoModule rec {
pname = "listmonk";
version = "3.0.0";
2022-08-06 00:41:24 +02:00
src = fetchFromGitHub {
owner = "knadh";
repo = "listmonk";
rev = "v${version}";
sha256 = "sha256-eNX+2ens+mz2V8ZBHtFFHDVbi64AAiiREElMjh67Dd8=";
2022-08-06 00:41:24 +02:00
};
vendorHash = "sha256-XAm2VfX1nHWTuAV2COEn8qrqPNv0xbaWgTYCpjrEfMw=";
2022-08-06 00:41:24 +02:00
nativeBuildInputs = [
stuffbin
];
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
postInstall = ''
mv $out/bin/cmd $out/bin/listmonk
'';
# Run stuffbin to stuff the frontend and the static in the binary.
postFixup =
let
vfsMappings = [
"config.toml.sample"
"schema.sql"
"queries.sql"
"static/public:/public"
"static/email-templates"
"${passthru.frontend}:/admin"
"i18n:/i18n"
];
in
''
stuffbin -a stuff -in $out/bin/listmonk -out $out/bin/listmonk \
${lib.concatStringsSep " " vfsMappings}
'';
passthru = {
frontend = callPackage ./frontend.nix { inherit meta version src; };
2022-08-30 13:15:41 +02:00
tests = { inherit (nixosTests) listmonk; };
2022-08-06 00:41:24 +02:00
};
meta = with lib; {
description = "High performance, self-hosted, newsletter and mailing list manager with a modern dashboard.";
mainProgram = "listmonk";
2022-08-06 00:41:24 +02:00
homepage = "https://github.com/knadh/listmonk";
changelog = "https://github.com/knadh/listmonk/releases/tag/v${version}";
maintainers = with maintainers; [ raitobezarius ];
2024-03-19 13:26:06 +01:00
license = licenses.agpl3Only;
2022-08-06 00:41:24 +02:00
};
}