mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 17:17:22 +01:00
feat: add udev rule for screensharing
This commit is contained in:
parent
27b06772c2
commit
a8e3f5887b
1 changed files with 23 additions and 0 deletions
|
|
@ -3,6 +3,25 @@ let
|
||||||
inherit (config.swarselsystems) mainUser homeDir xdgDir;
|
inherit (config.swarselsystems) mainUser homeDir xdgDir;
|
||||||
owner = mainUser;
|
owner = mainUser;
|
||||||
sopsFile = self + /secrets/work/secrets.yaml;
|
sopsFile = self + /secrets/work/secrets.yaml;
|
||||||
|
swarselService = name: description: execStart: {
|
||||||
|
"${name}" = {
|
||||||
|
enable = true;
|
||||||
|
inherit description;
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = execStart;
|
||||||
|
User = mainUser;
|
||||||
|
Group = "users";
|
||||||
|
Environment = [
|
||||||
|
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/${mainUser}/bin"
|
||||||
|
"XDG_RUNTIME_DIR=${xdgDir}"
|
||||||
|
"WAYLAND_DISPLAY=wayland-1"
|
||||||
|
];
|
||||||
|
Type = "oneshot";
|
||||||
|
StandardOutput = "journal";
|
||||||
|
StandardError = "journal";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sops = {
|
sops = {
|
||||||
|
|
@ -123,6 +142,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
udev.extraRules = ''
|
udev.extraRules = ''
|
||||||
|
# share screen when dongle detected
|
||||||
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
|
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
@ -145,6 +165,9 @@ in
|
||||||
StandardError = "journal";
|
StandardError = "journal";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
systemd.services = lib.mkMerge [
|
||||||
|
(swarselService "swarsel-screenshare" "Start screensharing after HDMI dongle is detected" "${pkgs.screenshare}/bin/screenshare -h")
|
||||||
|
];
|
||||||
|
|
||||||
# cgroups v1 is required for centos7 dockers
|
# cgroups v1 is required for centos7 dockers
|
||||||
specialisation = {
|
specialisation = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue