style waybar, add mpd module, other fixes

This commit is contained in:
tristan 2023-09-07 16:17:35 +01:00
parent 32500bffd0
commit ce1c48b4a4
8 changed files with 121 additions and 92 deletions

32
lib/modules/mpd.nix Normal file
View file

@ -0,0 +1,32 @@
{ user }: { lib, pkgs, config, ... }:
with lib;
let
cfg = config.roles.mpd;
in
{
options.roles.mpd = {
enable = mkEnableOption "setup mpd client";
host = mkOption {default = "music.local";};
};
config = mkIf cfg.enable {
home-manager.users.${user}.imports = [{
programs.ncmpcpp = {
enable = true;
settings.mpd_host = cfg.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 = cfg.host;
};
}];
};
}