From 2e4e1472df72e5a02c8927359e554bd0425dd562 Mon Sep 17 00:00:00 2001 From: Defelo Date: Tue, 8 Apr 2025 10:56:32 +0200 Subject: [PATCH] synapse-admin-etkecc: init at 0.10.3-etke39 --- .../sy/synapse-admin-etkecc/package.nix | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 pkgs/by-name/sy/synapse-admin-etkecc/package.nix diff --git a/pkgs/by-name/sy/synapse-admin-etkecc/package.nix b/pkgs/by-name/sy/synapse-admin-etkecc/package.nix new file mode 100644 index 000000000000..8f445e0000f0 --- /dev/null +++ b/pkgs/by-name/sy/synapse-admin-etkecc/package.nix @@ -0,0 +1,79 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchYarnDeps, + yarnConfigHook, + yarnBuildHook, + nodejs, + nix-update-script, + writers, + baseUrl ? null, +}: + +assert lib.asserts.assertMsg ( + baseUrl == null +) "The baseUrl parameter is deprecated, please use .withConfig instead"; + +stdenv.mkDerivation (finalAttrs: { + pname = "synapse-admin-etkecc"; + version = "0.10.3-etke39"; + + src = fetchFromGitHub { + owner = "etkecc"; + repo = "synapse-admin"; + tag = "v${finalAttrs.version}"; + hash = "sha256-1jE4QrHAnH27FrfpgM8rKd4I2AAJArtL0jgcWVc8TrU="; + }; + + yarnOfflineCache = fetchYarnDeps { + yarnLock = finalAttrs.src + "/yarn.lock"; + hash = "sha256-60rS/OfPEQmmZ5j7mUjMPyK9prgNOX7MkYpu9djdjxQ="; + }; + + nativeBuildInputs = [ + nodejs + yarnConfigHook + yarnBuildHook + ]; + + env = { + NODE_ENV = "production"; + SYNAPSE_ADMIN_VERSION = finalAttrs.version; + }; + + installPhase = '' + runHook preInstall + cp -r dist $out + runHook postInstall + ''; + + passthru = { + # https://github.com/etkecc/synapse-admin/blob/main/docs/config.md + withConfig = + config: + stdenv.mkDerivation { + inherit (finalAttrs) version meta; + pname = "synapse-admin-etkecc-with-config"; + dontUnpack = true; + configFile = writers.writeJSON "synapse-admin-config" config; + installPhase = '' + runHook preInstall + cp -r ${finalAttrs.finalPackage} $out + chmod -R +w $out + cp $configFile $out/config.json + runHook postInstall + ''; + }; + + updateScript = nix-update-script { }; + }; + + meta = { + description = "Maintained fork of the admin console for (Matrix) Synapse homeservers, including additional features"; + homepage = "https://github.com/etkecc/synapse-admin"; + changelog = "https://github.com/etkecc/synapse-admin/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ defelo ]; + }; +})