Skip to content

Commit

Permalink
feat: add fromFlakeRoot option, start processes in $FLAKE_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFoxPro committed Jun 30, 2023
1 parent 5bdb90b commit b4aa89f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nix/process-compose/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ in
Whether to dump the process-compose YAML file at start.
'';
};
fromFlakeRoot = mkOption {
type = types.bool;
default = true;
description = ''
Whether to start process-compose from $FLAKE_ROOT (see https://github.com/srid/flake-root).
'';
};
};

config.outputs.package =
Expand All @@ -40,6 +47,7 @@ in
runtimeInputs = [ config.package ];
text = ''
${if config.debug then "cat ${config.outputs.settingsYaml}" else ""}
${if config.fromFlakeRoot then "[[ -n $FLAKE_ROOT ]] && cd \"$FLAKE_ROOT\"" else "" }
process-compose up \
-f ${config.outputs.settingsYaml} \
${config.outputs.upCommandArgs} \
Expand Down

0 comments on commit b4aa89f

Please sign in to comment.