summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-12-30 09:47:57 +0100
committerlassulus <lassulus@lassul.us>2020-12-30 09:47:57 +0100
commitb96b4fce078dc90ee59ae5a75cf0c13cbc278fb0 (patch)
tree49bdd3d8cfef5763b10cff7605653e0b575a8acb /krebs/3modules
parenta180af5b08160f50300769062c120edab3372d81 (diff)
puyak.r: use brockman for news
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/brockman.nix30
-rw-r--r--krebs/3modules/default.nix1
2 files changed, 31 insertions, 0 deletions
diff --git a/krebs/3modules/brockman.nix b/krebs/3modules/brockman.nix
new file mode 100644
index 000000000..21cc14202
--- /dev/null
+++ b/krebs/3modules/brockman.nix
@@ -0,0 +1,30 @@
+{ pkgs, lib, config, ... }:
+with lib;
+let
+ cfg = config.krebs.brockman;
+in {
+ options.krebs.brockman = {
+ enable = mkEnableOption "brockman";
+ config = mkOption { type = types.attrs; }; # TODO make real config here
+ };
+
+ config = mkIf cfg.enable {
+ users.extraUsers.brockman.isNormalUser = false;
+
+ systemd.services.brockman = {
+ description = "RSS to IRC broadcaster";
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network-online.target" ];
+ serviceConfig = {
+ Restart = "always";
+ ExecStart = ''
+ ${pkgs.brockman}/bin/brockman ${pkgs.writeText "brockman.json" (builtins.toJSON cfg.config)}
+ '';
+ User = config.users.extraUsers.brockman.name;
+ PrivateTmp = true;
+ RuntimeDirectory = "brockman";
+ WorkingDirectory = "%t/brockman";
+ };
+ };
+ };
+}
diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix
index bd6bab376..2a74adac3 100644
--- a/krebs/3modules/default.nix
+++ b/krebs/3modules/default.nix
@@ -11,6 +11,7 @@ let
./apt-cacher-ng.nix
./backup.nix
./bepasty-server.nix
+ ./brockman.nix
./buildbot/master.nix
./buildbot/slave.nix
./build.nix