mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 03:09:47 +01:00
cava: add module
This commit is contained in:
parent
17ead612c6
commit
6da70f2252
7 changed files with 102 additions and 0 deletions
|
@ -1281,6 +1281,13 @@ in
|
|||
A new module is available: 'services.darkman'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2023-10-24T06:14:53+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.cava'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ let
|
|||
./programs/browserpass.nix
|
||||
./programs/btop.nix
|
||||
./programs/carapace.nix
|
||||
./programs/cava.nix
|
||||
./programs/chromium.nix
|
||||
./programs/command-not-found/command-not-found.nix
|
||||
./programs/comodoro.nix
|
||||
|
|
52
modules/programs/cava.nix
Normal file
52
modules/programs/cava.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ 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}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -70,6 +70,7 @@ import nmt {
|
|||
./modules/programs/browserpass
|
||||
./modules/programs/btop
|
||||
./modules/programs/carapace
|
||||
./modules/programs/cava
|
||||
./modules/programs/comodoro
|
||||
./modules/programs/darcs
|
||||
./modules/programs/dircolors
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
; Generated by Home Manager
|
||||
|
||||
[color]
|
||||
background='#000000'
|
||||
foreground='#ffffff'
|
||||
|
||||
[general]
|
||||
framerate=30
|
||||
|
||||
[input]
|
||||
source=alsa
|
||||
|
||||
[smoothing]
|
||||
noise_reduction=65
|
||||
|
25
tests/modules/programs/cava/cava-basic-configuration.nix
Normal file
25
tests/modules/programs/cava/cava-basic-configuration.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.cava = {
|
||||
enable = true;
|
||||
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
|
||||
settings = {
|
||||
general.framerate = 30;
|
||||
input.source = "alsa";
|
||||
smoothing.noise_reduction = 65;
|
||||
color = {
|
||||
background = "'#000000'";
|
||||
foreground = "'#ffffff'";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
configFile=home-files/.config/cava/config
|
||||
assertFileExists $configFile
|
||||
assertFileContent $configFile ${./cava-basic-configuration-expected.ini}
|
||||
'';
|
||||
}
|
1
tests/modules/programs/cava/default.nix
Normal file
1
tests/modules/programs/cava/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ cava-basic-configuration = ./cava-basic-configuration.nix; }
|
Loading…
Reference in a new issue