mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-18 22:33:00 +00:00
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
52 lines
1.1 KiB
Nix
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" { nullable = true; };
|
|
|
|
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 = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
xdg.configFile."cava/config" = mkIf (cfg.settings != { }) {
|
|
text = ''
|
|
; Generated by Home Manager
|
|
|
|
${generators.toINI { } cfg.settings}
|
|
'';
|
|
};
|
|
};
|
|
}
|