From 552a3e8f284e86fd1a8aec1182ef4d4ebeab8d0c Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 16 Mar 2017 20:56:28 +0100 Subject: k 3: add htgen --- krebs/3modules/default.nix | 1 + krebs/3modules/htgen.nix | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 krebs/3modules/htgen.nix (limited to 'krebs/3modules') diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index f336c966f..d24cea1a2 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -20,6 +20,7 @@ let ./github-hosts-sync.nix ./git.nix ./go.nix + ./htgen.nix ./iptables.nix ./kapacitor.nix ./monit.nix diff --git a/krebs/3modules/htgen.nix b/krebs/3modules/htgen.nix new file mode 100644 index 000000000..2fe726049 --- /dev/null +++ b/krebs/3modules/htgen.nix @@ -0,0 +1,68 @@ +{ config, lib, pkgs, ... }: + +with import ; +let + cfg = config.krebs.htgen; + + out = { + options.krebs.htgen = api; + config = imp; + }; + + api = mkOption { + type = types.attrsOf (types.submodule ({ config, ... }: { + options = { + enable = mkEnableOption "krebs.htgen-${config.name}"; + + name = mkOption { + type = types.username; + default = config._module.args.name; + }; + + port = mkOption { + type = types.uint; + }; + + script = mkOption { + type = types.str; + }; + user = mkOption { + type = types.user; + default = { + name = "htgen-${config.name}"; + home = "/var/lib/htgen-${config.name}"; + }; + }; + }; + })); + }; + imp = { + + systemd.services = mapAttrs' (name: htgen: + nameValuePair "htgen-${name}" { + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + environment = { + HTGEN_PORT = toString htgen.port; + }; + serviceConfig = { + SyslogIdentifier = "htgen"; + User = htgen.user.name; + PrivateTmp = true; + Restart = "always"; + ExecStart = "${pkgs.htgen.override { + inherit (htgen) script; + }}/bin/htgen --serve"; + }; + } + ) cfg; + + users.users = mapAttrs' (name: htgen: + nameValuePair htgen.user.name { + inherit (htgen.user) home name uid; + createHome = true; + } + ) cfg; + + }; +in out -- cgit v1.2.3 From 5718517f60275a8dd66f3a230792e72bcc8d29c9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 16 Mar 2017 21:53:34 +0100 Subject: k 3 htgen: use htgen-1.1 --- krebs/3modules/htgen.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/htgen.nix b/krebs/3modules/htgen.nix index 2fe726049..3c8872be2 100644 --- a/krebs/3modules/htgen.nix +++ b/krebs/3modules/htgen.nix @@ -44,15 +44,14 @@ let after = [ "network.target" ]; environment = { HTGEN_PORT = toString htgen.port; + HTGEN_SCRIPT = htgen.script; }; serviceConfig = { SyslogIdentifier = "htgen"; User = htgen.user.name; PrivateTmp = true; Restart = "always"; - ExecStart = "${pkgs.htgen.override { - inherit (htgen) script; - }}/bin/htgen --serve"; + ExecStart = "${pkgs.htgen}/bin/htgen --serve"; }; } ) cfg; -- cgit v1.2.3 From 8809797f1063945c03ebd70666c108c45d5d724a Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 16 Mar 2017 22:12:11 +0100 Subject: k 3 htgen: add default option --- krebs/3modules/htgen.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'krebs/3modules') diff --git a/krebs/3modules/htgen.nix b/krebs/3modules/htgen.nix index 3c8872be2..0dddca6c8 100644 --- a/krebs/3modules/htgen.nix +++ b/krebs/3modules/htgen.nix @@ -10,6 +10,7 @@ let }; api = mkOption { + default = {}; type = types.attrsOf (types.submodule ({ config, ... }: { options = { enable = mkEnableOption "krebs.htgen-${config.name}"; -- cgit v1.2.3 From fac92f5b2828095b421b5be3fc55e7e7bf0e1735 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 31 Mar 2017 14:22:42 +0200 Subject: k 3 m: disable v6 address for gum --- krebs/3modules/makefu/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/makefu/default.nix b/krebs/3modules/makefu/default.nix index 489f62b65..7a6a88e85 100644 --- a/krebs/3modules/makefu/default.nix +++ b/krebs/3modules/makefu/default.nix @@ -464,7 +464,7 @@ with import ; retiolum = { via = internet; ip4.addr = "10.243.0.211"; - ip6.addr = "42:f9f0:0000:0000:0000:0000:0000:70d2"; + # ip6.addr = "42:f9f0:0000:0000:0000:0000:0000:70d2"; aliases = [ "gum.r" "gum.retiolum" -- cgit v1.2.3 From 9224e9c4c8432ce8d7788592b9d25cfc29440ee6 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 11 Apr 2017 21:38:27 +0200 Subject: m: gum takes over euer,wiki,graphs from wry --- krebs/3modules/makefu/default.nix | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/makefu/default.nix b/krebs/3modules/makefu/default.nix index 7a6a88e85..8e5927f9d 100644 --- a/krebs/3modules/makefu/default.nix +++ b/krebs/3modules/makefu/default.nix @@ -285,12 +285,9 @@ with import ; cores = 1; extraZones = { "krebsco.de" = '' - euer IN A ${nets.internet.ip4.addr} - wiki.euer IN A ${nets.internet.ip4.addr} - wry IN A ${nets.internet.ip4.addr} - io IN NS wry.krebsco.de. - graphs IN A ${nets.internet.ip4.addr} - tinc IN A ${nets.internet.ip4.addr} + wry IN A ${nets.internet.ip4.addr} + io IN NS wry.krebsco.de. + tinc IN A ${nets.internet.ip4.addr} ''; }; nets = rec { @@ -307,13 +304,8 @@ with import ; ip6.addr = "42:6e1e:cc8a:7cef:827:f938:8c64:baad"; aliases = [ "graphs.wry.retiolum" - "graphs.r" "graphs.retiolum" "paste.wry.retiolum" "wry.r" "wry.retiolum" - "wiki.makefu.retiolum" - "wiki.wry.retiolum" - "blog.makefu.retiolum" - "blog.wry.retiolum" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- @@ -452,6 +444,9 @@ with import ; cgit.euer IN A ${nets.internet.ip4.addr} o.euer IN A ${nets.internet.ip4.addr} dl.euer IN A ${nets.internet.ip4.addr} + euer IN A ${nets.internet.ip4.addr} + wiki.euer IN A ${nets.internet.ip4.addr} + graphs IN A ${nets.internet.ip4.addr} ''; }; nets = rec { @@ -473,6 +468,12 @@ with import ; "o.gum.retiolum" "tracker.makefu.r" "tracker.makefu.retiolum" + + "graphs.r" "graphs.retiolum" + "wiki.makefu.retiolum" + "wiki.wry.retiolum" + "blog.makefu.retiolum" + "blog.wry.retiolum" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- -- cgit v1.2.3