From f1298103173cf1953be0e7c359f10d18894ce770 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 21 Jan 2019 11:51:15 +0100 Subject: krebs hosts: extraHost -> hosts --- krebs/3modules/hosts.nix | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/hosts.nix b/krebs/3modules/hosts.nix index a95557b3..0985bb53 100644 --- a/krebs/3modules/hosts.nix +++ b/krebs/3modules/hosts.nix @@ -13,24 +13,23 @@ in { }; config = { - networking.extraHosts = - concatStringsSep - "\n" - (flatten - (mapAttrsToList - (hostname: host: - mapAttrsToList - (netname: net: let + networking.hosts = + filterAttrs + (_name: value: value != []) + (zipAttrsWith + (_: concatLists) + (concatMap + (host: + concatMap + (net: let aliases = longs ++ shorts; longs = filter check net.aliases; shorts = let s = ".${config.krebs.dns.search-domain}"; in map (removeSuffix s) (filter (hasSuffix s) longs); in - optionals - (aliases != []) - (map (addr: "${addr} ${toString aliases}") net.addrs)) - (filterAttrs (name: host: host.aliases != []) host.nets)) - config.krebs.hosts)); + map (addr: { ${addr} = aliases; }) net.addrs) + (attrValues host.nets)) + (attrValues config.krebs.hosts))); }; } -- cgit v1.2.3 From fabef3638584e88be50b10ec1cf3649b98752eac Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 21 Jan 2019 12:11:03 +0100 Subject: reaktor2 service: init --- krebs/3modules/reaktor2.nix | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 krebs/3modules/reaktor2.nix (limited to 'krebs/3modules') diff --git a/krebs/3modules/reaktor2.nix b/krebs/3modules/reaktor2.nix new file mode 100644 index 00000000..b667bcc9 --- /dev/null +++ b/krebs/3modules/reaktor2.nix @@ -0,0 +1,63 @@ +with import ; +{ config, pkgs, ... }: { + + options.krebs.reaktor2 = mkOption { + default = {}; + type = types.attrsOf (types.submodule (self: let + name = self.config._module.args.name; + in { + options = { + nick = mkOption { + default = name; + # TODO types.irc.nickname + type = types.str; + }; + hostname = mkOption { + default = "irc.r"; + type = types.hostname; + }; + port = mkOption { + default = "6667"; + # TODO type = types.service-name + }; + plugins = mkOption { + default = []; + type = types.listOf types.attrs; + }; + stateDir = mkOption { + default = "/var/lib/${self.config.systemd-service-name}"; + readOnly = true; + type = types.absolute-pathname; + }; + systemd-service-name = mkOption { + default = "reaktor2${optionalString (name != "default") "-${name}"}"; + type = types.filename; + }; + }; + })); + }; + + config = { + systemd.services = flip mapAttrs' config.krebs.reaktor2 (_: cfg: + nameValuePair cfg.systemd-service-name { + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + User = cfg.systemd-service-name; + Group = "reaktor2"; + DynamicUser = true; + StateDirectory = cfg.systemd-service-name; + ExecStart = let + configFile = pkgs.writeJSON configFileName configValue; + configFileName = "${cfg.systemd-service-name}.config.json"; + configValue = recursiveUpdate { + logTime = false; + } (removeAttrs cfg ["_module"]); + in "${pkgs.reaktor2}/bin/reaktor ${configFile}"; + Restart = "always"; + RestartSec = "30"; + }; + } + ); + }; +} -- cgit v1.2.3 From 9033d807f9ba6230f175dd1a0dd0ea1d710e247f Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 21 Jan 2019 16:25:27 +0100 Subject: external: add idontcare.r --- krebs/3modules/external/default.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'krebs/3modules') diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix index df18b4dd..6f521fc4 100644 --- a/krebs/3modules/external/default.nix +++ b/krebs/3modules/external/default.nix @@ -141,6 +141,29 @@ in { }; }; }; + idontcare = { + owner = config.krebs.users.Mic92; + nets = rec { + retiolum = { + addrs = [ + config.krebs.hosts.idontcare.nets.retiolum.ip4.addr + config.krebs.hosts.idontcare.nets.retiolum.ip6.addr + ]; + ip4.addr = "10.243.29.177"; + aliases = [ "idontcare.r" ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIIBCgKCAQEAxmmbQLVXcnCU9Vg9TCoJxfq/RyNfzaTj8XJsn4Kpo3CvQOwFzL6O + qZnbG55WjPjPumuFgtUdHA/G8mgtrTVaIRbVE9ck2l2wWFzMWxORzuvDbMh5xP8A + OW2Z2qjlH6O9GTBCzpYyHuyBWCjtiN4x9zEqxkIsBARKOylAoy3zQIiiQF0d72An + lqKFi9vYUU90zo9rP8BTzx2ZsEWb28xhHUlwf1+vgaOHI1jI99gnr12dVYl/i/Hb + O28gDUogfpP/5pWFAHJ+53ZscHo8/Y7imjiKgGXmOHywoXOsKQ67M6ROEU/0xPnw + jKmq2p7zTJk2mDhphjePi5idd5yKNX5Q3wIDAQAB + -----END RSA PUBLIC KEY----- + ''; + }; + }; + }; justraute = { owner = config.krebs.users.raute; # laptop nets = { -- cgit v1.2.3 From bc2aedb2d0a6d22089d4f666082d440e4ffb07e6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 21 Jan 2019 16:25:51 +0100 Subject: Mic92: change mail address --- krebs/3modules/external/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix index 6f521fc4..089113ac 100644 --- a/krebs/3modules/external/default.nix +++ b/krebs/3modules/external/default.nix @@ -416,7 +416,7 @@ in { pubkey = ssh-for "kmein"; }; Mic92 = { - mail = "joerg@higgsboson.tk"; + mail = "joerg@thalheim.io"; pubkey = ssh-for "Mic92"; }; palo = { -- cgit v1.2.3