2024-02-05 11:46:52 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2022-03-01 22:19:03 +01:00
|
|
|
}:
|
2024-02-05 11:46:52 +01:00
|
|
|
with lib;
|
|
|
|
let
|
2022-03-01 22:19:03 +01:00
|
|
|
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 {
|
2023-09-13 14:50:03 +02:00
|
|
|
boot = {
|
|
|
|
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
|
|
|
|
# Register a v4l2loopback device at boot
|
2024-02-05 11:46:52 +01:00
|
|
|
kernelModules = [ "v4l2loopback" ];
|
2021-12-06 09:58:39 +01:00
|
|
|
|
2023-09-13 14:50:03 +02:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|