nix/home/programs/mpd.nix
2025-04-29 02:08:33 +01:00

69 lines
1.3 KiB
Nix

{
lib,
pkgs,
config,
...
}: let
terminal = config.programs.terminal;
termcmd = "${terminal}/bin/${terminal.pname}";
host = "alpine";
in {
programs.ncmpcpp = {
enable = true;
settings.mpd_host = host;
bindings = [
{
key = "j";
command = "scroll_down";
}
{
key = "k";
command = "scroll_up";
}
{
key = "l";
command = "next_column";
}
{
key = "h";
command = "previous_column";
}
{
key = "J";
command = ["select_item" "scroll_down"];
}
{
key = "K";
command = ["select_item" "scroll_up"];
}
];
};
services.mpd-mpris = {
enable = true;
mpd.host = host;
};
programs.waybar.settings.mainBar.mpd.server = host;
programs.scripts = [
{
name = "ncmpcpp";
text = ''
${termcmd} -e ${pkgs.ncmpcpp}/bin/ncmpcpp
'';
hotkeys = [{key = "M";}];
install = false;
}
];
systemd.user.services = {
snapclient = {
Unit = {
Description = "Snapclient";
};
Service = {
ExecStart = "${pkgs.snapcast}/bin/snapclient -h ${host}";
};
Install = {
WantedBy = ["graphical-session.target"];
};
};
};
}