From b96b4fce078dc90ee59ae5a75cf0c13cbc278fb0 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Dec 2020 09:47:57 +0100 Subject: puyak.r: use brockman for news --- krebs/3modules/brockman.nix | 30 ++++++++++++++++++++++++++++++ krebs/3modules/default.nix | 1 + 2 files changed, 31 insertions(+) create mode 100644 krebs/3modules/brockman.nix (limited to 'krebs/3modules') diff --git a/krebs/3modules/brockman.nix b/krebs/3modules/brockman.nix new file mode 100644 index 00000000..21cc1420 --- /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 bd6bab37..2a74adac 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 -- cgit v1.2.3