From 5146f760957f97853188a1263ce6ac43dd5d0a55 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 5 Apr 2016 17:27:58 +0200 Subject: [PATCH] nixos/taskserver: Add an option for organisations We want to declaratively specify users and organisations, so let's add another module option "organisations", which allows us to specify users, groups and of course organisations. The implementation of this is not yet done and this is just to feed the boilerplate. Signed-off-by: aszlig --- nixos/modules/services/misc/taskserver.nix | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/nixos/modules/services/misc/taskserver.nix b/nixos/modules/services/misc/taskserver.nix index b25447ccd9d..47a11288b52 100644 --- a/nixos/modules/services/misc/taskserver.nix +++ b/nixos/modules/services/misc/taskserver.nix @@ -59,6 +59,26 @@ let ''} ''; + orgOptions = { name, ... }: { + options.users = mkOption { + type = types.uniq (types.listOf types.str); + default = []; + example = [ "alice" "bob" ]; + description = '' + A list of user names that belong to the organization. + ''; + }; + + options.groups = mkOption { + type = types.listOf types.str; + default = []; + example = [ "workers" "slackers" ]; + description = '' + A list of group names that belong to the organization. + ''; + }; + }; + in { options = { @@ -100,6 +120,19 @@ in { ''; }; + organisations = mkOption { + type = types.attrsOf (types.submodule orgOptions); + default = {}; + example.myShinyOrganisation.users = [ "alice" "bob" ]; + example.myShinyOrganisation.groups = [ "staff" "outsiders" ]; + example.yetAnotherOrganisation.users = [ "foo" "bar" ]; + description = '' + An attribute set where the keys name the organisation and the values + are a set of lists of and + . + ''; + }; + confirmation = mkOption { type = types.bool; default = true;