{ config, lib, pkgs, ... }: with lib; let cfg = config.programs.musicutil; yamlFormat = pkgs.formats.yaml { }; in { options = { programs.musicutil = { enable = mkOption { type = types.bool; default = false; }; package = mkOption { type = types.package; default = pkgs.musicutil; }; settings = { log_level = mkOption { type = types.str; default = "info"; }; cache = mkOption { type = types.bool; default = false; }; cache_dir = mkOption { type = types.str; default = "source_dir"; }; }; }; }; config = mkIf cfg.enable { home.packages = [ cfg.package ]; xdg.configFile."musicutil.yaml".source = yamlFormat.generate "musicutil-config" cfg.settings; }; }