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

Avoid IFD through cabal2nix #146

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rsrohitsingh682
Copy link

@rsrohitsingh682 rsrohitsingh682 commented Dec 8, 2024

@rsrohitsingh682 rsrohitsingh682 changed the title nix: Test IFD using haskell-flake nix: Resolve IFD Dec 8, 2024
@srid srid changed the title nix: Resolve IFD Avoid IFD through cabal2nix Dec 8, 2024
@rsrohitsingh682 rsrohitsingh682 marked this pull request as ready for review December 10, 2024 11:28
srid

This comment was marked as duplicate.

default.nix Outdated Show resolved Hide resolved
nixpkgs-fmt = {
enable = true;
# cabal2nix, nixpkgs-fmt both modifies default.nix, hence exlude fmt.
excludes = [ "cabal.nix" ];
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
excludes = [ "cabal.nix" ];
excludes = [ config.pre-commit.settings.hooks.cabal2nix.settings.output_filename ];

(Or you could use the config from pre-commit module)

Copy link
Author

Choose a reason for hiding this comment

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

Same for this as well

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Although this was not needed. But I put it just for example.

Copy link
Owner

Choose a reason for hiding this comment

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

Your link is just going to this very conversation. I don't know what you are referring to.

Copy link
Author

Choose a reason for hiding this comment

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

I am talking about this.

Screenshot 2024-12-11 at 12 56 31 AM

Copy link
Owner

Choose a reason for hiding this comment

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

How can you use it there? It'd be a cyclic dependency.

Copy link
Author

Choose a reason for hiding this comment

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

This is for haskell-flake. There are in total 3 places where I am using cabal.nix

  1. While setting output_filename for cabal2nix pre-commit
  2. While setting exclude for nixpkgs-fmt
  3. For haskell-flake to refer to the cachedcabal2nix file

In this particular case I was talking about 3.

ideally we can set at one place use it at all other places.

Copy link
Owner

Choose a reason for hiding this comment

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

Oh, right, you can just reuse the module option (3) in both the palces (1 & 2). Good idea.

flake.nix Outdated
fourmolu-nix.url = "github:jedimahdi/fourmolu-nix";

git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.url = "github:rsrohitsingh682/git-hooks.nix/cabal2nix";
Copy link
Owner

Choose a reason for hiding this comment

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

We need to get all git-hooks.nix PRs merged.

@rsrohitsingh682 rsrohitsingh682 requested a review from srid December 23, 2024 13:31
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