Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions modules/lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,12 @@
github = "silmarp";
githubId = 67292496;
};
stijnruts = {
name = "Stijn Ruts";
email = "[email protected]";
github = "StijnRuts";
githubId = 1696566;
};
Comment on lines +504 to +509
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate commit before module addition, please

swarsel = {
name = "Leon Schwarzäugl";
email = "[email protected]";
Expand Down
12 changes: 12 additions & 0 deletions modules/misc/news/2025/08/2025-08-29_11-51-35.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
time = "2025-08-29T09:51:35+00:00";
condition = true;
message = ''
A new module is available: 'programs.process-compose'

Process Compose, a simple and flexible scheduler and orchestrator
to manage non-containerized applications

The module supports configuring settings.yaml, theme.yaml, and shortcuts.yaml
'';
}
162 changes: 162 additions & 0 deletions modules/programs/process-compose.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkOption;
yamlFormat = pkgs.formats.yaml { };
in
{
meta.maintainers = [ lib.hm.maintainers.stijnruts ];

options.programs.process-compose = {
enable = lib.mkEnableOption "Process Compose, a simple and flexible scheduler and orchestrator to manage non-containerized applications";

package = lib.mkPackageOption pkgs "process-compose" { nullable = true; };

settings = mkOption {
type = yamlFormat.type;
default = { };
example = {
theme = "Cobalt";
sort = {
by = "NAME";
isReversed = false;
};
disable_exit_confirmation = false;
};
description = ''
Written to {file}`$XDG_CONFIG_HOME/process-compose/settings.yaml`
See <https://f1bonacc1.github.io/process-compose/tui/#tui-state-settings>
'';
};

theme = mkOption {
type = yamlFormat.type;
default = { };
example = {
body = {
fgColor = "white";
bgColor = "black";
secondaryTextColor = "yellow";
tertiaryTextColor = "green";
borderColor = "white";
};
stat_table = {
keyFgColor = "yellow";
valueFgColor = "white";
logoColor = "yellow";
};
proc_table = {
fgColor = "lightskyblue";
fgWarning = "yellow";
fgPending = "grey";
fgCompleted = "lightgreen";
fgError = "red";
headerFgColor = "white";
};
help = {
fgColor = "black";
keyColor = "white";
hlColor = "green";
categoryFgColor = "lightskyblue";
};
dialog = {
fgColor = "cadetblue";
bgColor = "black";
buttonFgColor = "black";
buttonBgColor = "lightskyblue";
buttonFocusFgColor = "black";
buttonFocusBgColor = "dodgerblue";
labelFgColor = "yellow";
fieldFgColor = "black";
fieldBgColor = "lightskyblue";
};
};
description = ''
Written to {file}`$XDG_CONFIG_HOME/process-compose/theme.yaml`
See <https://f1bonacc1.github.io/process-compose/tui/#tui-themes>
'';
};

shortcuts = mkOption {
type = yamlFormat.type;
default = { };
example = {
log_follow = {
toggle_description = {
false = "Follow Off";
true = "Follow On";
};
shortcut = "F5";
};
log_screen = {
toggle_description = {
false = "Half Screen";
true = "Full Screen";
};
shortcut = "F4";
};
log_wrap = {
toggle_description = {
false = "Wrap Off";
true = "Wrap On";
};
shortcut = "F6";
};
process_restart = {
description = "Restart";
shortcut = "Ctrl-R";
};
process_screen = {
toggle_description = {
false = "Half Screen";
true = "Full Screen";
};
shortcut = "F8";
};
process_start = {
description = "Start";
shortcut = "F7";
};
process_stop = {
description = "Stop";
shortcut = "F9";
};
quit = {
description = "Quit";
shortcut = "F10";
};
};
description = ''
Written to {file}`$XDG_CONFIG_HOME/process-compose/shortcuts.yaml`
See <https://f1bonacc1.github.io/process-compose/tui/#shortcuts-configuration>
'';
};
};

config =
let
cfg = config.programs.process-compose;
in
lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];

xdg.configFile = {
"process-compose/settings.yaml" = lib.mkIf (cfg.settings != { }) {
source = yamlFormat.generate "process-compose-settings" cfg.settings;
};
"process-compose/theme.yaml" = lib.mkIf (cfg.theme != { }) {
source = yamlFormat.generate "process-compose-theme" { style = cfg.theme; };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this help / confuse people trying to use the option ? Seems like it's setup as a freeform generator but that automatically nests the config.

};
"process-compose/shortcuts.yaml" = lib.mkIf (cfg.shortcuts != { }) {
source = yamlFormat.generate "process-compose-shortcuts" { shortcuts = cfg.shortcuts; };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

};
};
};
}
1 change: 1 addition & 0 deletions tests/modules/programs/process-compose/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ process-compose = ./process-compose.nix; }
5 changes: 5 additions & 0 deletions tests/modules/programs/process-compose/expected-settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
disable_exit_confirmation: false
sort:
by: NAME
isReversed: false
theme: Cobalt
33 changes: 33 additions & 0 deletions tests/modules/programs/process-compose/expected-shortcuts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
shortcuts:
log_follow:
shortcut: F5
toggle_description:
'false': Follow Off
'true': Follow On
log_screen:
shortcut: F4
toggle_description:
'false': Half Screen
'true': Full Screen
log_wrap:
shortcut: F6
toggle_description:
'false': Wrap Off
'true': Wrap On
process_restart:
description: Restart
shortcut: Ctrl-R
process_screen:
shortcut: F8
toggle_description:
'false': Half Screen
'true': Full Screen
process_start:
description: Start
shortcut: F7
process_stop:
description: Stop
shortcut: F9
quit:
description: Quit
shortcut: F10
33 changes: 33 additions & 0 deletions tests/modules/programs/process-compose/expected-theme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
style:
body:
bgColor: black
borderColor: white
fgColor: white
secondaryTextColor: yellow
tertiaryTextColor: green
dialog:
bgColor: black
buttonBgColor: lightskyblue
buttonFgColor: black
buttonFocusBgColor: dodgerblue
buttonFocusFgColor: black
fgColor: cadetblue
fieldBgColor: lightskyblue
fieldFgColor: black
labelFgColor: yellow
help:
categoryFgColor: lightskyblue
fgColor: black
hlColor: green
keyColor: white
proc_table:
fgColor: lightskyblue
fgCompleted: lightgreen
fgError: red
fgPending: grey
fgWarning: yellow
headerFgColor: white
stat_table:
keyFgColor: yellow
logoColor: yellow
valueFgColor: white
109 changes: 109 additions & 0 deletions tests/modules/programs/process-compose/process-compose.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
programs.process-compose = {
enable = true;
settings = {
theme = "Cobalt";
sort = {
by = "NAME";
isReversed = false;
};
disable_exit_confirmation = false;
};
theme = {
body = {
fgColor = "white";
bgColor = "black";
secondaryTextColor = "yellow";
tertiaryTextColor = "green";
borderColor = "white";
};
stat_table = {
keyFgColor = "yellow";
valueFgColor = "white";
logoColor = "yellow";
};
proc_table = {
fgColor = "lightskyblue";
fgWarning = "yellow";
fgPending = "grey";
fgCompleted = "lightgreen";
fgError = "red";
headerFgColor = "white";
};
help = {
fgColor = "black";
keyColor = "white";
hlColor = "green";
categoryFgColor = "lightskyblue";
};
dialog = {
fgColor = "cadetblue";
bgColor = "black";
buttonFgColor = "black";
buttonBgColor = "lightskyblue";
buttonFocusFgColor = "black";
buttonFocusBgColor = "dodgerblue";
labelFgColor = "yellow";
fieldFgColor = "black";
fieldBgColor = "lightskyblue";
};
};
shortcuts = {
log_follow = {
toggle_description = {
false = "Follow Off";
true = "Follow On";
};
shortcut = "F5";
};
log_screen = {
toggle_description = {
false = "Half Screen";
true = "Full Screen";
};
shortcut = "F4";
};
log_wrap = {
toggle_description = {
false = "Wrap Off";
true = "Wrap On";
};
shortcut = "F6";
};
process_restart = {
description = "Restart";
shortcut = "Ctrl-R";
};
process_screen = {
toggle_description = {
false = "Half Screen";
true = "Full Screen";
};
shortcut = "F8";
};
process_start = {
description = "Start";
shortcut = "F7";
};
process_stop = {
description = "Stop";
shortcut = "F9";
};
quit = {
description = "Quit";
shortcut = "F10";
};
};
};

nmt.script = ''
assertFileExists home-files/.config/process-compose/settings.yaml
assertFileContent home-files/.config/process-compose/settings.yaml ${./expected-settings.yaml}

assertFileExists home-files/.config/process-compose/theme.yaml
assertFileContent home-files/.config/process-compose/theme.yaml ${./expected-theme.yaml}

assertFileExists home-files/.config/process-compose/shortcuts.yaml
assertFileContent home-files/.config/process-compose/shortcuts.yaml ${./expected-shortcuts.yaml}
'';
}