Skip to content

Commit 227fbbe

Browse files
author
Stijn Ruts
committed
process-compose: Add programs.process-compose module
Allow configuring settings.yaml, theme.yaml, and shortcuts.yaml Remove unused variables Fix maintainers
1 parent 77f348d commit 227fbbe

File tree

8 files changed

+361
-0
lines changed

8 files changed

+361
-0
lines changed

modules/lib/maintainers.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,12 @@
501501
github = "silmarp";
502502
githubId = 67292496;
503503
};
504+
stijnruts = {
505+
name = "Stijn Ruts";
506+
email = "[email protected]";
507+
github = "StijnRuts";
508+
githubId = 1696566;
509+
};
504510
swarsel = {
505511
name = "Leon Schwarzäugl";
506512
email = "[email protected]";
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
time = "2025-08-29T09:51:35+00:00";
3+
condition = true;
4+
message = ''
5+
A new module is available: 'programs.process-compose'
6+
7+
Process Compose, a simple and flexible scheduler and orchestrator
8+
to manage non-containerized applications
9+
10+
The module supports configuring settings.yaml, theme.yaml, and shortcuts.yaml
11+
'';
12+
}
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
7+
let
8+
inherit (lib) mkOption;
9+
yamlFormat = pkgs.formats.yaml { };
10+
in
11+
{
12+
meta.maintainers = [ lib.hm.maintainers.stijnruts ];
13+
14+
options.programs.process-compose = {
15+
enable = lib.mkEnableOption "Process Compose, a simple and flexible scheduler and orchestrator to manage non-containerized applications";
16+
17+
package = lib.mkPackageOption pkgs "process-compose" { nullable = true; };
18+
19+
settings = mkOption {
20+
type = yamlFormat.type;
21+
default = { };
22+
example = {
23+
theme = "Cobalt";
24+
sort = {
25+
by = "NAME";
26+
isReversed = false;
27+
};
28+
disable_exit_confirmation = false;
29+
};
30+
description = ''
31+
Written to {file}`$XDG_CONFIG_HOME/process-compose/settings.yaml`
32+
33+
See <https://f1bonacc1.github.io/process-compose/tui/#tui-state-settings>
34+
'';
35+
};
36+
37+
theme = mkOption {
38+
type = yamlFormat.type;
39+
default = { };
40+
example = {
41+
body = {
42+
fgColor = "white";
43+
bgColor = "black";
44+
secondaryTextColor = "yellow";
45+
tertiaryTextColor = "green";
46+
borderColor = "white";
47+
};
48+
stat_table = {
49+
keyFgColor = "yellow";
50+
valueFgColor = "white";
51+
logoColor = "yellow";
52+
};
53+
proc_table = {
54+
fgColor = "lightskyblue";
55+
fgWarning = "yellow";
56+
fgPending = "grey";
57+
fgCompleted = "lightgreen";
58+
fgError = "red";
59+
headerFgColor = "white";
60+
};
61+
help = {
62+
fgColor = "black";
63+
keyColor = "white";
64+
hlColor = "green";
65+
categoryFgColor = "lightskyblue";
66+
};
67+
dialog = {
68+
fgColor = "cadetblue";
69+
bgColor = "black";
70+
buttonFgColor = "black";
71+
buttonBgColor = "lightskyblue";
72+
buttonFocusFgColor = "black";
73+
buttonFocusBgColor = "dodgerblue";
74+
labelFgColor = "yellow";
75+
fieldFgColor = "black";
76+
fieldBgColor = "lightskyblue";
77+
};
78+
};
79+
description = ''
80+
Written to {file}`$XDG_CONFIG_HOME/process-compose/theme.yaml`
81+
82+
See <https://f1bonacc1.github.io/process-compose/tui/#tui-themes>
83+
'';
84+
};
85+
86+
shortcuts = mkOption {
87+
type = yamlFormat.type;
88+
default = { };
89+
example = {
90+
log_follow = {
91+
toggle_description = {
92+
false = "Follow Off";
93+
true = "Follow On";
94+
};
95+
shortcut = "F5";
96+
};
97+
log_screen = {
98+
toggle_description = {
99+
false = "Half Screen";
100+
true = "Full Screen";
101+
};
102+
shortcut = "F4";
103+
};
104+
log_wrap = {
105+
toggle_description = {
106+
false = "Wrap Off";
107+
true = "Wrap On";
108+
};
109+
shortcut = "F6";
110+
};
111+
process_restart = {
112+
description = "Restart";
113+
shortcut = "Ctrl-R";
114+
};
115+
process_screen = {
116+
toggle_description = {
117+
false = "Half Screen";
118+
true = "Full Screen";
119+
};
120+
shortcut = "F8";
121+
};
122+
process_start = {
123+
description = "Start";
124+
shortcut = "F7";
125+
};
126+
process_stop = {
127+
description = "Stop";
128+
shortcut = "F9";
129+
};
130+
quit = {
131+
description = "Quit";
132+
shortcut = "F10";
133+
};
134+
};
135+
description = ''
136+
Written to {file}`$XDG_CONFIG_HOME/process-compose/shortcuts.yaml`
137+
138+
See <https://f1bonacc1.github.io/process-compose/tui/#shortcuts-configuration>
139+
'';
140+
};
141+
};
142+
143+
config =
144+
let
145+
cfg = config.programs.process-compose;
146+
in
147+
lib.mkIf cfg.enable {
148+
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
149+
150+
xdg.configFile = {
151+
"process-compose/settings.yaml" = lib.mkIf (cfg.settings != { }) {
152+
source = yamlFormat.generate "process-compose-settings" cfg.settings;
153+
};
154+
"process-compose/theme.yaml" = lib.mkIf (cfg.theme != { }) {
155+
source = yamlFormat.generate "process-compose-theme" { style = cfg.theme; };
156+
};
157+
"process-compose/shortcuts.yaml" = lib.mkIf (cfg.shortcuts != { }) {
158+
source = yamlFormat.generate "process-compose-shortcuts" { shortcuts = cfg.shortcuts; };
159+
};
160+
};
161+
};
162+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ process-compose = ./process-compose.nix; }
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
disable_exit_confirmation: false
2+
sort:
3+
by: NAME
4+
isReversed: false
5+
theme: Cobalt
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
shortcuts:
2+
log_follow:
3+
shortcut: F5
4+
toggle_description:
5+
'false': Follow Off
6+
'true': Follow On
7+
log_screen:
8+
shortcut: F4
9+
toggle_description:
10+
'false': Half Screen
11+
'true': Full Screen
12+
log_wrap:
13+
shortcut: F6
14+
toggle_description:
15+
'false': Wrap Off
16+
'true': Wrap On
17+
process_restart:
18+
description: Restart
19+
shortcut: Ctrl-R
20+
process_screen:
21+
shortcut: F8
22+
toggle_description:
23+
'false': Half Screen
24+
'true': Full Screen
25+
process_start:
26+
description: Start
27+
shortcut: F7
28+
process_stop:
29+
description: Stop
30+
shortcut: F9
31+
quit:
32+
description: Quit
33+
shortcut: F10
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
style:
2+
body:
3+
bgColor: black
4+
borderColor: white
5+
fgColor: white
6+
secondaryTextColor: yellow
7+
tertiaryTextColor: green
8+
dialog:
9+
bgColor: black
10+
buttonBgColor: lightskyblue
11+
buttonFgColor: black
12+
buttonFocusBgColor: dodgerblue
13+
buttonFocusFgColor: black
14+
fgColor: cadetblue
15+
fieldBgColor: lightskyblue
16+
fieldFgColor: black
17+
labelFgColor: yellow
18+
help:
19+
categoryFgColor: lightskyblue
20+
fgColor: black
21+
hlColor: green
22+
keyColor: white
23+
proc_table:
24+
fgColor: lightskyblue
25+
fgCompleted: lightgreen
26+
fgError: red
27+
fgPending: grey
28+
fgWarning: yellow
29+
headerFgColor: white
30+
stat_table:
31+
keyFgColor: yellow
32+
logoColor: yellow
33+
valueFgColor: white
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
programs.process-compose = {
3+
enable = true;
4+
settings = {
5+
theme = "Cobalt";
6+
sort = {
7+
by = "NAME";
8+
isReversed = false;
9+
};
10+
disable_exit_confirmation = false;
11+
};
12+
theme = {
13+
body = {
14+
fgColor = "white";
15+
bgColor = "black";
16+
secondaryTextColor = "yellow";
17+
tertiaryTextColor = "green";
18+
borderColor = "white";
19+
};
20+
stat_table = {
21+
keyFgColor = "yellow";
22+
valueFgColor = "white";
23+
logoColor = "yellow";
24+
};
25+
proc_table = {
26+
fgColor = "lightskyblue";
27+
fgWarning = "yellow";
28+
fgPending = "grey";
29+
fgCompleted = "lightgreen";
30+
fgError = "red";
31+
headerFgColor = "white";
32+
};
33+
help = {
34+
fgColor = "black";
35+
keyColor = "white";
36+
hlColor = "green";
37+
categoryFgColor = "lightskyblue";
38+
};
39+
dialog = {
40+
fgColor = "cadetblue";
41+
bgColor = "black";
42+
buttonFgColor = "black";
43+
buttonBgColor = "lightskyblue";
44+
buttonFocusFgColor = "black";
45+
buttonFocusBgColor = "dodgerblue";
46+
labelFgColor = "yellow";
47+
fieldFgColor = "black";
48+
fieldBgColor = "lightskyblue";
49+
};
50+
};
51+
shortcuts = {
52+
log_follow = {
53+
toggle_description = {
54+
false = "Follow Off";
55+
true = "Follow On";
56+
};
57+
shortcut = "F5";
58+
};
59+
log_screen = {
60+
toggle_description = {
61+
false = "Half Screen";
62+
true = "Full Screen";
63+
};
64+
shortcut = "F4";
65+
};
66+
log_wrap = {
67+
toggle_description = {
68+
false = "Wrap Off";
69+
true = "Wrap On";
70+
};
71+
shortcut = "F6";
72+
};
73+
process_restart = {
74+
description = "Restart";
75+
shortcut = "Ctrl-R";
76+
};
77+
process_screen = {
78+
toggle_description = {
79+
false = "Half Screen";
80+
true = "Full Screen";
81+
};
82+
shortcut = "F8";
83+
};
84+
process_start = {
85+
description = "Start";
86+
shortcut = "F7";
87+
};
88+
process_stop = {
89+
description = "Stop";
90+
shortcut = "F9";
91+
};
92+
quit = {
93+
description = "Quit";
94+
shortcut = "F10";
95+
};
96+
};
97+
};
98+
99+
nmt.script = ''
100+
assertFileExists home-files/.config/process-compose/settings.yaml
101+
assertFileContent home-files/.config/process-compose/settings.yaml ${./expected-settings.yaml}
102+
103+
assertFileExists home-files/.config/process-compose/theme.yaml
104+
assertFileContent home-files/.config/process-compose/theme.yaml ${./expected-theme.yaml}
105+
106+
assertFileExists home-files/.config/process-compose/shortcuts.yaml
107+
assertFileContent home-files/.config/process-compose/shortcuts.yaml ${./expected-shortcuts.yaml}
108+
'';
109+
}

0 commit comments

Comments
 (0)