Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
100 lines
2.2 KiB
Nix
100 lines
2.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
runCommand,
|
|
buildNpmPackage,
|
|
nodejs,
|
|
ffmpeg-full,
|
|
nunicode,
|
|
util-linux,
|
|
python3,
|
|
getopt,
|
|
nixosTests,
|
|
}:
|
|
|
|
let
|
|
source = {
|
|
version = "2.29.0";
|
|
hash = "sha256-Vewznln5Ny8SWfOfyusnDcO9CsTwWrOTP+W8ynnSdR0=";
|
|
npmDepsHash = "sha256-zk2Xw3lpy/ZBZZKSsMgdIHrKGB7yl9GYtewn9ME1guc=";
|
|
clientNpmDepsHash = "sha256-mDS/onnotiBTFihoSMSccF/mrdTduZj5DZfQpyzMoDY=";
|
|
};
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "advplyr";
|
|
repo = "audiobookshelf";
|
|
tag = "v${source.version}";
|
|
inherit (source) hash;
|
|
};
|
|
|
|
client = buildNpmPackage {
|
|
pname = "audiobookshelf-client";
|
|
inherit (source) version;
|
|
|
|
src = runCommand "cp-source" { } ''
|
|
cp -r ${src}/client $out
|
|
'';
|
|
|
|
# don't download the Cypress binary
|
|
CYPRESS_INSTALL_BINARY = 0;
|
|
NODE_OPTIONS = "--openssl-legacy-provider";
|
|
|
|
npmBuildScript = "generate";
|
|
npmDepsHash = source.clientNpmDepsHash;
|
|
};
|
|
|
|
wrapper = import ./wrapper.nix {
|
|
inherit
|
|
stdenv
|
|
ffmpeg-full
|
|
nunicode
|
|
getopt
|
|
;
|
|
};
|
|
|
|
in
|
|
buildNpmPackage {
|
|
pname = "audiobookshelf";
|
|
|
|
inherit src;
|
|
inherit (source) npmDepsHash version;
|
|
|
|
buildInputs = [ util-linux ];
|
|
nativeBuildInputs = [ python3 ];
|
|
|
|
dontNpmBuild = true;
|
|
npmInstallFlags = [ "--only-production" ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/opt/client
|
|
cp -r index.js server package* node_modules $out/opt/
|
|
cp -r ${client}/lib/node_modules/audiobookshelf-client/dist $out/opt/client/dist
|
|
mkdir $out/bin
|
|
|
|
echo '${wrapper}' > $out/bin/audiobookshelf
|
|
echo " exec ${nodejs}/bin/node $out/opt/index.js" >> $out/bin/audiobookshelf
|
|
|
|
chmod +x $out/bin/audiobookshelf
|
|
'';
|
|
|
|
passthru = {
|
|
tests.basic = nixosTests.audiobookshelf;
|
|
updateScript = ./update.sh;
|
|
};
|
|
|
|
meta = {
|
|
homepage = "https://www.audiobookshelf.org/";
|
|
description = "Self-hosted audiobook and podcast server";
|
|
changelog = "https://github.com/advplyr/audiobookshelf/releases/tag/v${source.version}";
|
|
license = lib.licenses.gpl3;
|
|
maintainers = with lib.maintainers; [
|
|
jvanbruegge
|
|
adamcstephens
|
|
tebriel
|
|
];
|
|
platforms = lib.platforms.linux;
|
|
mainProgram = "audiobookshelf";
|
|
};
|
|
}
|