-
Notifications
You must be signed in to change notification settings - Fork 37
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
base: master
Are you sure you want to change the base?
Conversation
…cabal2nix` expression;
nixpkgs-fmt = { | ||
enable = true; | ||
# cabal2nix, nixpkgs-fmt both modifies default.nix, hence exlude fmt. | ||
excludes = [ "cabal.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.
excludes = [ "cabal.nix" ]; | |
excludes = [ config.pre-commit.settings.hooks.cabal2nix.settings.output_filename ]; |
(Or you could use the config
from pre-commit module)
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.
Same for this as well
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.
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.
Although this was not needed. But I put it just for example.
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.
Your link is just going to this very conversation. I don't know what you are referring to.
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.
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.
How can you use it there? It'd be a cyclic dependency.
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 is for haskell-flake
. There are in total 3 places where I am using cabal.nix
- While setting output_filename for
cabal2nix
pre-commit - While setting exclude for
nixpkgs-fmt
- For haskell-flake to refer to the cached
cabal2nix
file
In this particular case I was talking about 3.
ideally we can set at one place use it at all other places.
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.
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"; |
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.
We need to get all git-hooks.nix PRs merged.
Uses srid/haskell-flake#382