diff options
author | makefu <github@syntax-fehler.de> | 2021-09-01 13:35:05 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2021-09-01 13:35:05 +0200 |
commit | 5c570ab3fc90ca689a9f01c0bffd2470130738ba (patch) | |
tree | a502e33b98d047ac2d2948fa82a0d6368ede646c /makefu | |
parent | e6884999a9a002c20ab854aa14c428792ab72b21 (diff) |
ma nix-community: add mediawiki-matrix-bot
Diffstat (limited to 'makefu')
-rw-r--r-- | makefu/1systems/gum/config.nix | 3 | ||||
-rw-r--r-- | makefu/2configs/nix-community/mediawiki-matrix-bot.nix | 23 | ||||
-rw-r--r-- | makefu/5pkgs/custom/mediawiki-matrix-bot/default.nix (renamed from makefu/5pkgs/mediawiki-matrix-bot/default.nix) | 0 |
3 files changed, 25 insertions, 1 deletions
diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index 1cfa8e4a4..adf025fd3 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -23,6 +23,7 @@ in { } <stockholm/makefu/2configs/nur.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/cli.nix> # <stockholm/makefu/2configs/stats/client.nix> @@ -182,7 +183,7 @@ in { <stockholm/makefu/2configs/virtualisation/libvirt.nix> # krebs infrastructure services - <stockholm/makefu/2configs/stats/server.nix> + # <stockholm/makefu/2configs/stats/server.nix> ]; makefu.dl-dir = "/var/download"; diff --git a/makefu/2configs/nix-community/mediawiki-matrix-bot.nix b/makefu/2configs/nix-community/mediawiki-matrix-bot.nix new file mode 100644 index 000000000..6dff64121 --- /dev/null +++ b/makefu/2configs/nix-community/mediawiki-matrix-bot.nix @@ -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; + }; + }; +} diff --git a/makefu/5pkgs/mediawiki-matrix-bot/default.nix b/makefu/5pkgs/custom/mediawiki-matrix-bot/default.nix index 4a91a9161..4a91a9161 100644 --- a/makefu/5pkgs/mediawiki-matrix-bot/default.nix +++ b/makefu/5pkgs/custom/mediawiki-matrix-bot/default.nix |