mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(octoprint): motion and notifs
This commit is contained in:
parent
6bf729ffe9
commit
7fe6d48ff0
11 changed files with 263 additions and 47 deletions
34
nixos/cameras/kitchen.nix
Normal file
34
nixos/cameras/kitchen.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
config,
|
||||
gensokyo-zone,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (gensokyo-zone.lib) mapDefaults;
|
||||
inherit (config.services) motion;
|
||||
in {
|
||||
services.motion.cameras.kitchencam.settings = mapDefaults {
|
||||
videodevice = "/dev/kitchencam";
|
||||
v4l2_palette = 8;
|
||||
width = 640;
|
||||
height = 480;
|
||||
framerate = 5;
|
||||
camera_id = 1;
|
||||
text_left = "kitchen";
|
||||
};
|
||||
services.udev.extraRules = let
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
rules = [
|
||||
''SUBSYSTEM=="video4linux"''
|
||||
''ACTION=="add"''
|
||||
''ATTR{index}=="0"''
|
||||
''ATTRS{idProduct}=="2a25"''
|
||||
''ATTRS{idVendor}=="1224"''
|
||||
''SYMLINK+="kitchencam"''
|
||||
''OWNER="${motion.user}"''
|
||||
''TAG+="systemd"''
|
||||
''ENV{SYSTEMD_WANTS}="motion.service"''
|
||||
];
|
||||
rulesLine = concatStringsSep ", " rules;
|
||||
in rulesLine;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue