diff options
author | Luca Bruno <lucabru@src.gnome.org> | 2015-03-13 14:11:59 +0000 |
---|---|---|
committer | Luca Bruno <lucabru@src.gnome.org> | 2015-03-18 14:07:29 +0000 |
commit | 7ef59c4fe2a87682054572a504fc7c6046c282e5 (patch) | |
tree | 0f0af3abb1d6558dfc8a289cc185e85cc31c262d /lib | |
parent | 506cbf05a9460ae452c29ebd1324eeae04082a2e (diff) |
nixos: Multiple service instances, apply to nginx. See #6784
Diffstat (limited to 'lib')
-rw-r--r-- | lib/types.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix index 1e7abf36535fb..ba0f9a5b890c7 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -227,4 +227,19 @@ rec { }; + mkMultiInstance = path: args: f: + let + def = f (args // { name = "default"; config = getAttrFromPath path args.config; }); + in { + options = setAttrByPath path (def.options // { + instances = mkOption { + type = types.attrsOf (types.submodule f); + default = {}; + description = "Additional instances of this service"; + }; + }); + + config = def.config; + }; + } |