2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.uvcvideo;
|
|
|
|
|
|
|
|
uvcdynctrl-udev-rules = packages: pkgs.callPackage ./uvcdynctrl-udev-rules.nix {
|
|
|
|
drivers = packages;
|
|
|
|
udevDebug = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
services.uvcvideo.dynctrl = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
Whether to enable {command}`uvcvideo` dynamic controls.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
Note that enabling this brings the {command}`uvcdynctrl` tool
|
2020-08-20 17:08:02 +00:00
|
|
|
into your environment and register all dynamic controls from
|
2022-08-12 12:06:08 +00:00
|
|
|
specified {command}`packages` to the {command}`uvcvideo` driver.
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
packages = mkOption {
|
|
|
|
type = types.listOf types.path;
|
2021-10-06 13:57:05 +00:00
|
|
|
example = literalExpression "[ pkgs.tiscamera ]";
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
List of packages containing {command}`uvcvideo` dynamic controls
|
2020-04-24 23:36:52 +00:00
|
|
|
rules. All files found in
|
2022-08-12 12:06:08 +00:00
|
|
|
{file}`«pkg»/share/uvcdynctrl/data`
|
2020-04-24 23:36:52 +00:00
|
|
|
will be included.
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
Note that these will serve as input to the {command}`libwebcam`
|
|
|
|
package which through its own {command}`udev` rule will register
|
|
|
|
the dynamic controls from specified packages to the {command}`uvcvideo`
|
2020-04-24 23:36:52 +00:00
|
|
|
driver.
|
|
|
|
'';
|
|
|
|
apply = map getBin;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.dynctrl.enable {
|
|
|
|
|
|
|
|
services.udev.packages = [
|
|
|
|
(uvcdynctrl-udev-rules cfg.dynctrl.packages)
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.libwebcam
|
|
|
|
];
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|