From 0ef5f1d43cdd72c42778a9f2ae13de8fbf84b8f8 Mon Sep 17 00:00:00 2001 From: File Magic Date: Tue, 28 Jul 2026 18:17:08 -0400 Subject: [PATCH] modules/fujifilm-webcam.nix: move gphoto2+ffmpeg pipeline to user systemd unit, keep v4l2loopback at system level --- modules/fujifilm-webcam.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/fujifilm-webcam.nix b/modules/fujifilm-webcam.nix index d052362..b969216 100644 --- a/modules/fujifilm-webcam.nix +++ b/modules/fujifilm-webcam.nix @@ -7,7 +7,7 @@ cfg = config.hardened.fujifilm-webcam; in { options.hardened.fujifilm-webcam = { - enable = lib.mkEnableOption "Fujifilm camera as webcam (gphoto2 + v4l2loopback + ffmpeg)"; + enable = lib.mkEnableOption "Fujifilm camera as webcam (v4l2loopback + gphoto2 + ffmpeg)"; videoDevice = lib.mkOption { type = lib.types.str; @@ -24,19 +24,16 @@ in { ''; environment.systemPackages = with pkgs; [ - gphoto2 ffmpeg + gphoto2 v4l2loopback ]; - systemd.services.fujifilm-webcam = { + systemd.user.services.fujifilm-webcam = { description = "Fujifilm camera as webcam via gphoto2 + ffmpeg"; - wantedBy = ["multi-user.target"]; - after = ["dev-video2.device" "systemd-modules-load.service"]; - wants = ["dev-video2.device"]; + wantedBy = ["default.target"]; serviceConfig = { ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.gphoto2}/bin/gphoto2 --stdout --capture-movie | ${pkgs.ffmpeg}/bin/ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 ${cfg.videoDevice}'"; - User = "root"; Restart = "on-failure"; RestartSec = "5s"; }; -- 2.51.2