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 format check for services flake in dev/flake.nix #104

Closed

Conversation

conscious-puppet
Copy link
Contributor

adding check in test/flake.nix checks for the formatting across services flake

❯ nix run github:srid/nixci --option sandbox true .
treefmt-check> Initialized empty Git repository in /build/project/.git/
treefmt-check> Initialized empty Git repository in /build/project/.git/
treefmt-check> treefmt 0.6.0
treefmt-check> 0 files changed in 2ms (found 2, matched 1, cache misses 1)
treefmt-check> On branch main
treefmt-check> nothing to commit, working tree clean
treefmt-check> treefmt 0.6.0
treefmt-check> 0 files changed in 20ms (found 42, matched 26, cache misses 26)
treefmt-check> On branch main
treefmt-check> nothing to commit, working tree clean

test/flake.nix Outdated
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
# Required for elastic search
config.allowUnfree = true;
};
treefmt = {
projectRootFile = "flake.nix";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
projectRootFile = "flake.nix";
projectRoot = inputs.services-flake;
projectRootFile = "flake.nix";

Like this you might not need to create another check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure i'll give it a try

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shivaraj-bh this suggestion works. Although I had another concern. I am having to define treefmt.programs twice. once in dev/flake.nix and then again in test/flake.nix. Is there a way I could get the programs as well from the ${inputs.services-flake}/dev/flake.nix

Copy link
Member

@shivaraj-bh shivaraj-bh Feb 19, 2024

Choose a reason for hiding this comment

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

Why not just add services-flake in inputs of ./dev/flake.nix? and it should work without having to make any changes in ./test/flake.nix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure i'll try that only

Copy link
Member

Choose a reason for hiding this comment

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

If this works out you can make the change in #103

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding to services-flake to ./dev/flake.nix works. i've pushed that change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this works out you can make the change in #103

i missed your comment before pushing to this branch. i'll close this one and push in #103 after the build is successful here

@shivaraj-bh
Copy link
Member

Looks like it is working fine (from ubuntu-latest CI job):
Screenshot 2024-02-20 at 12 56 24 AM

@conscious-puppet conscious-puppet changed the title add format check for services flake in test/flake.nix add format check for services flake in dev/flake.nix Feb 19, 2024
@conscious-puppet conscious-puppet deleted the fix/ci-treefmt-2 branch February 19, 2024 20:03
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