summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--custom/motion.nix30
1 files changed, 11 insertions, 19 deletions
diff --git a/custom/motion.nix b/custom/motion.nix
index 1aa39f41..21693a34 100644
--- a/custom/motion.nix
+++ b/custom/motion.nix
@@ -21,21 +21,6 @@ let
21 }; 21 };
22 }; 22 };
23 23
24 userConfig = {
25 options = {
26 name = mkOption {
27 type = types.str;
28 default = "motion";
29 description = "Name of the dedicated user";
30 };
31
32 config = {
33 type = types.attrs;
34 default = {};
35 };
36 };
37 };
38
39 cameraConfig' = cameraId: cCfg: pkgs.writeText "${toString cameraId}.conf" '' 24 cameraConfig' = cameraId: cCfg: pkgs.writeText "${toString cameraId}.conf" ''
40 camera_id ${toString cameraId} 25 camera_id ${toString cameraId}
41 26
@@ -81,10 +66,17 @@ in {
81 description = "Config files to append to service config"; 66 description = "Config files to append to service config";
82 }; 67 };
83 68
84 user = mkOption { 69 user = {
85 type = types.submodule userConfig; 70 name = mkOption {
86 default = {}; 71 type = types.str;
87 description = "Overrides for the motion user"; 72 default = "motion";
73 description = "Name of the dedicated user";
74 };
75
76 config = {
77 type = types.attrs;
78 default = {};
79 };
88 }; 80 };
89 }; 81 };
90 }; 82 };