add more matrix bridges through flake input

This commit is contained in:
Anish Lakhwara 2023-01-01 16:48:11 +10:00
parent a8b735e34d
commit 55aea142fe
5 changed files with 174 additions and 7 deletions

View file

@ -67,6 +67,21 @@
"type": "github"
}
},
"devshell": {
"locked": {
"lastModified": 1642188268,
"narHash": "sha256-DNz4xScpXIn7rSDohdayBpPR9H9OWCMDOgTYegX081k=",
"owner": "numtide",
"repo": "devshell",
"rev": "696acc29668b644df1740b69e1601119bf6da83b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"dirt-samples-src": {
"flake": false,
"locked": {
@ -140,6 +155,22 @@
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1641205782,
"narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1638122382,
@ -260,7 +291,59 @@
"type": "github"
}
},
"nix-matrix-appservices": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat_3",
"nixlib": "nixlib",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1663958238,
"narHash": "sha256-l4VrBCswq500YwsgjK7M8HUmnVWrHYY7DKZ7uZK5Abg=",
"owner": "coffeetables",
"repo": "nix-matrix-appservices",
"rev": "efdc09f26e3b01801edaa3b0e2bdd46d9d133bba",
"type": "gitlab"
},
"original": {
"owner": "coffeetables",
"repo": "nix-matrix-appservices",
"type": "gitlab"
}
},
"nixlib": {
"locked": {
"lastModified": 1643502816,
"narHash": "sha256-Wrbt6Gs+hjXD3HUICPBJHKnHEUqiyx8rzHCgvqC1Bok=",
"owner": "divnix",
"repo": "nixpkgs.lib",
"rev": "ebed7ec5bcb5d01e298535989c6c321df18b631a",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1662099760,
"narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "67e45078141102f45eff1589a831aeaa3182b41e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1670193339,
"narHash": "sha256-oHTAhX4p6+uxcabq0rKL4EyKWPbDLGKec88ocPIU/2Y=",
@ -276,7 +359,7 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1662446902,
"narHash": "sha256-Dmsd3jSG2ldZUlhFaIwunqgMf14EEK7ylXpw+OPDLxE=",
@ -308,15 +391,15 @@
},
"poonam": {
"inputs": {
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs_3",
"vimwiki-cli": "vimwiki-cli"
},
"locked": {
"lastModified": 1672200014,
"narHash": "sha256-gJW+GktGJAMmb5WRs2rcUQI673Jx148pWwwejJjIL04=",
"lastModified": 1672372801,
"narHash": "sha256-/Zqrr9zs8z7cpQOsO3VIxVMCV1lvDu/KfPski3q+lRs=",
"ref": "main",
"rev": "7143809a518037b4ad4ef0762a3e8f42cd99a790",
"revCount": 473,
"rev": "273db2bb490748ad07755421278acec1538b9e5c",
"revCount": 476,
"type": "git",
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
},
@ -335,7 +418,8 @@
"grasp": "grasp",
"hardware": "hardware",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nix-matrix-appservices": "nix-matrix-appservices",
"nixpkgs": "nixpkgs_2",
"nur": "nur",
"poonam": "poonam",
"rust-overlay": "rust-overlay",

View file

@ -24,6 +24,8 @@
basant.inputs.poonam.follows = "poonam";
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
grasp.inputs.nixpkgs.follows = "nixpkgs";
# Matrix
nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
# Others
nur.url = "github:nix-community/NUR";
rust-overlay = {
@ -55,6 +57,7 @@
, agenix
, basant
, grasp
, nix-matrix-appservices
, nur
, tidalcycles
, rust-overlay
@ -177,6 +180,7 @@
agenix.nixosModules.age
self.nixosModules.backup
self.nixosModules.hesienbridge
nix-matrix-appservices.nixosModule
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;

View file

@ -3,6 +3,7 @@
{
imports = [
./mautrix-telegram.nix
./mautrix-services.nix
# ./mautrix-discord.nix
# ./mautrix-whatsapp.nix
# ./mautrix-slack.nix

View file

@ -0,0 +1,49 @@
{ config, lib, pkgs, ... }:
{
# Mautrix-signal settings
services.signald.enable = true;
systemd.services.matrix-as-signal = {
requires = [ "signald.service" ];
after = [ "signald.service" ];
unitConfig = {
JoinsNamespaceOf = "signald.service";
};
path = [
pkgs.ffmpeg # voice messages need `ffmpeg`
];
};
services.matrix-appservices = {
addRegistrationFiles = false;
homeserverURL = "https://sealight.xyz/";
homeserverDomain = "sealight.xyz";
services = {
whatsapp = {
port = 29183;
format = "mautrix-go";
package = pkgs.mautrix-whatsapp;
};
discord = {
port = 29188;
format = "mautrix-go";
package = pkgs.mautrix-discord;
};
signal = {
port = 29184;
format = "mautrix-python";
package = pkgs.mautrix-signal;
serviceConfig = {
StateDirectory = [ "matrix-as-signal" "signald" ];
SupplementaryGroups = [ "signald" ];
};
settings.signal = {
socket_path = config.services.signald.socketPath;
outgoing_attachment_dir = "/var/lib/signald/tmp";
};
};
};
};
}

29
pkgs/mautrix-discord.nix Normal file
View file

@ -0,0 +1,29 @@
{ lib, buildGoModule, fetchFromGitHub, olm }:
buildGoModule rec {
pname = "mautrix-discord";
version = "unstable-2022-11-04";
src = fetchFromGitHub {
owner = "mautrix";
repo = "discord";
rev = "f53975cc91e3c643a722adf0d3e0dfb98d0127a2";
hash = "sha256-xUALcN5oQfwC6gmOeygCkOAXJrJzNitBxHRFAKKgFvE=";
};
buildInputs = [ olm ];
vendorHash = "sha256-yday2mSnPwuhXWkCG4XY7qoBl3DXHcSvzBoZbjgYz/c=";
ldflags = [ "-s" "-w" ]; # https://github.com/NixOS/nixpkgs/issues/177698
doCheck = false; # No tests available
meta = with lib; {
homepage = "https://go.mau.fi/mautrix-discord";
description = "Matrix to Discord hybrid puppeting/relaybot bridge";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ robin ];
};
}