···
+
{ lib, buildGoModule, buildNpmPackage, fetchFromGitHub, moreutils, jq, git }:
+
# finalAttrs when 🥺 (buildGoModule does not support them)
+
# https://github.com/NixOS/nixpkgs/issues/273815
+
src = fetchFromGitHub {
+
hash = "sha256-rJ8oiH08kSSFNgPHKGo68Oi1i3L1SEJyHuzoxKMOZME=";
+
frontend = buildNpmPackage {
+
pname = "opengist-frontend";
+
nativeBuildInputs = [ moreutils jq ];
+
# npm complains of "invalid package". shrug. we can give it a version.
+
jq '.version = "${version}"' package.json | sponge package.json
+
# copy pasta from the Makefile upstream, seems to be a workaround of sass
+
# issues, unsure why it is not done in vite:
+
# https://github.com/thomiceli/opengist/blob/05eccfa8e728335514a40476cd8116cfd1ca61dd/Makefile#L16-L19
+
EMBED=1 npx postcss 'public/assets/embed-*.css' -c public/postcss.config.js --replace
+
npmDepsHash = "sha256-Sy321tIQOOrypk+EOGGixEzrPdhA9U8Hak+DOS+d00A=";
+
vendorHash = "sha256-IorqXJKzUTUL5zfKRipZaJtRlwVOmTwolJXFG/34Ais=";
+
# required for tests to not try to write into $HOME and fail
+
export OG_OPENGIST_HOME=$(mktemp -d)
+
cp -R ${frontend}/public/{manifest.json,assets} public/
+
passthru.frontend = frontend;
+
description = "Self-hosted pastebin powered by Git";
+
homepage = "https://github.com/thomiceli/opengist";
+
license = lib.licenses.agpl3Only;
+
maintainers = with lib.maintainers; [ lf- ];
+
platforms = lib.platforms.unix;