dotfiles/modules/home/mpd.nix
eriedaberrie dd0127693f Initial commit
Note: not the actual initial commit.

I swear I will stop repeatedly force pushing to this single commit eventually
ok.
2024-08-23 10:57:18 -07:00

45 lines
930 B
Nix

{ pkgs, config, lib, osConfig, ... }:
let
cfg = config.my.mpd;
in {
options.my.mpd = {
enable = lib.mkEnableOption null;
usePipewire = lib.mkEnableOption null // {
default = true;
};
ncmpcpp = {
enable = lib.mkEnableOption null;
};
};
config = lib.mkIf cfg.enable {
services.mpd = {
enable = true;
extraConfig = ''
restore_paused "yes"
zeroconf_enabled "no"
${lib.optionalString cfg.usePipewire ''
audio_output {
type "pipewire"
name "Pipewire Sound Server"
mixer_type "hardware"
replay_gain_handler "none"
}
''}
'';
};
home.packages = [ pkgs.mpc-cli ];
programs.ncmpcpp = lib.mkIf cfg.ncmpcpp.enable {
enable = true;
settings = {
mpd_host = "127.0.0.1";
mpd_port = config.services.mpd.network.port;
};
};
};
}