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 /module.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 'module.nix')
| -rw-r--r-- | module.nix | 50 |
1 files changed, 35 insertions, 15 deletions
@@ -11,6 +11,7 @@ self: { inherit (lib) literalExpression + literalMd mdDoc mkOption types @@ -20,6 +21,7 @@ self: { config, name, system, + pkgs, ... }: { options = { @@ -34,6 +36,17 @@ self: { ''; }; + procRunner = mkOption { + type = types.package; + default = pkgs.overmind; + defaultText = literalMd "pkgs.overmind"; + description = mdDoc '' + The Procfile runner to use. Officially supports: overmind, honcho. + If using an unsupported procRunner, the Procfile path will be passed as an argument to the procRunner. + ''; + example = literalExpression "pkgs.honcho"; + }; + package = mkOption { type = types.package; description = mdDoc "Final package containing runner for Procfile"; @@ -45,27 +58,34 @@ self: { package = self.lib.${system}.mkProcfileRunner { inherit name; procGroup = config.processes; + inherit (config) procRunner; }; }; }; in { options = { - perSystem = mkPerSystemOption ({system, ...}: { - options.procfiles = mkOption { - type = types.attrsOf (types.submoduleWith { - modules = [procfileSubmodule]; - specialArgs = {inherit system;}; - }); + perSystem = mkPerSystemOption ({ + system, + pkgs, + ... + }: { + options = { + procfiles = mkOption { + type = types.attrsOf (types.submoduleWith { + modules = [procfileSubmodule]; + specialArgs = {inherit system pkgs;}; + }); - default = {}; - description = mdDoc "Attribute set containing procfile declarations"; - example = literalExpression '' - { - daemons.processes = { - redis = lib.getExe' pkgs.redis "redis-server"; - }; - } - ''; + default = {}; + description = mdDoc "Attribute set containing procfile declarations"; + example = literalExpression '' + { + daemons.processes = { + redis = lib.getExe' pkgs.redis "redis-server"; + }; + } + ''; + }; }; }); }; |
