diff options
| author | Anthony Oleinik <[email protected]> | 2024-03-14 01:59:47 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-03-14 04:59:47 -0400 |
| commit | 528943263040c9f383361b1a37a3ee4db66412af (patch) | |
| tree | ff93492146018fa1df1f2cf5f7f19ce324b055ad /default.nix | |
| parent | b7813d224e7630de289d587c90e444c76f3330a0 (diff) | |
Add support for other procfile runners (#5)
* WIP
* WIP
* WIP
* done
* done
* fix CI
* fix CI
* refactor: default to overmind in mkProcfileRunner
* module: cleanup option docs
* refactor: cleanup multi-test suite
---------
Co-authored-by: seth <[email protected]>
Diffstat (limited to 'default.nix')
| -rw-r--r-- | default.nix | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/default.nix b/default.nix index ad898a9..8a0e155 100644 --- a/default.nix +++ b/default.nix @@ -21,17 +21,32 @@ in lib.concatLines ( lib.mapAttrsToList (name: cmd: "${name}: ${cmd}") procGroup ); + + mkRunCommand = procRunner: procfile: let + inherit (builtins.parseDrvName procRunner.name) name; + default = "${lib.getExe procRunner} ${procfile}"; + in + # special cases for officially supported procfile runners + { + overmind = ''overmind start -f ${procfile} --root "$PWD" "$@"''; + honcho = ''honcho start -f ${procfile} --app-root "$PWD" "$@"''; + } + .${name} + or default; in { mkProcfileRunner = { name, procGroup, + procRunner ? pkgs.overmind, }: pkgs.writeShellApplication { inherit name; - runtimeInputs = [pkgs.overmind]; + runtimeInputs = [procRunner]; text = '' set -x - overmind start -f ${pkgs.writeText name (toProcfile procGroup)} --root "$PWD" "$@" + ${mkRunCommand procRunner ( + pkgs.writeText "Procfile" (toProcfile procGroup) + )} ''; }; } |
