summary refs log tree commit diff
path: root/nixos/modules/services/misc/taskserver/default.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-04-12 04:21:55 +0200
committeraszlig <aszlig@redmoonstudios.org>2016-04-12 04:21:55 +0200
commit9279ec732b5475540a3abac3ee8cf09e858be107 (patch)
treea0666eab7b286ab019445e09cb1aac1ab94a1e73 /nixos/modules/services/misc/taskserver/default.nix
parent9f1e536948ba2f7d87dc0919dc7f630f6723ab85 (diff)
downloadnixlib-9279ec732b5475540a3abac3ee8cf09e858be107.tar
nixlib-9279ec732b5475540a3abac3ee8cf09e858be107.tar.gz
nixlib-9279ec732b5475540a3abac3ee8cf09e858be107.tar.bz2
nixlib-9279ec732b5475540a3abac3ee8cf09e858be107.tar.lz
nixlib-9279ec732b5475540a3abac3ee8cf09e858be107.tar.xz
nixlib-9279ec732b5475540a3abac3ee8cf09e858be107.tar.zst
nixlib-9279ec732b5475540a3abac3ee8cf09e858be107.zip
nixos/taskserver: Introduce an extraConfig option
This is simply to add configuration lines to the generated configuration
file. The reason why I didn't went for an attribute set is that the
taskdrc file format doesn't map very well on Nix attributes, for example
the following can be set in taskdrc:

server = somestring
server.key = anotherstring

In order to use a Nix attribute set for that, it would be way too
complicated, for example if we want to represent the mentioned example
we'd have to do something like this:

{ server._top = somestring;
  server.key = anotherstring;
}

Of course, this would work as well but nothing is more simple than just
appending raw strings.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/modules/services/misc/taskserver/default.nix')
-rw-r--r--nixos/modules/services/misc/taskserver/default.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/nixos/modules/services/misc/taskserver/default.nix b/nixos/modules/services/misc/taskserver/default.nix
index 70e162904e98..d82e9f77ea6a 100644
--- a/nixos/modules/services/misc/taskserver/default.nix
+++ b/nixos/modules/services/misc/taskserver/default.nix
@@ -94,7 +94,7 @@ let
     in flatten (mapAttrsToList mkSublist attrs);
   in all isNull (findPkiDefinitions [] manualPkiOptions);
 
-  configFile = pkgs.writeText "taskdrc" ''
+  configFile = pkgs.writeText "taskdrc" (''
     # systemd related
     daemon = false
     log = -
@@ -130,7 +130,7 @@ let
       server.key = ${cfg.pki.server.key}
       server.crl = ${cfg.pki.server.crl}
     ''}
-  '';
+  '' + cfg.extraConfig);
 
   orgOptions = { name, ... }: {
     options.users = mkOption {
@@ -363,6 +363,15 @@ in {
 
       pki.manual = manualPkiOptions;
       pki.auto = autoPkiOptions;
+
+      extraConfig = mkOption {
+        type = types.lines;
+        default = "";
+        example = "client.cert = /tmp/debugging.cert";
+        description = ''
+          Extra lines to append to the taskdrc configuration file.
+        '';
+      };
     };
   };