-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
process-compose: Add programs.process-compose module #7736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -501,6 +501,12 @@ | |
| github = "silmarp"; | ||
| githubId = 67292496; | ||
| }; | ||
| stijnruts = { | ||
| name = "Stijn Ruts"; | ||
| email = "[email protected]"; | ||
| github = "StijnRuts"; | ||
| githubId = 1696566; | ||
| }; | ||
| swarsel = { | ||
| name = "Leon Schwarzäugl"; | ||
| email = "[email protected]"; | ||
|
|
||
| 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 | ||
| ''; | ||
| } |
| 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; }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
| }; | ||
| }; | ||
| }; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { process-compose = ./process-compose.nix; } |
| 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 |
| 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 |
| 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 |
| 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} | ||
| ''; | ||
| } |
There was a problem hiding this comment.
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