This commit is contained in:
Peritia 2025-09-10 12:17:16 +02:00
parent fc0abdd4bb
commit aca73cdd0f
73 changed files with 3873 additions and 381 deletions

View file

@ -0,0 +1,85 @@
# CAVA (Home Module)
#
# Provides:
# - CAVA audio visualizer
# - Declarative configuration via Nix
# - Support for structured settings or raw config override
#
# Options:
# - enable → Enable CAVA (home module)
# - settings → Declarative structured configuration (default: ALSA, 60 FPS, basic colors)
# - configText → Raw configuration text (overrides settings if set)
#
# Notes:
# - Writes config to ~/.config/cava/config
# - If configText is set, settings are ignored
#
# Example:
# nyx-module.home.cava = {
# enable = true;
# settings.general.framerate = 120;
# settings.input.method = "pulse";
# };
{ config, lib, pkgs, ... }:
let
cfg = config.nyx-module.home.cava;
in
{
options.nyx-module.home.cava = {
enable = lib.mkEnableOption "Enable CAVA (home) module";
settings = lib.mkOption {
type = lib.types.attrs;
default = {
general.framerate = 60;
input.method = "alsa";
smoothing.noise_reduction = 88;
color = {
background = "#000000";
foreground = "#FFFFFF";
};
};
description = ''
Declarative CAVA settings, written to `~/.config/cava/config`.
Ignored if `configText` is set.
'';
example = {
general.framerate = 30;
input.method = "pulseaudio";
color.foreground = "#00FF00";
};
};
configText = lib.mkOption {
type = lib.types.nullOr lib.types.lines;
default = null;
description = ''
Raw CAVA configuration file contents.
If set, overrides `settings` and is written directly to `~/.config/cava/config`.
'';
example = ''
[general]
framerate = 120
[input]
method = pulse
'';
};
};
config = lib.mkIf cfg.enable {
programs.cava = {
enable = true;
package = pkgs.cava;
settings = lib.mkIf (cfg.configText == null) cfg.settings;
};
xdg.configFile."cava/config" = lib.mkIf (cfg.configText != null) {
text = cfg.configText;
};
};
}

View file

@ -2,6 +2,7 @@
{
imports = [
./cava.nix
./spotify.nix
];
}

View file

@ -1,3 +1,13 @@
# Spotify (music streaming client)
#
# Provides:
# - Spotify package (default)
# - Optional override to install a different package
#
# Notes:
# - Installs into home.packages
#
{ config, lib, pkgs, ... }:
let
@ -5,12 +15,17 @@ let
in
{
options.nyx-module.home.spotify = {
enable = lib.mkEnableOption "Enable spotify (home) module";
enable = lib.mkEnableOption "Enable Spotify (home) module";
package = lib.mkOption {
type = lib.types.package;
default = pkgs.spotify;
description = "Package to install for spotify.";
example = pkgs.ncspot;
description = ''
Package to install for Spotify support.
Defaults to the official `pkgs.spotify`, but you can override with
`pkgs.ncspot`, `pkgs.spotifyd`, or similar alternatives.
'';
};
};