Skip to content
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

Add fromFlakeRoot option, start processes in $FLAKE_ROOT by default. #29

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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