Init Config

This commit is contained in:
DerGrumpf
2026-04-03 23:37:52 +02:00
parent a8ec840d21
commit 62d3c12930
111 changed files with 5652 additions and 1 deletions

27
nixos/webcam.nix Normal file
View File

@@ -0,0 +1,27 @@
{ pkgs, ... }:
{
services.udev.extraRules = ''
ACTION=="add", \
SUBSYSTEM=="usb", \
ATTR{idVendor}=="04a9", \
ATTR{idProduct}=="31ea", \
RUN+="${pkgs.systemd}/bin/systemctl restart webcam"
'';
systemd.services.webcam = {
enable = true;
description = "Canon Camera Webcam";
script = ''
${pkgs.gphoto2}/bin/gphoto2 --stdout --capture-movie | \
${pkgs.ffmpeg}/bin/ffmpeg \
-i - \
-vcodec rawvideo \
-pix_fmt yuv420p \
-threads 0 \
-framerate 30 \
-f v4l2 \
/dev/video0
'';
wantedBy = [ "multi-user.target" ];
};
}