mirror of
https://github.com/traxys/Nixfiles.git
synced 2026-03-21 11:46:08 +01:00
hostconfig/minus: Configure the CEC subsystem
This commit is contained in:
parent
00330b4102
commit
fbaead251d
1 changed files with 24 additions and 0 deletions
|
|
@ -4,6 +4,9 @@
|
|||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cec-ctl = lib.getExe' pkgs.v4l-utils "cec-ctl";
|
||||
in
|
||||
{
|
||||
boot.extraModulePackages = [
|
||||
(pkgs.pulse8-cec.override { inherit (config.boot.kernelPackages) kernel; })
|
||||
|
|
@ -64,6 +67,12 @@
|
|||
SUBSYSTEM=="tty" ACTION=="add" \
|
||||
ATTRS{manufacturer}=="Pulse-Eight" ATTRS{product}=="CEC Adapter" \
|
||||
TAG+="systemd" ENV{SYSTEMD_WANTS}="pulse8-cec-attach@$devnode.service"
|
||||
|
||||
SUBSYSTEM=="cec" KERNEL=="cec0" ACTION=="add" \
|
||||
TAG+="systemd" ENV{SYSTEMD_WANTS}="cec0-configure@card1-HDMI-A-1.service"
|
||||
|
||||
SUBSYSTEM=="cec" KERNEL == "cec0" ACTION=="add" \
|
||||
RUN+="${cec-ctl} '--device=$devpath' '--osd-name=minus' --playback"
|
||||
'';
|
||||
|
||||
systemd.services."pulse8-cec-attach@" = {
|
||||
|
|
@ -86,6 +95,21 @@
|
|||
};
|
||||
};
|
||||
|
||||
systemd.services."cec0-configure@" = {
|
||||
description = "Configure CEC adapter cec0 assuming it runs on output %i";
|
||||
unitConfig = {
|
||||
AssertPathExists = "/sys/class/drm/%i/edid";
|
||||
BindsTo = "dev-cec0.device";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "exec";
|
||||
ExecStart = ''
|
||||
${cec-ctl} --device=0 "--osd-name=%H" --playback "--phys-addr-from-edid-poll=/sys/class/drm/%i/edid"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
moonlight-qt
|
||||
jstest-gtk
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue