playerctld: add module
This commit is contained in:
parent
98d030f723
commit
df7d81b0b3
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
|
@ -209,6 +209,9 @@
|
|||
|
||||
/modules/services/plan9port.nix @ehmry
|
||||
|
||||
/modules/services/playerctld.nix @fendse
|
||||
/tests/modules/playerctld @fendse
|
||||
|
||||
/modules/services/pulseeffects.nix @jonringer
|
||||
|
||||
/modules/services/random-background.nix @rycee
|
||||
|
|
|
@ -53,4 +53,10 @@
|
|||
github = "thiagokokada";
|
||||
githubId = 844343;
|
||||
};
|
||||
fendse = {
|
||||
email = "46252070+Fendse@users.noreply.github.com";
|
||||
github = "Fendse";
|
||||
githubId = 46252070;
|
||||
name = "Sara Johnsson";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1814,6 +1814,14 @@ in
|
|||
A new module is available: 'services.plan9port'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-01-31T11:23:30+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.playerctld'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -175,6 +175,7 @@ let
|
|||
(loadModule ./services/pbgopy.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/picom.nix { })
|
||||
(loadModule ./services/plan9port.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/playerctld.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/polybar.nix { })
|
||||
(loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/random-background.nix { })
|
||||
|
|
36
modules/services/playerctld.nix
Normal file
36
modules/services/playerctld.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.playerctld;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.fendse ];
|
||||
|
||||
options.services.playerctld = {
|
||||
enable = mkEnableOption "playerctld daemon";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.playerctl;
|
||||
defaultText = literalExample "pkgs.playerctl";
|
||||
description = "The playerctl package to use.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user.services.playerctld = {
|
||||
Unit.Description = "MPRIS media player daemon";
|
||||
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/playerctld";
|
||||
Type = "dbus";
|
||||
BusName = "org.mpris.MediaPlayer2.playerctld";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -102,6 +102,7 @@ import nmt {
|
|||
./modules/services/lieer
|
||||
./modules/services/redshift-gammastep
|
||||
./modules/services/pbgopy
|
||||
./modules/services/playerctld
|
||||
./modules/services/polybar
|
||||
./modules/services/sxhkd
|
||||
./modules/services/window-managers/i3
|
||||
|
|
31
tests/modules/services/playerctld/basic.nix
Normal file
31
tests/modules/services/playerctld/basic.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
services.playerctld.enable = true;
|
||||
services.playerctld.package = pkgs.writeScriptBin "playerctld" "" // {
|
||||
outPath = "@playerctld@";
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile=home-files/.config/systemd/user/playerctld.service
|
||||
|
||||
assertFileExists "$serviceFile"
|
||||
|
||||
assertFileContent "$serviceFile" "${
|
||||
pkgs.writeText "playerctld-test" ''
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
[Service]
|
||||
BusName=org.mpris.MediaPlayer2.playerctld
|
||||
ExecStart=@playerctld@/bin/playerctld
|
||||
Type=dbus
|
||||
|
||||
[Unit]
|
||||
Description=MPRIS media player daemon
|
||||
''
|
||||
}"
|
||||
'';
|
||||
};
|
||||
}
|
1
tests/modules/services/playerctld/default.nix
Normal file
1
tests/modules/services/playerctld/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ playerctld-basic = ./basic.nix; }
|
Loading…
Reference in a new issue