Skip to content

Commit 9596dec

Browse files
committed
treewide: simplify and standardize testbeds
Simplify and standardize testbeds by replacing config.stylix.testbed.ui.application declarations with config.stylix.testbed.ui.command, and replacing stylix.testbed.ui.command = { packages = [ package ]; text = package.meta.mainProgram; }; with stylix.testbed.ui.command.packages = [ package ]; by trivially deducing config.stylix.testbed.ui.command.text from config.stylix.testbed.ui.command.packages. Leverage the default programs."<PACKAGE">.package value to simplify let package = pkgs."<PACKAGE>"; in { stylix.testbed.ui.command.packages = [ package ]; home-manager.sharedModules = lib.singleton { programs."<PACKAGE>" = { inherit package; enable = true; }; }; } to { stylix.testbed.ui.command.text = "<PACKAGE_META_MAIN_PROGRAM>"; home-manager.sharedModules = lib.singleton { programs."<PACKAGE>".enable = true; }; } Minor stylistic changes are made to standardize testbed declarations.
1 parent 78de305 commit 9596dec

File tree

54 files changed

+230
-449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+230
-449
lines changed

doc/src/testbeds.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ uses.
3636
graphical environments.
3737
- `command` takes a command to be run once the graphical environment
3838
has loaded
39-
- `text` takes the string of the command
39+
- `packages` are forwarded to `environment.systemPackages`
40+
- `text` takes the string of the command, which is deduced from
41+
`config.stylix.testbed.ui.command.packages` when it contains one
42+
package.
4043
- `useTerminal` takes a boolean which determines whether the command
4144
should be run in a terminal
42-
- `application` takes a desktop application to be run once the graphical
43-
environment has loaded. If one of its suboptions is set, all must be.
44-
- `name` takes the string name of the desktop application
45-
- `package` takes the package which provides the `.desktop` file
4645

4746
### Home Manager
4847

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
{ lib, pkgs, ... }:
2-
let
3-
package = pkgs.alacritty;
4-
in
1+
{ lib, ... }:
52
{
6-
stylix.testbed.ui.application = {
7-
name = "Alacritty";
8-
inherit package;
9-
};
3+
stylix.testbed.ui.command.text = "alacritty";
104

115
home-manager.sharedModules = lib.singleton {
12-
programs.alacritty = {
13-
enable = true;
14-
inherit package;
15-
};
6+
programs.alacritty.enable = true;
167
};
178
}

modules/ashell/testbeds/ashell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{ lib, ... }:
22
{
33
stylix.testbed.ui = {
4-
graphicalEnvironment = "hyprland";
54
command.text = "ashell";
5+
graphicalEnvironment = "hyprland";
66
};
77

88
home-manager.sharedModules = lib.singleton {

modules/bat/testbeds/bat.nix

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
{ lib, pkgs, ... }:
2-
let
3-
package = pkgs.bat;
4-
in
1+
{ lib, ... }:
52
{
6-
environment = {
7-
loginShellInit = "${lib.getExe package} flake-parts/flake.nix";
8-
systemPackages = [ package ];
3+
stylix.testbed.ui.command = {
4+
text = "bat flake-parts/flake.nix";
5+
useTerminal = true;
6+
};
7+
8+
home-manager.sharedModules = lib.singleton {
9+
programs.bat.enable = true;
910
};
1011
}
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
{ pkgs, ... }:
2-
let
3-
package = pkgs.blender;
4-
in
52
{
6-
stylix.testbed.ui.application = {
7-
name = "blender";
8-
inherit package;
9-
};
10-
11-
environment.systemPackages = [ package ];
3+
stylix.testbed.ui.command.packages = [ pkgs.blender ];
124
}

modules/bspwm/testbeds/bspwm.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
{ pkgs, ... }:
22
{
33
stylix.testbed.ui = {
4+
command.packages = [ pkgs.kitty ];
45
graphicalEnvironment = "bspwm";
5-
6-
# We need something to open a window so that we can check the window borders
7-
application = {
8-
name = "kitty";
9-
package = pkgs.kitty;
10-
};
116
};
127
}

modules/btop/testbeds/btop.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{ lib, pkgs, ... }:
1+
{ lib, ... }:
22
{
33
stylix.testbed.ui.command = {
4-
text = lib.getExe pkgs.btop;
4+
text = "btop";
55
useTerminal = true;
66
};
77

modules/cava/testbeds/cava-rainbow.nix

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{ lib, pkgs, ... }:
22
{
33
stylix.testbed.ui.command = {
4-
text = ''
5-
${lib.getExe' pkgs.alsa-utils "aplay"} /dev/urandom &
6-
${lib.getExe pkgs.cava}
7-
'';
4+
packages = [ pkgs.alsa-utils ];
5+
text = "aplay /dev/urandom & cava";
86
useTerminal = true;
97
};
108

modules/cava/testbeds/cava.nix

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{ lib, pkgs, ... }:
22
{
33
stylix.testbed.ui.command = {
4-
text = ''
5-
${lib.getExe' pkgs.alsa-utils "aplay"} /dev/urandom &
6-
${lib.getExe pkgs.cava}
7-
'';
4+
packages = [ pkgs.alsa-utils ];
5+
text = "aplay /dev/urandom & cava";
86
useTerminal = true;
97
};
108

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
{ lib, pkgs, ... }:
2-
let
3-
package = pkgs.cavalier;
4-
in
52
{
6-
stylix.testbed.ui.application = {
7-
name = "org.nickvision.cavalier";
8-
inherit package;
9-
};
3+
stylix.testbed.ui.command.text = pkgs.cavalier.meta.mainProgram;
104

115
home-manager.sharedModules = lib.singleton {
12-
programs.cavalier = {
13-
enable = true;
14-
inherit package;
15-
};
6+
programs.cavalier.enable = true;
167
};
178
}

0 commit comments

Comments
 (0)