mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
33 lines
653 B
Nix
33 lines
653 B
Nix
|
{
|
||
|
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 ];
|
||
|
}
|