1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 03:29:45 +01:00
home-manager/modules/programs/cava.nix
2023-10-24 08:20:22 +02: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}
'';
};
};
}