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

make process-compose-flake usable without flake-parts #80

Merged
merged 5 commits into from
Sep 30, 2024

Conversation

VanCoding
Copy link
Contributor

@VanCoding VanCoding commented Sep 29, 2024

See previous discussion in #79

followup PRs are in branches VanCoding:step2 and VanCoding:step3

Copy link
Member

@srid srid left a 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;
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@srid srid Sep 29, 2024

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.

Copy link
Contributor Author

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.

@@ -0,0 +1,15 @@
rec {
evalModules = { pkgs, name, modules }: (pkgs.lib.evalModules {
Copy link
Member

@srid srid Sep 29, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@srid
Copy link
Member

srid commented Sep 29, 2024

Also, CI is failing.

@@ -76,6 +76,25 @@
};
};
};

# nix run .#ponysay up to start the process
packages.ponysay = (import ../nix/eval-modules.nix).makeProcessCompose {
Copy link
Member

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:

Suggested change
packages.ponysay = (import ../nix/eval-modules.nix).makeProcessCompose {
packages.ponysay = inputs.process-compose-flake.lib.makeProcessCompose {

Copy link
Contributor Author

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.

Copy link
Member

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

inherit overrideInputs;

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@VanCoding VanCoding force-pushed the step1 branch 2 times, most recently from fd6ab97 to d21af94 Compare September 29, 2024 23:11
Copy link
Member

@srid srid left a 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.

@VanCoding
Copy link
Contributor Author

In the meanwhile, you can do cd ./example && nix run . --override-input process-compose-flake .. to test locally.

This didn't work for me, it still uses lib from upstream. But I assume it'll work now.

@srid srid merged commit d0824da into Platonic-Systems:main Sep 30, 2024
2 checks passed
@VanCoding
Copy link
Contributor Author

@srid Nice!! Thanks for pulling that one in. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants