utils/ormolu: init

Add tool for formatting haskell files
This commit is contained in:
Oystein Kristoffer Tveit 2022-11-26 20:48:26 +01:00
parent ca3e27ec77
commit eab555988e
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
3 changed files with 6 additions and 7 deletions

View File

@ -22,13 +22,6 @@
home-manager-search nix-option-search nix-package-search nix2json; home-manager-search nix-option-search nix-package-search nix2json;
}; };
checks.${system} = let
in {
# hlint = pkgs.callPackage ./utils/hlint.nix {};
# format = pkgs.callPackage ./utils/format.nix {};
};
hydraJobs = with pkgs.lib; hydraJobs = with pkgs.lib;
mapAttrs' (name: value: nameValuePair name { ${system} = value; }) mapAttrs' (name: value: nameValuePair name { ${system} = value; })
self.packages.${system}; self.packages.${system};

View File

@ -5,8 +5,10 @@ pkgs.mkShell {
shellHook = let shellHook = let
format = pkgs.callPackage ./utils/format.nix { }; format = pkgs.callPackage ./utils/format.nix { };
hlint = pkgs.callPackage ./utils/hlint.nix { }; hlint = pkgs.callPackage ./utils/hlint.nix { };
ormolu = pkgs.callPackage ./utils/ormolu.nix { };
in '' in ''
alias nasf=${format}/bin/nix-attrs-search-format alias nasf=${format}/bin/nix-attrs-search-format
alias nashl=${hlint}/bin/nix-attrs-search-hlint alias nashl=${hlint}/bin/nix-attrs-search-hlint
alias nashf=${ormolu}/bin/nix-attrs-search-ormolu
''; '';
} }

4
utils/ormolu.nix Normal file
View File

@ -0,0 +1,4 @@
{ pkgs, ... }:
pkgs.writeScriptBin "nix-attrs-search-ormolu" ''
find -name '*.hs' -exec '${pkgs.ormolu}/bin/ormolu' --mode inplace {} \;
''