musicutil/hm-module.nix

35 lines
667 B
Nix
Raw Normal View History

2022-02-22 14:02:58 +00:00
{ 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.nullOr types.package;
default = null;
};
settings = {
logLevel = mkOption {
type = types.str;
default = "info";
};
};
};
};
config = mkIf cfg.enable {
2022-02-22 14:15:10 +00:00
home.packages = [cfg.package];
2022-02-22 14:02:58 +00:00
xdg.configFile."musicutil.yaml".source =
yamlFormat.generate "musicutil-config" cfg.settings;
};
}