silverbullet: 2.3.0 -> 2.4.1 (#480757)

This commit is contained in:
Peder Bergebakken Sundt
2026-01-24 19:09:21 +00:00
committed by GitHub
+41 -34
View File
@@ -1,45 +1,20 @@
{
autoPatchelfHook,
common-updater-scripts,
fetchzip,
lib,
nixosTests,
stdenv,
stdenvNoCC,
writeShellScript,
}:
let
platformMap = {
"x86_64-linux" = {
os = "linux";
arch = "x86_64";
hash = "sha256-IGks7vmJd/xuJzqhogR5aLVM6eUUe6bACe5VuAWJOWA=";
};
"aarch64-linux" = {
os = "linux";
arch = "aarch64";
hash = "sha256-brqotISLIwD1t/2E2oyI7HSkfPpVgUODaNZJcc9o6zI=";
};
"x86_64-darwin" = {
os = "darwin";
arch = "x86_64";
hash = "sha256-n8GN2ZmeYEpZ0DB7zwEkXnSUZkAySNAGVn5BLw46fZI=";
};
"aarch64-darwin" = {
os = "darwin";
arch = "aarch64";
hash = "sha256-BISrkxLuxlo7KQiW9cUipJpEhOm94gL3GvyivO6LaBU=";
};
};
platform = platformMap.${stdenvNoCC.hostPlatform.system};
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "silverbullet";
version = "2.3.0";
version = "2.4.1";
src = fetchzip {
url = "https://github.com/silverbulletmd/silverbullet/releases/download/${finalAttrs.version}/silverbullet-server-${platform.os}-${platform.arch}.zip";
hash = platform.hash;
stripRoot = false;
};
src =
finalAttrs.passthru.sources.${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
@@ -52,8 +27,40 @@ stdenvNoCC.mkDerivation (finalAttrs: {
runHook postInstall
'';
passthru.tests = {
inherit (nixosTests) silverbullet;
passthru = {
sources = {
"x86_64-linux" = fetchzip {
url = "https://github.com/silverbulletmd/silverbullet/releases/download/${finalAttrs.version}/silverbullet-server-linux-x86_64.zip";
hash = "sha256-1jUN22T7BABBEiXp1LwMUaw/ELR7CZS2iKLaoiYKeLk=";
stripRoot = false;
};
"aarch64-linux" = fetchzip {
url = "https://github.com/silverbulletmd/silverbullet/releases/download/${finalAttrs.version}/silverbullet-server-linux-aarch64.zip";
hash = "sha256-F0CTVbVK2xaqNlHX1If8EhlDRqb+XIZlWmzkEYFGS3M=";
stripRoot = false;
};
"x86_64-darwin" = fetchzip {
url = "https://github.com/silverbulletmd/silverbullet/releases/download/${finalAttrs.version}/silverbullet-server-darwin-x86_64.zip";
hash = "sha256-lWUTNGt5u7q5cs7xoNP/k7GYUq/A3xHI6rza8HYOK5Y=";
stripRoot = false;
};
"aarch64-darwin" = fetchzip {
url = "https://github.com/silverbulletmd/silverbullet/releases/download/${finalAttrs.version}/silverbullet-server-darwin-aarch64.zip";
hash = "sha256-1lPGipv6jW0Awjy7V9HORK5oh5RDpBBrT4zZk0oSVWY=";
stripRoot = false;
};
};
updateScript = writeShellScript "update-silverbullet" ''
NEW_VERSION="$1"
for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do
${lib.getExe' common-updater-scripts "update-source-version"} "silverbullet" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform"
done
'';
tests = {
inherit (nixosTests) silverbullet;
};
};
meta = {
@@ -63,6 +70,6 @@ stdenvNoCC.mkDerivation (finalAttrs: {
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ aorith ];
mainProgram = "silverbullet";
platforms = builtins.attrNames platformMap;
platforms = builtins.attrNames finalAttrs.passthru.sources;
};
})