Skip to content

Commit

Permalink
porn-vault: init at 0.30.0-rc.11
Browse files Browse the repository at this point in the history
  • Loading branch information
LuNeder committed Nov 14, 2024
1 parent 64e9f97 commit 760d8cd
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
112 changes: 112 additions & 0 deletions pkgs/by-name/po/porn-vault/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
fetchFromGitLab,
fetchurl,
lib,
pnpm,
stdenvNoCC,
nodejs_22,
ffmpeg,
imagemagick,
writeShellScript,
makeWrapper,
autoPatchelfHook,
}:
let
izzy = stdenvNoCC.mkDerivation rec {
pname = "izzy";
version = "2.0.2";

src = fetchurl {
url = "https://gitlab.com/porn-vault/izzy/-/package_files/151366122/download";
hash = "sha256-K+rVb2F3HizMKIpY1zbLj5zE7B6DkIoq8nJYPUpQn+Y=";
};

dontUnpack = true;

nativeBuildInputs = [
autoPatchelfHook
];

installPhase = ''
install -Dm755 $src $out/bin/izzy
'';

meta = with lib; {
description = "Rust In-Memory K-V Store with Redis-Style File Persistence and Secondary Indices";
homepage = "https://gitlab.com/porn-vault/izzy";
license = lib.licenses.gpl3;
maintainers = with maintainers; [ luNeder ];
platforms = [ "x86_64-linux" ];
mainProgram = "izzy";
};
};
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "porn-vault";
version = "0.30.0-rc.11";

src = fetchFromGitLab {
owner = "porn-vault";
repo = "porn-vault";
rev = "4c6182c5825d85193cf67cb7cd927da2feaaecdb";
hash = "sha256-wQ3dqLc0l2BmLGDYrbWxX2mPwO/Tqz0fY/fOQTEUv24=";
};

pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
hash = "sha256-Xr9tRiP1hW+aFs9FnPvPkeJ0/LtJI57cjWY5bZQaRTQ=";
};

nativeBuildInputs = [
nodejs_22
pnpm.configHook
makeWrapper
];

buildPhase = ''
runHook preBuild
pnpm build
sed s+%out%+$out+ ${./porn-vault.sh} > ./porn-vault.sh
sed s+%nodejs%+${nodejs_22}+ -i ./porn-vault.sh
sed s+%izzy%+${izzy}+ -i ./porn-vault.sh
runHook postBuild
'';

installPhase = ''
runHook preInstall
install -Dm755 porn-vault.sh "$out/bin/porn-vault"
install -Dm644 package.json "$out/share/porn-vault/package.json"
install -Dm644 config.example.json "$out/share/porn-vault/config.example.json"
cp -R graphql "$out/share/porn-vault/graphql"
cp -R locale "$out/share/porn-vault/locale"
install -Dm644 remix.config.js "$out/share/porn-vault/remix.config.js"
cp -R public "$out/share/porn-vault/public"
cp -R dist "$out/share/porn-vault/dist"
cp -R build "$out/share/porn-vault/build"
cp -R node_modules "$out/share/porn-vault/node_modules"
install -Dm111 ${izzy}/bin/izzy "$out/share/porn-vault/izzy"
runHook postInstall
'';

postFixup = ''
wrapProgram "$out/bin/porn-vault" \
--prefix PATH : "${izzy}/bin:${ffmpeg}/bin:${imagemagick}/bin"
'';

runScript = writeShellScript "porn-vault.sh" ''
exec $out/bin/porn-vault
'';

meta = {
description = "Porn-Vault is a self hosted organizer for adult videos and imagery.";
homepage = "https://gitlab.com/porn-vault/porn-vault";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ luNeder ];
platforms = lib.platforms.all;
mainProgram = "porn-vault";
};
})
7 changes: 7 additions & 0 deletions pkgs/by-name/po/porn-vault/porn-vault.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
cd $(mktemp -d)
for i in %out%/share/porn-vault/*; do
ln -s $i .
done
[[ -z "${PV_CONFIG_FOLDER}" ]] || install -Dm111 %izzy%/bin/izzy $PV_CONFIG_FOLDER/izzy
exec %nodejs%/bin/node ./dist/index.js

0 comments on commit 760d8cd

Please sign in to comment.