From f9bd834055a24d6d776d7331357cf9745e511407 Mon Sep 17 00:00:00 2001 From: phanirithvij Date: Sat, 19 Oct 2024 11:13:31 +0530 Subject: [PATCH 1/2] opengist: 1.6.1 -> 1.7.5 Signed-off-by: phanirithvij --- pkgs/by-name/op/opengist/package.nix | 40 +++++++++++++++++++++------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/op/opengist/package.nix b/pkgs/by-name/op/opengist/package.nix index 03b23225ada8..c19fc6fcc702 100644 --- a/pkgs/by-name/op/opengist/package.nix +++ b/pkgs/by-name/op/opengist/package.nix @@ -1,20 +1,37 @@ -{ lib, buildGoModule, buildNpmPackage, fetchFromGitHub, moreutils, jq, git }: +{ + lib, + buildGoModule, + buildNpmPackage, + fetchFromGitHub, + moreutils, + npm-lockfile-fix, + jq, + git, +}: let # finalAttrs when 🥺 (buildGoModule does not support them) # https://github.com/NixOS/nixpkgs/issues/273815 - version = "1.6.1"; + version = "1.7.5"; src = fetchFromGitHub { owner = "thomiceli"; repo = "opengist"; rev = "v${version}"; - hash = "sha256-rJ8oiH08kSSFNgPHKGo68Oi1i3L1SEJyHuzoxKMOZME="; + hash = "sha256-mZ4j9UWdKa3nygcRO5ceyONetkks3ZGWxvzD34eOXew="; + + # follow https://github.com/thomiceli/opengist/pull/350 and remove here + postFetch = '' + ${lib.getExe npm-lockfile-fix} $out/package-lock.json + ''; }; frontend = buildNpmPackage { pname = "opengist-frontend"; inherit version src; - nativeBuildInputs = [ moreutils jq ]; + nativeBuildInputs = [ + moreutils + jq + ]; # npm complains of "invalid package". shrug. we can give it a version. preBuild = '' @@ -33,15 +50,17 @@ let cp -R public $out ''; - npmDepsHash = "sha256-Sy321tIQOOrypk+EOGGixEzrPdhA9U8Hak+DOS+d00A="; + npmDepsHash = "sha256-cITkgRvWOml6uH77WkiNgFedEuPNze63Gntet09uS5w="; }; in buildGoModule { pname = "opengist"; inherit version src; - vendorHash = "sha256-IorqXJKzUTUL5zfKRipZaJtRlwVOmTwolJXFG/34Ais="; - tags = [ - "fs_embed" + vendorHash = "sha256-6PpS/dsonc/akBn8NwUIVFNe2FjynAhF1TYIYT9K/ws="; + tags = [ "fs_embed" ]; + ldflags = [ + "-s" + "-X github.com/thomiceli/opengist/internal/config.OpengistVersion=v${version}" ]; # required for tests @@ -62,10 +81,11 @@ buildGoModule { meta = { description = "Self-hosted pastebin powered by Git"; - mainProgram = "opengist"; homepage = "https://github.com/thomiceli/opengist"; license = lib.licenses.agpl3Only; - maintainers = [ ]; + changelog = "https://github.com/thomiceli/opengist/blob/master/CHANGELOG.md"; platforms = lib.platforms.unix; + maintainers = [ ]; + mainProgram = "opengist"; }; } From 5d5243fb98a1a3828b7ac56331e75be2f2339c0b Mon Sep 17 00:00:00 2001 From: phanirithvij Date: Sat, 19 Oct 2024 11:16:27 +0530 Subject: [PATCH 2/2] opengist: add phanirithvij as maintainer Signed-off-by: phanirithvij --- pkgs/by-name/op/opengist/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/op/opengist/package.nix b/pkgs/by-name/op/opengist/package.nix index c19fc6fcc702..ef8c6f5b8232 100644 --- a/pkgs/by-name/op/opengist/package.nix +++ b/pkgs/by-name/op/opengist/package.nix @@ -85,7 +85,7 @@ buildGoModule { license = lib.licenses.agpl3Only; changelog = "https://github.com/thomiceli/opengist/blob/master/CHANGELOG.md"; platforms = lib.platforms.unix; - maintainers = [ ]; + maintainers = with lib.maintainers; [ phanirithvij ]; mainProgram = "opengist"; }; }