mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
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>
53 lines
1.2 KiB
Nix
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}
|
|
'';
|
|
};
|
|
};
|
|
}
|