{ config, lib, pkgs, ... }: with lib; let cfg = config.programs.ncmpcpp; in { options.programs.ncmpcpp = { enable = mkEnableOption "Featureful ncurses based MPD client inspired by ncmpc"; settings = lib.mkOption { type = types.attrs; default = {}; description = '' Configuration for ncmpcpp, see for supported values. ''; }; }; config = mkIf cfg.enable { home.packages = [ pkgs.ncmpcpp ]; # all these are defaults from the above referenced config file programs.ncmpcpp.settings = { mpdMusicDir = "~/music"; lyricsDir = "~/.lyrics"; mpdHost = "localhost"; mouseSupport = "yes"; mpdPort = 6630; userInterface = "alternative"; }; xdg.configFile."ncmpcpp/config".text = '' mpd_music_dir = ${cfg.settings.mpdMusicDir} lyrics_directory = ${cfg.settings.lyricsDir} mpd_host = ${cfg.settings.mpdHost} mpd_port = ${toString cfg.settings.mpdPort} user_interface = ${cfg.settings.userInterface} ''; }; }