depot/third_party/home-manager/modules/programs/cava.nix
Default email c6444ecc3c Project import generated by Copybara.
GitOrigin-RevId: 51e44a13acea71b36245e8bd8c7db53e0a3e61ee
2024-01-05 12:06:15 +01:00

52 lines
1.1 KiB
Nix

{ 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}
'';
};
};
}