1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00
home-manager/modules/programs/cava.nix
Austin Horstman 86402a17b6 treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce
conflicts with other PRs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-23 16:20:26 -05:00

53 lines
1.2 KiB
Nix

{
pkgs,
config,
lib,
...
}:
let
cfg = config.programs.cava;
iniFmt = pkgs.formats.ini { };
in
{
meta.maintainers = [ lib.maintainers.bddvlpr ];
options.programs.cava = {
enable = lib.mkEnableOption "Cava audio visualizer";
package = lib.mkPackageOption pkgs "cava" { nullable = true; };
settings = lib.mkOption {
type = iniFmt.type;
default = { };
example = lib.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 = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."cava/config" = lib.mkIf (cfg.settings != { }) {
text = ''
; Generated by Home Manager
${lib.generators.toINI { } cfg.settings}
'';
};
};
}