audio-server: pause mpv in the early morning
This commit is contained in:
parent
ebdbc9fc92
commit
afe096f373
|
@ -151,18 +151,39 @@
|
||||||
'');
|
'');
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
services.bluetooth-agent = lib.mkIf config.hardware.bluetooth.enable {
|
services = {
|
||||||
description = "Allow anyone to pair via Bluetooth";
|
bluetooth-agent = lib.mkIf config.hardware.bluetooth.enable {
|
||||||
wantedBy = [ "multi-user.target" ];
|
description = "Allow anyone to pair via Bluetooth";
|
||||||
requires = [ "bluetooth.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "bluetooth.service" ];
|
requires = [ "bluetooth.target" ];
|
||||||
serviceConfig = {
|
after = [ "bluetooth.service" ];
|
||||||
Type = "simple";
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.bluez-tools}/bin/bt-agent -c NoInputNoOutput";
|
Type = "simple";
|
||||||
Restart = "on-failure";
|
ExecStart = "${pkgs.bluez-tools}/bin/bt-agent -c NoInputNoOutput";
|
||||||
RestartSec = 60;
|
Restart = "on-failure";
|
||||||
|
RestartSec = 60;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mpv-pause = {
|
||||||
|
script = ''
|
||||||
|
echo '{ "command": ["set_property", "pause", true] }' | ${pkgs.socat}/bin/socat - /tmp/mpvsocket
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "root";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
timers.mpv-pause = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
Unit = "mpv-pause.service";
|
||||||
|
OnCalendar = "*-*-* 05:30:00";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
user.services = {
|
user.services = {
|
||||||
ledfx = {
|
ledfx = {
|
||||||
after = [ "pipewire.target" ];
|
after = [ "pipewire.target" ];
|
||||||
|
|
Loading…
Reference in New Issue