2022-04-27 00:21:19 +02:00
|
|
|
{ pkgs
|
|
|
|
, config
|
|
|
|
, lib
|
|
|
|
, ...
|
2022-03-01 22:19:03 +01:00
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.eboskma.backscrub;
|
2022-04-27 00:21:19 +02:00
|
|
|
in
|
|
|
|
{
|
2021-12-06 09:58:39 +01:00
|
|
|
options.eboskma.backscrub = {
|
|
|
|
enable = mkEnableOption "enable v4l2loopback kernel module";
|
|
|
|
};
|
|
|
|
|
2022-05-03 18:17:38 +02:00
|
|
|
config = mkIf cfg.enable {
|
2022-04-27 00:21:19 +02:00
|
|
|
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
|
2021-12-06 09:58:39 +01:00
|
|
|
# Register a v4l2loopback device at boot
|
|
|
|
boot.kernelModules = [
|
|
|
|
"v4l2loopback"
|
|
|
|
];
|
|
|
|
|
|
|
|
boot.extraModprobeConfig = ''
|
|
|
|
options v4l2loopback max_buffers=2
|
|
|
|
options v4l2loopback exclusive_caps=1
|
|
|
|
options v4l2loopback video_nr=10
|
|
|
|
options v4l2loopback card_label="VirtualCam"
|
|
|
|
'';
|
|
|
|
|
2022-04-27 00:21:19 +02:00
|
|
|
environment.systemPackages = with pkgs; [ backscrub ];
|
2021-12-06 09:58:39 +01:00
|
|
|
};
|
|
|
|
}
|