lol

matterbridge, modules/matterbridge: init at 1.1.0

+119
+1
nixos/modules/module-list.nix
··· 458 458 ./services/networking/lldpd.nix 459 459 ./services/networking/logmein-hamachi.nix 460 460 ./services/networking/mailpile.nix 461 + ./services/networking/matterbridge.nix 461 462 ./services/networking/mjpg-streamer.nix 462 463 ./services/networking/minidlna.nix 463 464 ./services/networking/miniupnpd.nix
+96
nixos/modules/services/networking/matterbridge.nix
··· 1 + { config, pkgs, lib, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + 7 + cfg = config.services.matterbridge; 8 + 9 + matterbridgeConfToml = pkgs.writeText "matterbridge.toml" (cfg.configFile); 10 + 11 + in 12 + 13 + { 14 + options = { 15 + services.matterbridge = { 16 + enable = mkEnableOption "Matterbridge chat platform bridge"; 17 + 18 + configFile = mkOption { 19 + type = types.str; 20 + example = '' 21 + #WARNING: as this file contains credentials, be sure to set correct file permissions [irc] 22 + [irc.freenode] 23 + Server="irc.freenode.net:6667" 24 + Nick="matterbot" 25 + 26 + [mattermost] 27 + [mattermost.work] 28 + #do not prefix it wit http:// or https:// 29 + Server="yourmattermostserver.domain" 30 + Team="yourteam" 31 + Login="yourlogin" 32 + Password="yourpass" 33 + PrefixMessagesWithNick=true 34 + 35 + [[gateway]] 36 + name="gateway1" 37 + enable=true 38 + [[gateway.inout]] 39 + account="irc.freenode" 40 + channel="#testing" 41 + 42 + [[gateway.inout]] 43 + account="mattermost.work" 44 + channel="off-topic" 45 + ''; 46 + description = '' 47 + The matterbridge configuration file in the TOML file format. 48 + ''; 49 + }; 50 + user = mkOption { 51 + type = types.str; 52 + default = "matterbridge"; 53 + description = '' 54 + User which runs the matterbridge service. 55 + ''; 56 + }; 57 + 58 + group = mkOption { 59 + type = types.str; 60 + default = "matterbridge"; 61 + description = '' 62 + Group which runs the matterbridge service. 63 + ''; 64 + }; 65 + }; 66 + }; 67 + 68 + config = mkMerge [ 69 + (mkIf cfg.enable { 70 + 71 + users.extraUsers = mkIf (cfg.user == "matterbridge") [ 72 + { name = "matterbridge"; 73 + group = "matterbridge"; 74 + } ]; 75 + 76 + users.extraGroups = mkIf (cfg.group == "matterbridge") [ 77 + { name = "matterbridge"; 78 + } ]; 79 + 80 + systemd.services.matterbridge = { 81 + description = "Matterbridge chat platform bridge"; 82 + wantedBy = [ "multi-user.target" ]; 83 + after = [ "network.target" ]; 84 + 85 + serviceConfig = { 86 + User = cfg.user; 87 + Group = cfg.group; 88 + ExecStart = "${pkgs.matterbridge.bin}/bin/matterbridge -conf ${matterbridgeConfToml}"; 89 + Restart = "always"; 90 + RestartSec = "10"; 91 + }; 92 + }; 93 + }) 94 + ]; 95 + } 96 +
+21
pkgs/servers/matterbridge/default.nix
··· 1 + { stdenv, buildGoPackage, fetchurl }: 2 + 3 + buildGoPackage rec { 4 + name = "matterbridge-${version}"; 5 + version = "1.1.0"; 6 + 7 + goPackagePath = "github.com/42wim/matterbridge"; 8 + 9 + src = fetchurl { 10 + url = "https://github.com/42wim/matterbridge/archive/v${version}.tar.gz"; 11 + sha256 = "0nn3929wyjdpkk8azp6wd6mkcg8h0jb1fjxm6jmb74xvdknrzv3k"; 12 + }; 13 + 14 + meta = with stdenv.lib; { 15 + description = "Simple bridge between Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, Rocket.Chat, Hipchat(via xmpp), Matrix and Steam"; 16 + homepage = https://github.com/42wim/matterbridge; 17 + license = with licenses; [ asl20 ]; 18 + maintainers = with maintainers; [ ryantm ]; 19 + platforms = platforms.unix; 20 + }; 21 + }
+1
pkgs/top-level/all-packages.nix
··· 11335 11335 11336 11336 mattermost = callPackage ../servers/mattermost { }; 11337 11337 matterircd = callPackage ../servers/mattermost/matterircd.nix { }; 11338 + matterbridge = callPackage ../servers/matterbridge { }; 11338 11339 11339 11340 mediatomb = callPackage ../servers/mediatomb { }; 11340 11341