Skip to content

Commit

Permalink
feat: add cabal-gild
Browse files Browse the repository at this point in the history
  • Loading branch information
amesgen committed Jul 8, 2024
1 parent 0f6f5fd commit 11e7fbf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,22 @@ in
entry = "${hooks.cabal-fmt.package}/bin/cabal-fmt --inplace";
files = "\\.cabal$";
};
cabal-gild =
{
name = "cabal-gild";
description = "Format Cabal files";
package = tools.cabal-gild;
entry =
let
script = pkgs.writeShellScript "precommit-cabal-gild" ''
for file in "$@"; do
${hooks.cabal-gild.package}/bin/cabal-gild --io="$file"
done
'';
in
builtins.toString script;
files = "\\.cabal$";
};
cabal2nix =
{
name = "cabal2nix";
Expand Down
1 change: 1 addition & 0 deletions nix/call-tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ pkgs:
pkgs.lib.flip builtins.removeAttrs [ "override" "overrideDerivation" ]
(pkgs.callPackage ./tools.nix {
cabal-fmt = (pkgs.haskell.lib.enableSeparateBinOutput pkgs.haskellPackages.cabal-fmt).bin;
cabal-gild = (pkgs.haskell.lib.enableSeparateBinOutput pkgs.haskellPackages.cabal-gild).bin;
hindent = pkgs.haskell.lib.enableSeparateBinOutput pkgs.haskellPackages.hindent;
})
2 changes: 2 additions & 0 deletions nix/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
, ansible-lint
, biome
, cabal-fmt
, cabal-gild
, cabal2nix
, callPackage
, cargo
Expand Down Expand Up @@ -99,6 +100,7 @@ in
biome
cabal2nix
cabal-fmt
cabal-gild
cargo
clang-tools
clippy
Expand Down

0 comments on commit 11e7fbf

Please sign in to comment.