libcamera: split to separate file & add udev rules

i think the udev rules arent actually needed though?
This commit is contained in:
2024-09-12 05:26:46 +00:00
parent add5910b4f
commit 7fa689c82d
3 changed files with 19 additions and 2 deletions

View File

@@ -829,8 +829,6 @@ in
landlock-sandboxer.sandbox.enable = false; #< sandbox helper
libcamera = {};
libcap_ng.sandbox.enable = false; # TODO: `pscap` can sandbox with bwrap, `captest` and `netcap` with landlock
libnotify.sandbox.method = "bunpen";

View File

@@ -96,6 +96,7 @@
./less.nix
./lftp.nix
./lgtrombetta-compass.nix
./libcamera.nix
./libreoffice.nix
./lemoa.nix
./loupe.nix

View File

@@ -0,0 +1,18 @@
{ config, lib, ... }:
let
cfg = config.sane.programs.libcamera;
in
{
sane.programs.libcamera = {};
services.udev.extraRules = lib.mkIf cfg.enabled ''
# libcamera (snapshot, millipixels, ...)
# see: <https://gitlab.com/postmarketOS/pmaports/-/merge_requests/5541>
# can be removed for systemd 257+
# - <https://github.com/systemd/systemd/pull/33738>
#
# i do the old and/or lazy way, just grant broad R+W access
# dma_heap is the old resource; udmabuf is the new one.
KERNEL=="udmabuf", GROUP="video", MODE="0660"
SUBSYSTEM=="dma_heap", GROUP="video", MODE="0660"
'';
}