summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/newsbot-js.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-01-07 23:17:07 +0100
committerlassulus <lassulus@lassul.us>2021-01-07 23:17:07 +0100
commitdbb2024585e67c3ceaf968255263a0662c174c19 (patch)
treec9c352ad6c7cd6f78a9ba6eea88d7ac6799c92ae /krebs/3modules/newsbot-js.nix
parentfaefe4c3c83ab24fcdd86cdf11f634f7390de22c (diff)
newsbot-js: remove package and module
Diffstat (limited to 'krebs/3modules/newsbot-js.nix')
-rw-r--r--krebs/3modules/newsbot-js.nix102
1 files changed, 0 insertions, 102 deletions
diff --git a/krebs/3modules/newsbot-js.nix b/krebs/3modules/newsbot-js.nix
deleted file mode 100644
index a3640caa5..000000000
--- a/krebs/3modules/newsbot-js.nix
+++ /dev/null
@@ -1,102 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with import <stockholm/lib>;
-
-let
-
- cfg = config.krebs.newsbot-js;
-
- enable = cfg != {};
-
- out = {
- options.krebs.newsbot-js = api;
- config = mkIf enable imp;
- };
-
- api = mkOption {
- type = types.attrsOf (types.submodule ({ config, ... }: {
- options = {
- enable = mkEnableOption "Enable krebs newsbot" // { default = true; };
-
- channel = mkOption {
- type = types.str;
- default = "#${config._module.args.name}";
- description = "post the news in this channel";
- };
- feeds = mkOption {
- type = types.path;
- description = ''
- file with feeds to post
- format:
- $nick|$feedURI
- '';
- };
- ircServer = mkOption {
- type = types.str;
- default = "localhost";
- description = "to which server the bot should connect";
- };
- masterNick = mkOption {
- type = types.str;
- default = config._module.args.name;
- description = "nickname of the master bot";
- };
- package = mkOption {
- type = types.package;
- default = pkgs.newsbot-js;
- description = "newsbot package to use";
- };
- urlShortenerHost = mkOption {
- type = types.str;
- default = "go.r";
- description = "what server to use for url shortening, host";
- };
- urlShortenerPort = mkOption {
- type = types.str;
- default = "80";
- description = "what server to use for url shortening, port";
- };
- };
- }));
- default = {};
- };
-
- imp = {
- users.extraUsers.newsbot-js = {
- name = "newsbot-js";
- uid = genid "newsbot-js";
- description = "newsbot-js user";
- home = "/var/empty";
- };
-
- systemd.services = mapAttrs' (name: newsbot:
- nameValuePair "newsbot-${name}" {
- after = [ "network.target" ];
- wantedBy = [ "multi-user.target" ];
-
- path = with pkgs; [
- newsbot-js
- ];
-
- environment = {
- irc_server = newsbot.ircServer;
- master_nick = newsbot.masterNick;
- news_channel = newsbot.channel;
- feeds_file = newsbot.feeds;
- url_shortener_host = newsbot.urlShortenerHost;
- url_shortener_port = newsbot.urlShortenerPort;
- };
-
- restartIfChanged = true;
-
- serviceConfig = {
- User = "newsbot-js";
- Restart = "always";
- ExecStart = "${newsbot.package}/bin/newsbot";
- WatchdogSec = "86400";
- };
- }
- ) cfg;
- };
-
-in out