Skip to content

Commit

Permalink
Add cli.environment.PC_DISABLE_TUI
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Oct 21, 2024
1 parent fb01664 commit 9148cf5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
- #81, #84: Support for specifying process-compose global CLI options
- **Breaking changes**:
- `preHook` and `postHook` are now inside `cli` module.
- Old options `httpServer` and `tui` were removed; users should use the new `cli` module to set all process-compose cli arguments and options.
- Old options `httpServer` and `tui` were removed; users should use the new `cli` module to set all process-compose cli global options. TUI can be disabled using `cli.environment.PC_DISABLE_TUI = true;`
- ~~#18: Add `testScript` option for adding flake checks based on nixosTest library.~~
- #39: Allow `test` process to act as a test, which then gets run as part of flake checks.
- #55: Add `lib` flake output - library of useful functions
- #80: Add `evalModules`, to use process-compose-flake without flake-parts
- New options
- #52: Add `is_foreground` option
- ~~#54: Add `apiServer` option to control REST API server~~
- $60: Add `httpServer.{enable, port, uds}` options to control the HTTP server.
- ~~$60: Add `httpServer.{enable, port, uds}` options to control the HTTP server.~~
- #56: Add `preHook` and `postHook` for running commands before and after launching process-compose respectively.
- #67: Add `ready_log_line`
- #226: Add `availability.exit_on_skipped`
Expand Down
1 change: 1 addition & 0 deletions example/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
in
{
cli = {
# environment.PC_DISABLE_TUI = true;
# Global options for `process-compose`
options = {
no-server = true;
Expand Down
24 changes: 24 additions & 0 deletions nix/process-compose/cli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ in
default = "";
description = "Shell commands to run after process-compose completes.";
};
environment = mkOption {
default = { };
description = "Environment variables to pass to process-compose binary.";
type = types.submodule {
options = {
PC_DISABLE_TUI = mkOption {
type = types.nullOr types.bool;
default = null;
description = "Disable the TUI (Text User Interface) of process-compose";
};
};
};
};
options = mkOption {
description = "CLI options to pass to process-compose binary";
default = { };
Expand Down Expand Up @@ -76,6 +89,17 @@ in
++ (lib.optionals o.use-uds [ "--use-uds" ])
);
};

environment = lib.mkOption {
type = types.str;
description = "Shell script prefix setting environment variables";
readOnly = true;
default =
lib.concatStringsSep " " (lib.mapAttrsToList
(name: value:
if value == null then "" else "${name}=${builtins.toJSON value}")
config.cli.environment);
};
};
};
};
Expand Down
4 changes: 3 additions & 1 deletion nix/process-compose/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ in
${preHook}
run-process-compose () {
set -x; process-compose ${cliOutputs.options} --config ${configFile} "$@"; set +x
set -x
${cliOutputs.environment} process-compose ${cliOutputs.options} --config ${configFile} "$@"
set +x
}
run-process-compose "$@"
Expand Down

0 comments on commit 9148cf5

Please sign in to comment.