2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, deno
|
|
|
|
, makeWrapper
|
2024-09-19 14:19:46 +00:00
|
|
|
, nixosTests
|
2024-04-21 15:54:59 +00:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "silverbullet";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.9.4";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/silverbulletmd/silverbullet/releases/download/${finalAttrs.version}/silverbullet.js";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-J0fy1e/ObpujBNSRKA55oU30kXNfus+5P2ebggEN6Dw=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/{bin,lib}
|
|
|
|
cp $src $out/lib/silverbullet.js
|
|
|
|
makeWrapper ${lib.getExe deno} $out/bin/silverbullet \
|
|
|
|
--set DENO_NO_UPDATE_CHECK "1" \
|
|
|
|
--add-flags "run -A --unstable-kv --unstable-worker-options ${placeholder "out"}/lib/silverbullet.js"
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) silverbullet;
|
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/silverbulletmd/silverbullet/blob/${finalAttrs.version}/website/CHANGELOG.md";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Open-source, self-hosted, offline-capable Personal Knowledge Management (PKM) web application";
|
2024-04-21 15:54:59 +00:00
|
|
|
homepage = "https://silverbullet.md";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ aorith ];
|
|
|
|
mainProgram = "silverbullet";
|
|
|
|
inherit (deno.meta) platforms;
|
|
|
|
};
|
|
|
|
})
|