Skip to content

Commit

Permalink
Extract nix/tools.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Oct 1, 2019
1 parent 7a39851 commit b9957b5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions modules/pre-commit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ in {
nix-pre-commit comes with its own set of packages for this purpose.
'';
# This default is for when the module is the entry point rather than
# /default.nix. /default.nix will override this for efficiency.
default = (import ../nix {}).callPackage ../nix/tools.nix {};
defaultText =
literalExample ''nix-pre-commit-hooks-pkgs.callPackage tools-dot-nix {}'';
};

hooks =
Expand Down
12 changes: 2 additions & 10 deletions nix/packages.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{ hlint, shellcheck, ormolu, hindent, cabal-fmt, canonix, elmPackages, niv
, gitAndTools, runCommand, writeText, writeScript, git, nixpkgs-fmt, nixfmt
, callPackage
}:
{ niv, gitAndTools, callPackage }:

let
tools =
{
inherit hlint shellcheck ormolu hindent cabal-fmt canonix nixpkgs-fmt nixfmt;
inherit (elmPackages) elm-format;
terraform-fmt = callPackage ./terraform-fmt {};
};
tools = callPackage ./tools.nix {};
in
tools // rec {
inherit niv;
Expand Down
10 changes: 10 additions & 0 deletions nix/tools.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ hlint, shellcheck, ormolu, hindent, cabal-fmt, canonix, elmPackages, niv
, gitAndTools, runCommand, writeText, writeScript, git, nixpkgs-fmt, nixfmt
, callPackage
}:

{
inherit hlint shellcheck ormolu hindent cabal-fmt canonix nixpkgs-fmt nixfmt;
inherit (elmPackages) elm-format;
terraform-fmt = callPackage ./terraform-fmt {};
}

0 comments on commit b9957b5

Please sign in to comment.