From c8decd3671e5fa79dbb2ea0130ba23ed5d115679 Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Fri, 6 Dec 2024 22:52:39 +0800 Subject: [PATCH] =?UTF-8?q?listmonk:=203.0.0=20=E2=86=92=204.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/by-name/li/listmonk/frontend.nix | 25 +++++++++------ pkgs/by-name/li/listmonk/package.nix | 45 +++++++++++++++++---------- pkgs/by-name/li/listmonk/stuffbin.nix | 25 --------------- 3 files changed, 45 insertions(+), 50 deletions(-) delete mode 100644 pkgs/by-name/li/listmonk/stuffbin.nix diff --git a/pkgs/by-name/li/listmonk/frontend.nix b/pkgs/by-name/li/listmonk/frontend.nix index 928092038c127..52b8b2da89ad5 100644 --- a/pkgs/by-name/li/listmonk/frontend.nix +++ b/pkgs/by-name/li/listmonk/frontend.nix @@ -1,11 +1,14 @@ -{ mkYarnPackage -, fetchYarnDeps -, meta -, version -, src +{ + stdenv, + fetchYarnDeps, + yarnConfigHook, + yarnBuildHook, + nodejs, + meta, + version, + src, }: - -mkYarnPackage { +stdenv.mkDerivation (finalAttrs: { pname = "listmonk-frontend"; inherit version; @@ -14,7 +17,7 @@ mkYarnPackage { offlineCache = fetchYarnDeps { yarnLock = "${src}/frontend/yarn.lock"; - hash = "sha256-TdrglyRtb2Q8SFtoiCoDj/zBV2+7DwzIm/Fzlt0ZvSo="; + hash = "sha256-2STFJtlneyR6QBsy/RVIINV/0NMggnfZwyz1pki8iPk="; }; configurePhase = '' @@ -26,8 +29,12 @@ mkYarnPackage { ''; installPhase = '' + runHook preInstall + mkdir $out - cp -R dist/* $out + cp -r dist/* $out + + runHook postInstall ''; doDist = false; diff --git a/pkgs/by-name/li/listmonk/package.nix b/pkgs/by-name/li/listmonk/package.nix index 0a111224161ee..73c25227cbe84 100644 --- a/pkgs/by-name/li/listmonk/package.nix +++ b/pkgs/by-name/li/listmonk/package.nix @@ -1,23 +1,33 @@ -{ lib, buildGoModule, fetchFromGitHub, callPackage, stuffbin, nixosTests }: - +{ + lib, + buildGoModule, + fetchFromGitHub, + callPackage, + stuffbin, + nixosTests, +}: buildGoModule rec { pname = "listmonk"; - version = "3.0.0"; + version = "4.1.0"; src = fetchFromGitHub { owner = "knadh"; repo = "listmonk"; - rev = "v${version}"; - sha256 = "sha256-eNX+2ens+mz2V8ZBHtFFHDVbi64AAiiREElMjh67Dd8="; + tag = "v${version}"; + hash = "sha256-f6jket2lHw8r5lFkIZ7KurHbWFezNV4YO+9rmZ79WSc="; }; - vendorHash = "sha256-XAm2VfX1nHWTuAV2COEn8qrqPNv0xbaWgTYCpjrEfMw="; + vendorHash = "sha256-sQ9CoYWdZYVdwh/Pszp/JEglvAU2/zJFSZ9jx8Ed/9M="; nativeBuildInputs = [ stuffbin ]; - ldflags = [ "-s" "-w" "-X main.version=${version}" ]; + ldflags = [ + "-s" + "-w" + "-X main.version=${version}" + ]; postInstall = '' mv $out/bin/cmd $out/bin/listmonk @@ -30,28 +40,31 @@ buildGoModule rec { "config.toml.sample" "schema.sql" "queries.sql" + "permissions.json" "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} - ''; + '' + stuffbin -a stuff -in $out/bin/listmonk -out $out/bin/listmonk \ + ${lib.concatStringsSep " " vfsMappings} + ''; passthru = { frontend = callPackage ./frontend.nix { inherit meta version src; }; - tests = { inherit (nixosTests) listmonk; }; + tests = { + inherit (nixosTests) listmonk; + }; }; - meta = with lib; { - description = "High performance, self-hosted, newsletter and mailing list manager with a modern dashboard."; + meta = { + description = "High performance, self-hosted, newsletter and mailing list manager with a modern dashboard"; mainProgram = "listmonk"; homepage = "https://github.com/knadh/listmonk"; changelog = "https://github.com/knadh/listmonk/releases/tag/v${version}"; - maintainers = with maintainers; [ raitobezarius ]; - license = licenses.agpl3Only; + maintainers = with lib.maintainers; [ raitobezarius ]; + license = lib.licenses.agpl3Only; }; } diff --git a/pkgs/by-name/li/listmonk/stuffbin.nix b/pkgs/by-name/li/listmonk/stuffbin.nix deleted file mode 100644 index 2640ba8b85197..0000000000000 --- a/pkgs/by-name/li/listmonk/stuffbin.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib, buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "stuffbin"; - version = "1.1.0"; - - vendorHash = null; - - src = fetchFromGitHub { - owner = "knadh"; - repo = "stuffbin"; - rev = "v${version}"; - sha256 = "sha256-M72xNh7bKUMLzA+M8bJB++kJ5KCrkboQm1v8BasP3Yo="; - }; - - ldflags = [ "-s" "-w" "-X main.version=${version}" ]; - - meta = with lib; { - description = "Compress and embed static files and assets into Go binaries and access them with a virtual file system in production"; - homepage = "https://github.com/knadh/stuffbin"; - changelog = "https://github.com/knadh/stuffbin/releases/tag/v${version}"; - maintainers = with maintainers; [ raitobezarius ]; - license = licenses.mit; - }; -}