playerctl: add daemon service

This commit is contained in:
Alexandre Acebedo 2024-06-09 08:53:08 +02:00 committed by h7x4
parent 85d0639f0f
commit 14422223df
No known key found for this signature in database
GPG Key ID: 9F2F7D8250F35146
2 changed files with 33 additions and 0 deletions

View File

@ -487,6 +487,7 @@
./services/desktops/espanso.nix
./services/desktops/flatpak.nix
./services/desktops/geoclue2.nix
./services/desktops/playerctld.nix
./services/desktops/gnome/at-spi2-core.nix
./services/desktops/gnome/evolution-data-server.nix
./services/desktops/gnome/glib-networking.nix

View File

@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.playerctld;
in
{
options.services.playerctld = {
enable = lib.mkEnableOption "the playerctld daemon";
package = lib.mkPackageOption pkgs "playerctl" { };
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
systemd.user.services.playerctld = {
description = "Playerctld daemon to track media player activity";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "exec";
ExecStart = "${cfg.package}/bin/playerctld";
};
};
};
meta.maintainers = with lib.maintainers; [ aacebedo ];
}