From 173e713db431675f29a1b4162fe2e3adc807d005 Mon Sep 17 00:00:00 2001 From: File Magic Date: Tue, 28 Jul 2026 22:58:35 -0400 Subject: [PATCH] modules/fujifilm-webcam.nix: use writeShellScript wrapper for clean environment and binary resolution --- modules/fujifilm-webcam.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/fujifilm-webcam.nix b/modules/fujifilm-webcam.nix index 4eace0b..771a9ba 100644 --- a/modules/fujifilm-webcam.nix +++ b/modules/fujifilm-webcam.nix @@ -37,7 +37,10 @@ in { description = "Fujifilm camera as webcam via gphoto2 + ffmpeg"; 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}'"; + ExecStart = toString (pkgs.writeShellScript "fujifilm-webcam" '' + export PATH="${lib.makeBinPath [pkgs.gphoto2 pkgs.ffmpeg]}:$PATH" + exec gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 ${cfg.videoDevice} + ''); Restart = "on-failure"; RestartSec = "5s"; }; -- 2.51.2