ma nix-community: add mediawiki-matrix-bot

This commit is contained in:
makefu 2021-09-01 13:35:05 +02:00
parent e6884999a9
commit 5c570ab3fc
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
3 changed files with 25 additions and 1 deletions

View File

@ -23,6 +23,7 @@ in {
} }
<stockholm/makefu/2configs/nur.nix> <stockholm/makefu/2configs/nur.nix>
<stockholm/makefu/2configs/support-nixos.nix> <stockholm/makefu/2configs/support-nixos.nix>
<stockholm/makefu/2configs/nix-community/mediawiki-matrix-bot.nix>
<stockholm/makefu/2configs/home-manager> <stockholm/makefu/2configs/home-manager>
<stockholm/makefu/2configs/home-manager/cli.nix> <stockholm/makefu/2configs/home-manager/cli.nix>
# <stockholm/makefu/2configs/stats/client.nix> # <stockholm/makefu/2configs/stats/client.nix>
@ -182,7 +183,7 @@ in {
<stockholm/makefu/2configs/virtualisation/libvirt.nix> <stockholm/makefu/2configs/virtualisation/libvirt.nix>
# krebs infrastructure services # krebs infrastructure services
<stockholm/makefu/2configs/stats/server.nix> # <stockholm/makefu/2configs/stats/server.nix>
]; ];
makefu.dl-dir = "/var/download"; makefu.dl-dir = "/var/download";

View File

@ -0,0 +1,23 @@
{ pkgs, ... }:
let
seccfg = toString <secrets/mediawikibot-config.json>;
statecfg = "/var/lib/mediawiki-matrix-bot/config.json";
in {
systemd.services.mediawiki-matrix-bot = {
description = "Mediawiki Matrix Bot";
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Restart = "always";
RestartSec = "60s";
DynamicUser = true;
StateDirectory = "mediawiki-matrix-bot";
PermissionsStartOnly = true;
ExecStartPre = pkgs.writeDash "mediawikibot-copy-config" ''
install -D -m644 ${seccfg} ${statecfg}
'';
ExecStart = "${pkgs.mediawiki-matrix-bot}/bin/mediawiki-matrix-bot ${statecfg}";
PrivateTmp = true;
};
};
}