summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/lass/default.nix32
-rw-r--r--krebs/3modules/newsbot-js.nix135
2 files changed, 104 insertions, 63 deletions
diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix
index 257268af..4e2d6df9 100644
--- a/krebs/3modules/lass/default.nix
+++ b/krebs/3modules/lass/default.nix
@@ -321,6 +321,34 @@ with import <stockholm/lib>;
};
};
};
+ turingmachine = {
+ ci = false;
+ external = true;
+ nets = {
+ retiolum = {
+ ip4.addr = "10.243.29.168";
+ ip6.addr = "42:4992:6a6d:600::1";
+ aliases = [
+ "turingmachine.r"
+ ];
+ tinc.pubkey = ''
+ -----BEGIN RSA PUBLIC KEY-----
+ MIICCgKCAgEAxh+5HD1oAFTvMWEra2pYrA3HF8T4EnkP917lIUiuN7xUj7sawu0C
+ t1/1IfIlH9dbxgFe5CD/gXvokxHdovPTGVH11L+thZgq6hg/xbYvZAl76yLxj7t9
+ 6+Ocac08TQZYMqWKShz5jqTVE/DLz4Cdy0Qk9sMJ1++OmH8jsWgK5BkogF99Gwf8
+ ZiI0t3n3lCZsm3v592lveDcVIh6hjuCIvFVxc+7cOj0MKm1LxLWbCHZlUIE3he4g
+ nZu4XiYaE4Y2LicMs8zKehnQkkXrP1amT56SqUfbSnWR+HZc2+KjwRDI5BPeTS06
+ 5WHwkQs0ScOn7vFZci3rElIc7vilu2eKGF1VLce9kXw9SU2RFciqavaEUXbwPnwT
+ 1WF35Ct+qIOP0rXoObm6mrsj7hJnlBPlVpb58/kTxLHMSHPzqQRbFZ35f6tZodJ1
+ gRMKKEnMX8/VWm6TqLUIpFCCTZ5PH1fxaAnulHCxksK03UyfUOvExCTU4x8KS9fl
+ DIoLlV9PFBlAW8mTuIgRKYtHacsc31/5Tehcx0If09NuMFT9Qfl2/Q3p6QJomRFL
+ W5SCP9wx2ONhvZUkRbeihBiTN5/h3DepjOeNWd1DvE6K0Ag8SXMyBGtyKfer4ykW
+ OR0iCiRQQ5QBmNuJrBLRUyfoPqFUXBATT1SrRj8vzXO1TjTmANEMFD0CAwEAAQ==
+ -----END RSA PUBLIC KEY-----
+ '';
+ };
+ };
+ };
};
users = {
lass = {
@@ -357,5 +385,9 @@ with import <stockholm/lib>;
wine-mors = {
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEKfTIKmbe1RjX1fjAn//08363zAsI0CijWnaYyAC842";
};
+ Mic92 = {
+ pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbBp2dH2X3dcU1zh+xW3ZsdYROKpJd3n13ssOP092qE";
+ mail = "joerg@higgsboson.tk";
+ };
};
}
diff --git a/krebs/3modules/newsbot-js.nix b/krebs/3modules/newsbot-js.nix
index dd3e5647..d372081e 100644
--- a/krebs/3modules/newsbot-js.nix
+++ b/krebs/3modules/newsbot-js.nix
@@ -6,51 +6,59 @@ let
cfg = config.krebs.newsbot-js;
+ enable = cfg != {};
+
out = {
options.krebs.newsbot-js = api;
- config = mkIf cfg.enable imp;
+ config = mkIf enable imp;
};
- api = {
- enable = mkEnableOption "Enable krebs newsbot";
- package = mkOption {
- type = types.package;
- default = pkgs.newsbot-js;
- description = "newsbot package to use";
- };
- ircServer = mkOption {
- type = types.str;
- default = "echelon.retiolum";
- description = "to which server the bot should connect";
- };
- channel = mkOption {
- type = types.str;
- default = "#news";
- description = "post the news in this channel";
- };
- masterNick = mkOption {
- type = types.str;
- default = "knews";
- description = "nickname of the master bot";
- };
- feeds = mkOption {
- type = types.path;
- description = ''
- file with feeds to post
- format:
- $nick|$feedURI
- '';
- };
- urlShortenerHost = mkOption {
- type = types.str;
- default = "echelon";
- 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";
- };
+ 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";
+ 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 = {
@@ -61,32 +69,33 @@ let
home = "/var/empty";
};
- systemd.services.newsbot-js = {
- description = "krebs newsbot";
- after = [ "network.target" ];
- wantedBy = [ "multi-user.target" ];
+ systemd.services = mapAttrs' (name: newsbot:
+ nameValuePair "newsbot-${name}" {
+ after = [ "network.target" ];
+ wantedBy = [ "multi-user.target" ];
- path = with pkgs; [
- newsbot-js
- ];
+ path = with pkgs; [
+ newsbot-js
+ ];
- environment = {
- irc_server = cfg.ircServer;
- master_nick = cfg.masterNick;
- news_channel = cfg.channel;
- feeds_file = cfg.feeds;
- url_shortener_host = cfg.urlShortenerHost;
- url_shortener_port = cfg.urlShortenerPort;
- };
+ 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;
+ restartIfChanged = true;
- serviceConfig = {
- User = "newsbot-js";
- Restart = "always";
- ExecStart = "${cfg.package}/bin/newsbot";
- };
- };
+ serviceConfig = {
+ User = "newsbot-js";
+ Restart = "always";
+ ExecStart = "${newsbot.package}/bin/newsbot";
+ };
+ }
+ ) cfg;
};
in out