-
Notifications
You must be signed in to change notification settings - Fork 18
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
make process-compose-flake usable without flake-parts #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good; just a couple of changes.
flake.nix
Outdated
@@ -3,6 +3,7 @@ | |||
flakeModule = ./nix/flake-module.nix; | |||
|
|||
lib = ./nix/lib.nix; | |||
evalModules = import ./nix/eval-modules.nix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since lib
already exists for this purpose, you want to put those two functions inside of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What bugs me a bit about this is that if we put the functions inside lib, we first need to pass in "lib", and then pass in "pkgs" again which already has lib. This makes using the function a bit strange, but I can do it if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make the arguments of lib.nix
module like this:
{ pkgs, lib ? pkgs.lib, ... }
Then only one argument (the first) is non-optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done. This is a breaking change, though.
nix/eval-modules.nix
Outdated
@@ -0,0 +1,15 @@ | |||
rec { | |||
evalModules = { pkgs, name, modules }: (pkgs.lib.evalModules { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you document the function as a comment above? Here, and in makeProcessCompose
function below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Also, CI is failing. |
example/flake.nix
Outdated
@@ -76,6 +76,25 @@ | |||
}; | |||
}; | |||
}; | |||
|
|||
# nix run .#ponysay up to start the process | |||
packages.ponysay = (import ../nix/eval-modules.nix).makeProcessCompose { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would look something like:
packages.ponysay = (import ../nix/eval-modules.nix).makeProcessCompose { | |
packages.ponysay = inputs.process-compose-flake.lib.makeProcessCompose { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this mean that the example can only be run after pushing the code upstream? I think it's nice if it's possible to use the example while working on the code. But I can surely do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the lock file after merging the PR, but in CI, it will always use latest, due to
process-compose-flake/flake.nix
Line 15 in f6ce948
inherit overrideInputs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the meanwhile, you can do cd ./example && nix run . --override-input process-compose-flake ..
to test locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
fd6ab97
to
d21af94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will merge once CI failures are addressed.
This didn't work for me, it still uses lib from upstream. But I assume it'll work now. |
@srid Nice!! Thanks for pulling that one in. :) |
See previous discussion in #79
followup PRs are in branches VanCoding:step2 and VanCoding:step3