File tree Expand file tree Collapse file tree
tests/modules/programs/wiremix Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ { pkgs , ... } :
2+ {
3+ time = "2026-05-08T12:07:08+00:00" ;
4+ condition = pkgs . stdenv . hostPlatform . isLinux ;
5+ message = ''
6+ A new module is available `programs.wiremix`
7+
8+ A simple TUI mixer for PipeWire.
9+ '' ;
10+ }
Original file line number Diff line number Diff line change 1+ {
2+ config ,
3+ lib ,
4+ pkgs ,
5+ ...
6+ } :
7+ let
8+ inherit ( lib )
9+ hm
10+ mkIf
11+ mkEnableOption
12+ mkOption
13+ mkPackageOption
14+ platforms
15+ ;
16+
17+ cfg = config . programs . wiremix ;
18+ tomlFormat = pkgs . formats . toml { } ;
19+ in
20+ {
21+ meta . maintainers = [ hm . maintainers . rachitvrma ] ;
22+
23+ options . programs . wiremix = {
24+ enable = mkEnableOption "wiremix" ;
25+
26+ package = mkPackageOption pkgs "wiremix" { nullable = true ; } ;
27+
28+ settings = mkOption {
29+ inherit ( tomlFormat ) type ;
30+
31+ default = { } ;
32+
33+ example = lib . literalExpression ''
34+ {
35+ mouse = false;
36+ peaks = "auto";
37+ theme = "default";
38+ max_volume_percent = 100.0;
39+ }
40+ '' ;
41+
42+ description = ''
43+ Configuration written to
44+ {file}`$XDG_CONFIG_HOME/wiremix/wiremix.toml`
45+
46+ See <https://github.com/tsowell/wiremix#configuration> for more
47+ information.
48+ '' ;
49+ } ;
50+
51+ } ;
52+ config = mkIf cfg . enable {
53+ assertions = [
54+ ( hm . assertions . assertPlatform "programs.wiremix" pkgs platforms . linux )
55+ ] ;
56+
57+ home . packages = mkIf ( cfg . package != null ) [ cfg . package ] ;
58+
59+ xdg . configFile . "wiremix/wiremix.toml" = mkIf ( cfg . settings != { } ) {
60+ source = tomlFormat . generate "hm_wiremix.toml" cfg . settings ;
61+ } ;
62+ } ;
63+ }
Original file line number Diff line number Diff line change 1+ { lib , pkgs , ... } :
2+ lib . optionalAttrs pkgs . stdenv . hostPlatform . isLinux {
3+ wiremix = ./wiremix.nix ;
4+ }
Original file line number Diff line number Diff line change 1+ max_volume_percent = 100.0
2+ mouse = false
3+ peaks = " auto"
4+ theme = " default"
Original file line number Diff line number Diff line change 1+ {
2+ programs . wiremix = {
3+ enable = true ;
4+ settings = {
5+ mouse = false ;
6+ peaks = "auto" ;
7+ theme = "default" ;
8+ max_volume_percent = 100.0 ;
9+ } ;
10+ } ;
11+
12+ nmt . script = ''
13+ assertFileExists home-files/.config/wiremix/wiremix.toml
14+ assertFileContent home-files/.config/wiremix/wiremix.toml ${ ./expected.toml }
15+ '' ;
16+ }
You can’t perform that action at this time.
0 commit comments