nixos-config/modules/backscrub/default.nix

31 lines
680 B
Nix
Raw Normal View History

2021-12-06 09:58:39 +01:00
{
2022-03-01 22:19:03 +01:00
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.eboskma.backscrub;
in {
2021-12-06 09:58:39 +01:00
options.eboskma.backscrub = {
enable = mkEnableOption "enable v4l2loopback kernel module";
};
config = mkIf (cfg.enable) {
2022-03-01 22:19:03 +01: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-03-01 22:19:03 +01:00
environment.systemPackages = with pkgs; [backscrub];
2021-12-06 09:58:39 +01:00
};
}