summaryrefslogtreecommitdiffstats
path: root/makefu
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-09-05 18:39:30 +0200
committerlassulus <lassulus@lassul.us>2021-09-05 18:39:30 +0200
commita6d7d60d6f7abfba2d5d6df7f31d64feb0dbd418 (patch)
treebaecd8d13bb300173e26fbdeb46de941d6c3aa2d /makefu
parente3e859c14eb34bc045544ff64c3340b9f4dbe1f0 (diff)
parentee66b2f02d455060267f8f59c1fea97b8310668d (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu')
-rw-r--r--makefu/1systems/gum/config.nix3
-rw-r--r--makefu/2configs/nix-community/mediawiki-matrix-bot.nix23
-rw-r--r--makefu/2configs/tools/dev.nix1
-rw-r--r--makefu/5pkgs/custom/mediawiki-matrix-bot/default.nix22
4 files changed, 48 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/2configs/tools/dev.nix b/makefu/2configs/tools/dev.nix
index ac6d91e85..36f867559 100644
--- a/makefu/2configs/tools/dev.nix
+++ b/makefu/2configs/tools/dev.nix
@@ -33,6 +33,7 @@
cac-api
cac-panel
krebszones
+ cyberlocker-tools
ovh-zone
gen-oath-safe
cdrtools
diff --git a/makefu/5pkgs/custom/mediawiki-matrix-bot/default.nix b/makefu/5pkgs/custom/mediawiki-matrix-bot/default.nix
new file mode 100644
index 000000000..4a91a9161
--- /dev/null
+++ b/makefu/5pkgs/custom/mediawiki-matrix-bot/default.nix
@@ -0,0 +1,22 @@
+{ buildPythonApplication, fetchFromGitHub, feedparser, matrix-nio, docopt, aiohttp, aiofiles,
+mypy }:
+
+buildPythonApplication rec {
+ pname = "mediawiki-matrix-bot";
+ version = "1.0.0";
+ src = fetchFromGitHub {
+ owner = "nix-community";
+ repo = "mediawiki-matrix-bot";
+ rev = "v${version}";
+ sha256 = "1923097j1xh34jmm0zhmvma614jcxaagj89c1fc1j2qyv14ybsvs";
+ };
+ propagatedBuildInputs = [
+ feedparser matrix-nio docopt aiohttp aiofiles
+ ];
+ nativeBuildInputs = [
+ mypy
+ ];
+ checkPhase = ''
+ mypy --strict mediawiki_matrix_bot
+ '';
+}