mpris-proxy: add module (#1832)

This commit is contained in:
Thibaut Marty 2021-04-28 21:05:56 +02:00 committed by GitHub
parent a513fbc395
commit a759143ae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 0 deletions

2
.github/CODEOWNERS vendored
View File

@ -205,6 +205,8 @@
/modules/services/mpdris2.nix @pjones
/modules/services/mpris-proxy.nix @ThibautMarty
/modules/services/muchsync.nix @pacien
/modules/services/network-manager-applet.nix @rycee

View File

@ -1914,6 +1914,13 @@ in
'';
}
{
time = "2021-04-28T10:00:00+00:00";
condition = hostPlatform.isLinux;
message = ''
A new service is available: 'services.mpris-proxy'.
'';
}
];
};
}

View File

@ -168,6 +168,7 @@ let
(loadModule ./services/mbsync.nix { })
(loadModule ./services/mpd.nix { })
(loadModule ./services/mpdris2.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/mpris-proxy.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/muchsync.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/network-manager-applet.nix { })
(loadModule ./services/nextcloud-client.nix { })

View File

@ -0,0 +1,32 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.mpris-proxy;
in {
meta.maintainers = [ maintainers.thibautmarty ];
options.services.mpris-proxy.enable = mkEnableOption
"a proxy forwarding Bluetooth MIDI controls via MPRIS2 to control media players";
config = mkIf cfg.enable {
systemd.user.services.mpris-proxy = {
Unit = {
Description =
"Proxy forwarding Bluetooth MIDI controls via MPRIS2 to control media players";
BindsTo = [ "bluetooth.target" ];
After = [ "bluetooth.target" ];
};
Install.WantedBy = [ "bluetooth.target" ];
Service = {
Type = "simple";
ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
};
};
}