Files
nur/pkgs/common/sable/sable.nix
T

94 lines
2.4 KiB
Nix
Raw Normal View History

2026-05-21 08:41:07 -04:00
{
lib,
buildNpmPackage,
pnpm_10,
fetchPnpmDeps,
pnpmConfigHook,
nodejs_24,
fetchFromGitHub,
}:
2026-09-06 16:15:49 -04:00
buildNpmPackage (
finalAttrs:
let
pnpm = pnpm_10.override {
2026-09-19 12:11:18 -04:00
nodejs-slim = nodejs_24;
2026-09-06 16:15:49 -04:00
};
matrixrtcSrc = fetchFromGitHub {
owner = "SableClient";
repo = "matrix-rtc";
rev = "519fe6b863cfac78700f4e2b1748649103bb8a8d";
hash = "sha256-n5f7529RdRxY8/a43Xkgrhg4yRz5aNgfoZqWrB7kvak=";
};
livekitMobileSrc = fetchFromGitHub {
owner = "SableClient";
repo = "tauri-plugin-livekit-mobile";
rev = "c6f0d02ab3da1174535bc1dc8e598a2e6873f977";
hash = "sha256-ZPx6Ic+Gkvzg9LXYP9BaQALzOrvLCcQHOms8U3VfnU0=";
};
in
{
pname = "sable-unwrapped";
2026-09-20 19:34:58 -04:00
version = "1.22.6";
2026-09-06 16:15:49 -04:00
src = fetchFromGitHub {
owner = "SableClient";
repo = "Sable";
tag = "v${finalAttrs.version}";
2026-09-20 19:34:58 -04:00
hash = "sha256-AZ2gKcCLJvllC/lOL+l/zt3/RxztWd8mu25Eo0vyMBY=";
2026-09-06 16:15:49 -04:00
};
2026-05-21 08:41:07 -04:00
nodejs = nodejs_24;
2026-09-06 16:15:49 -04:00
nativeBuildInputs = [ pnpm ];
npmConfigHook = pnpmConfigHook;
2026-05-21 08:41:07 -04:00
2026-09-06 16:15:49 -04:00
npmDeps = finalAttrs.pnpmDeps;
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
inherit pnpm;
fetcherVersion = 3;
2026-09-19 12:11:18 -04:00
hash = "sha256-sI0tE73l+yKS8186tUHrNAJmGD26XEe7828ohvvc+1o=";
2026-09-06 16:15:49 -04:00
};
2026-05-21 08:41:07 -04:00
2026-09-06 16:15:49 -04:00
npmInstallFlags = [
"--ignore-scripts"
2026-05-21 08:41:07 -04:00
];
2026-09-06 16:15:49 -04:00
preBuild = ''
cp -r --no-preserve=mode ${matrixrtcSrc}/. node_modules/@sableclient/matrixrtc/
2026-09-19 12:11:18 -04:00
pnpm exec tsc \
-p node_modules/@sableclient/matrixrtc/tsconfig.build.json \
--rootDir node_modules/@sableclient/matrixrtc/src
2026-09-06 16:15:49 -04:00
cp -r --no-preserve=mode ${livekitMobileSrc}/. node_modules/@sableclient/tauri-plugin-livekit-mobile/
pnpm exec tsc \
-p node_modules/@sableclient/tauri-plugin-livekit-mobile/tsconfig.json \
--noEmit false \
--declaration \
--rootDir node_modules/@sableclient/tauri-plugin-livekit-mobile/guest-js \
--outDir node_modules/@sableclient/tauri-plugin-livekit-mobile/dist-js
'';
2026-09-20 19:34:58 -04:00
patches = [
./0001-races-patch.patch
];
2026-09-06 16:15:49 -04:00
installPhase = ''
runHook preInstall
cp -r dist $out
runHook postInstall
'';
meta = {
description = "An almost stable Matrix client";
homepage = "https://app.sable.moe/";
maintainers = with lib.maintainers; [
2026-09-19 12:11:18 -04:00
(wymillerlinux or) "wymillerlinux"
2026-09-06 16:15:49 -04:00
];
license = lib.licenses.agpl3Only;
platforms = lib.platforms.all;
};
}
)