13 # finalAttrs when 🥺 (buildGoModule does not support them)
14 # https://github.com/NixOS/nixpkgs/issues/273815
16 src = fetchFromGitHub {
20 hash = "sha256-vpl3ztLHeVZndAwDgobfiI+3Xu3CFU38qgXy83p06As=";
23 frontend = buildNpmPackage {
24 pname = "opengist-frontend";
26 # npm complains of "invalid package". shrug. we can give it a version.
28 ${lib.getExe jq} '.version = "${version}"' package.json | ${lib.getExe' moreutils "sponge"} package.json
31 # copy pasta from the Makefile upstream, seems to be a workaround of sass
32 # issues, unsure why it is not done in vite:
33 # https://github.com/thomiceli/opengist/blob/05eccfa8e728335514a40476cd8116cfd1ca61dd/Makefile#L16-L19
35 EMBED=1 npx postcss 'public/assets/embed-*.css' -c public/postcss.config.js --replace
43 npmDepsHash = "sha256-l09TPGBGhWcsl3x14ovilDd1zZWv4XzFCAmAfapKtAE=";
49 vendorHash = "sha256-mLFjRL4spAWuPLVOtt88KH+p2g9lGCYzaHokVxdrLOw=";
50 tags = [ "fs_embed" ];
53 "-X github.com/thomiceli/opengist/internal/config.OpengistVersion=v${version}"
61 # required for tests to not try to write into $HOME and fail
63 export OG_OPENGIST_HOME=$(mktemp -d)
66 doCheck = !stdenv.hostPlatform.isDarwin;
75 cp -R ${frontend}/public/{manifest.json,assets} public/
80 updateScript = ./update.sh;
84 description = "Self-hosted pastebin powered by Git";
85 homepage = "https://github.com/thomiceli/opengist";
86 license = lib.licenses.agpl3Only;
87 changelog = "https://github.com/thomiceli/opengist/blob/${src.tag}/CHANGELOG.md";
88 platforms = lib.platforms.unix;
89 maintainers = with lib.maintainers; [ phanirithvij ];
90 mainProgram = "opengist";