1
0
Fork 0
nix-configuration/modules/nixos/apps/recording/default.nix

57 lines
1.7 KiB
Nix
Raw Normal View History

{
config,
lib,
pkgs,
2024-12-06 18:04:47 +00:00
namespace,
...
}:
2024-02-29 14:53:34 +00:00
let
2024-12-06 18:04:47 +00:00
cfg = config.${namespace}.apps.recording;
2024-02-29 14:53:34 +00:00
in
{
options = {
2024-12-06 18:04:47 +00:00
${namespace}.apps.recording.enable = lib.mkEnableOption "Enables video editing tools";
};
2024-02-29 14:53:34 +00:00
2024-08-02 21:55:48 +00:00
config = lib.mkIf cfg.enable {
2024-12-06 18:04:47 +00:00
${namespace}.ui.flatpak.enable = true;
2024-02-29 14:53:34 +00:00
2024-06-10 19:22:27 +00:00
services.flatpak.packages = [
"com.obsproject.Studio"
"org.kde.kdenlive"
"org.tenacityaudio.Tenacity"
2024-06-20 13:11:34 +00:00
"io.github.seadve.Kooha"
2024-06-10 19:22:27 +00:00
];
2024-02-29 14:53:34 +00:00
environment.systemPackages = with pkgs; [ droidcam ];
2024-12-18 14:18:33 +00:00
# As an alternative to Droidcam, we can also use scrcpy.
# After plugging in the phone via USB, run this command:
#
# scrcpy --video-source=camera --no-audio --camera-facing=front --v4l2-sink=/dev/video0 --no-video-playback
#
# For details, see https://github.com/Genymobile/scrcpy/blob/master/doc/v4l2.md
programs.adb.enable = true;
users.users = {
aires.extraGroups = lib.mkIf config.${namespace}.users.aires.enable [ "adbusers" ];
#gremlin.extraGroups = lib.mkIf config.${namespace}.users.gremlin.enable [ "adbusers" ];
};
# Add a virtual camera to use with Droidcam
boot = {
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback.out ];
kernelModules = [ "v4l2loopback" ];
# Note on v4l2loopback kernel module parameters:
# exclusive_caps: Skype, Zoom, Teams etc. will only show device when actually streaming. This MUST be set to 1 for Chrome to detect virtual cameras.
# card_label: Name of virtual camera, how it'll show up in Skype, Zoom, Teams
2024-12-18 14:18:33 +00:00
#
# https://github.com/umlaeute/v4l2loopback
extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 card_label="Droidcam" set_fps=30
'';
};
};
}