1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 08:49:44 +01:00
home-manager/modules/programs/cava.nix

53 lines
1.1 KiB
Nix
Raw Normal View History

2023-06-16 21:38:29 +02:00
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.programs.cava;
iniFmt = pkgs.formats.ini { };
in {
meta.maintainers = [ maintainers.bddvlpr ];
options.programs.cava = {
enable = mkEnableOption "Cava audio visualizer";
package = mkPackageOption pkgs "cava" { };
settings = mkOption {
type = iniFmt.type;
default = { };
example = literalExpression ''
{
general.framerate = 60;
input.method = "alsa";
smoothing.noise_reduction = 88;
color = {
background = "'#000000'";
foreground = "'#FFFFFF'";
};
}
'';
description = ''
Settings to be written to the Cava configuration file. See
<https://github.com/karlstav/cava/blob/master/example_files/config> for
all available options.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."cava/config" = mkIf (cfg.settings != { }) {
text = ''
; Generated by Home Manager
${generators.toINI { } cfg.settings}
'';
};
};
}