summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2020-05-09 17:24:59 +0100
committerJörg Thalheim <joerg@thalheim.io>2020-05-15 08:53:31 +0100
commitb96a4dcc6079e9c7ea94f9f06b7399a4e10a9e05 (patch)
treeab58641e4683c9930aabac50108ddee49a311f50
parentc956b591b4fcba9f0ca02f24b9a0bf318771736a (diff)
downloadnixpkgs-b96a4dcc6079e9c7ea94f9f06b7399a4e10a9e05.tar
nixpkgs-b96a4dcc6079e9c7ea94f9f06b7399a4e10a9e05.tar.gz
nixpkgs-b96a4dcc6079e9c7ea94f9f06b7399a4e10a9e05.tar.bz2
nixpkgs-b96a4dcc6079e9c7ea94f9f06b7399a4e10a9e05.tar.lz
nixpkgs-b96a4dcc6079e9c7ea94f9f06b7399a4e10a9e05.tar.xz
nixpkgs-b96a4dcc6079e9c7ea94f9f06b7399a4e10a9e05.tar.zst
nixpkgs-b96a4dcc6079e9c7ea94f9f06b7399a4e10a9e05.zip
uwsgi: make instance configuration deeply mergeable
allows to specify independent uwsgi instances in two modules.
-rw-r--r--nixos/modules/services/web-servers/uwsgi.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/nixos/modules/services/web-servers/uwsgi.nix b/nixos/modules/services/web-servers/uwsgi.nix
index 4b74c329e3d..936e211ec71 100644
--- a/nixos/modules/services/web-servers/uwsgi.nix
+++ b/nixos/modules/services/web-servers/uwsgi.nix
@@ -79,7 +79,25 @@ in {
       };
 
       instance = mkOption {
-        type = types.attrs;
+        type =  with lib.types; let
+          valueType = nullOr (oneOf [
+            bool
+            int
+            float
+            str
+            (lazyAttrsOf valueType)
+            (listOf valueType)
+            (mkOptionType {
+              name = "function";
+              description = "function";
+              check = x: isFunction x;
+              merge = mergeOneOption;
+            })
+          ]) // {
+            description = "Json value or lambda";
+            emptyValue.value = {};
+          };
+        in valueType;
         default = {
           type = "normal";
         };