This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
nix-packages/matrix/mautrix-discord/default.nix

35 lines
980 B
Nix
Raw Normal View History

2022-07-20 08:36:55 +00:00
{
2022-09-25 19:06:33 +00:00
buildGoModule,
olm,
fetchFromGitHub,
lib,
writeScript,
}: let
source = builtins.fromJSON (builtins.readFile ./source.json);
in
buildGoModule rec {
2022-07-20 08:36:55 +00:00
pname = "mautrix-discord";
2022-09-25 19:06:33 +00:00
version = source.date;
src = fetchFromGitHub {
owner = "mautrix";
repo = "discord";
inherit (source) rev sha256;
};
2022-08-24 00:32:17 +00:00
patches = [./sticker.patch];
2022-09-25 19:06:33 +00:00
vendorSha256 = builtins.readFile ./vendor.sha256;
buildInputs = [
olm
];
2022-07-20 08:36:55 +00:00
proxyVendor = true;
CGO_ENABLED = "1";
2022-09-25 19:06:33 +00:00
meta = {
description = "Discord-Matrix double-puppeting bridge";
license = lib.licenses.agpl3;
};
passthru.updateScript = writeScript "update-matrix-media-repo" ''
${../../scripts/update-git.sh} "https://github.com/mautrix/discord" matrix/mautrix-discord/source.json
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./matrix/mautrix-discord matrix/mautrix-discord/vendor.sha256
'';
}