From fbc51169957527e3d68acb3de0aca60744e3cec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Fri, 13 Mar 2026 14:55:42 +0700 Subject: [PATCH] Add proxy for camera --- hosts/Aloria/hardware-configuration.nix | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/hosts/Aloria/hardware-configuration.nix b/hosts/Aloria/hardware-configuration.nix index 277b856..d62db37 100644 --- a/hosts/Aloria/hardware-configuration.nix +++ b/hosts/Aloria/hardware-configuration.nix @@ -19,6 +19,7 @@ boot.extraModprobeConfig = '' options thinkpad_acpi fan_control=1 options v4l2loopback exclusive_caps=1 card_label="Android Virtual Camera" + options v4l2loopback exclusive_caps=1 video_nr=42 card_label="IPU6 Virtual Camera" ''; # boot.kernelParams = ["ipv6.disable=1"]; @@ -63,4 +64,37 @@ services.udev.extraRules = '' SUBSYSTEM=="intel-ipu6-psys", MODE="0660", GROUP="video" ''; + systemd.services.ipu6-v4l2-proxy = { + description = "IPU6 Libcamera to V4L2Loopback Proxy"; + # wantedBy = ["multi-user.target"]; + after = ["systemd-udev-settle.service"]; + + serviceConfig = { + ExecStart = let + gstPluginPath = pkgs.lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with pkgs.gst_all_1; + [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + ] + ++ [pkgs.libcamera]); + in '' + ${pkgs.gst_all_1.gstreamer}/bin/gst-launch-1.0 \ + --gst-plugin-path=${gstPluginPath} \ + libcamerasrc \ + ! video/x-raw \ + ! vapostproc contrast=1.3 saturation=1.4 brightness=-0.15 \ + ! video/x-raw,width=1280,height=720 \ + ! videoconvert \ + ! gamma gamma=0.7 \ + ! videoconvert \ + ! video/x-raw,format=YUY2 \ + ! v4l2sink device=/dev/video42 + ''; + + Restart = "always"; + RestartSec = "3"; + }; + }; }