nixos/taskserver: Fix type for client.{allow,deny}

We already document that we allow special values such as "all" and
"none", but the type doesn't represent that. So let's use an enum in
conjuction with a loeOf type so that this becomes clear.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2016-04-07 12:38:02 +02:00
parent 2d89617052
commit 33f948c88b
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -197,7 +197,7 @@ in {
client = { client = {
allow = mkOption { allow = mkOption {
type = types.listOf types.str; type = with types; loeOf (either (enum ["all" "none"]) str);
default = []; default = [];
example = [ "[Tt]ask [2-9]+" ]; example = [ "[Tt]ask [2-9]+" ];
description = '' description = ''
@ -220,7 +220,7 @@ in {
}; };
deny = mkOption { deny = mkOption {
type = types.listOf types.str; type = with types; loeOf (either (enum ["all" "none"]) str);
default = []; default = [];
example = [ "[Tt]ask [2-9]+" ]; example = [ "[Tt]ask [2-9]+" ];
description = '' description = ''