From c09d82c03cceaa533bcf863da7b06898de2a80d5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 15 May 2018 17:57:05 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom/trivmix-service.nix | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'custom') diff --git a/custom/trivmix-service.nix b/custom/trivmix-service.nix index f2d549fe..9a8ed504 100644 --- a/custom/trivmix-service.nix +++ b/custom/trivmix-service.nix @@ -74,7 +74,7 @@ let trivmixArgs = let dirName = if isNull group then name else group; - in [ "--client" name "--level" initial "--initial-balance" initialBalance] + in [ "--fps" cfg.fps "--interval" cfg.interval "--client" name "--level" initial "--initial-balance" initialBalance ] ++ optionals connect ["--run" connectScript] ++ optionals (adjustable && (! isNull balance)) ["--balance" "/dev/shm/mix/${dirName}/${balance}"] ++ optional (adjustable && isNull group) "/dev/shm/mix/${name}/level" @@ -97,15 +97,27 @@ let ''; }; in { - options.services.trivmix = mkOption { - type = types.attrsOf (types.submodule mixerModule); - default = {}; - description = "Definition of mixers"; + options.services.trivmix = { + mixers = mkOption { + type = types.attrsOf (types.submodule mixerModule); + default = {}; + description = "Definition of mixers"; + }; + + fps = mkOption { + type = types.str; + default = "200"; + }; + + interval = mkOption { + type = types.str; + default = "0.2"; + }; }; - config = mkIf (cfg != {}) { + config = mkIf (cfg.mixers != {}) { environment.systemPackages = [ trivmix ]; - systemd.services = mapAttrs service cfg; + systemd.services = mapAttrs service cfg.mixers; }; } -- cgit v1.2.3