docspell/nix/pkg.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.5 KiB
Nix
Raw Normal View History

2024-03-09 00:28:44 +00:00
{
stdenv,
bash,
fetchzip,
jdk17,
}: let
version = "0.41.0";
server = {
url = "https://github.com/eikek/docspell/releases/download/v${version}/docspell-restserver-${version}.zip";
sha256 = "sha256-JFftIzI94UNLLh96I++qFsBZhOkquPIPhNhtS2Ov8wI=";
};
joex = {
url = "https://github.com/eikek/docspell/releases/download/v${version}/docspell-joex-${version}.zip";
sha256 = "sha256-flKWjEsMd2/XT3Bu6EjFgf3lCojvLbKFDEXemP1K+/8=";
};
in {
docspell-restserver = stdenv.mkDerivation {
2024-03-09 00:28:44 +00:00
inherit version;
pname = "docspell-restserver";
2024-03-09 00:28:44 +00:00
src = fetchzip server;
buildInputs = [jdk17];
buildPhase = "true";
installPhase = ''
mkdir -p $out/{bin,docspell-restserver-${version}}
cp -R * $out/docspell-restserver-${version}/
cat > $out/bin/docspell-restserver <<-EOF
#!${bash}/bin/bash
$out/docspell-restserver-${version}/bin/docspell-restserver -java-home ${jdk17} "\$@"
EOF
chmod 755 $out/bin/docspell-restserver
2024-03-09 00:28:44 +00:00
'';
};
docspell-joex = stdenv.mkDerivation rec {
inherit version;
pname = "docspell-joex";
src = fetchzip joex;
buildInputs = [jdk17];
buildPhase = "true";
installPhase = ''
mkdir -p $out/{bin,docspell-joex-${version}}
cp -R * $out/docspell-joex-${version}/
cat > $out/bin/docspell-joex <<-EOF
#!${bash}/bin/bash
$out/docspell-joex-${version}/bin/docspell-joex -java-home ${jdk17} "\$@"
EOF
chmod 755 $out/bin/docspell-joex
'';
};
}