nixos-config/modules/backscrub/default.nix

32 lines
694 B
Nix
Raw Normal View History

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;
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"
'';
};
environment.systemPackages = with pkgs; [ backscrub ];
2021-12-06 09:58:39 +01:00
};
}