diff options
author | lassulus <lassulus@lassul.us> | 2022-12-08 13:11:27 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2022-12-08 13:11:27 +0100 |
commit | d7341bbff6b0b866aa5d8bc9b248e8468fba5952 (patch) | |
tree | 5833484e2ebf219ed06e66b40cdc3c626e4db73c /krebs/3modules/htgen.nix | |
parent | ac32440c0b41a3c7dc67ab7dc8d3306ab7fae091 (diff) | |
parent | f8fdd76e7195d4a4f0117f7e64032075bb01a98e (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/3modules/htgen.nix')
-rw-r--r-- | krebs/3modules/htgen.nix | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/krebs/3modules/htgen.nix b/krebs/3modules/htgen.nix index 375e26974..1e7e69927 100644 --- a/krebs/3modules/htgen.nix +++ b/krebs/3modules/htgen.nix @@ -2,6 +2,12 @@ with import <stockholm/lib>; let + optionalAttr = name: value: + if name != null then + { ${name} = value; } + else + {}; + cfg = config.krebs.htgen; out = { @@ -30,8 +36,15 @@ let }; script = mkOption { - type = types.str; + type = types.nullOr types.str; + default = null; + }; + + scriptFile = mkOption { + type = types.nullOr types.str; + default = null; }; + user = mkOption { type = types.user; default = { @@ -54,8 +67,10 @@ let after = [ "network.target" ]; environment = { HTGEN_PORT = toString htgen.port; - HTGEN_SCRIPT = htgen.script; - }; + } + // optionalAttr "HTGEN_SCRIPT" htgen.script + // optionalAttr "HTGEN_SCRIPT_FILE" htgen.scriptFile + ; serviceConfig = { SyslogIdentifier = "htgen"; User = htgen.user.name; |