From dd19c049c6aa20ca9082df2a1315646f5af6985a Mon Sep 17 00:00:00 2001 From: jacereda Date: Tue, 8 Dec 2020 22:09:57 +0100 Subject: [PATCH] Ormolu in default.nix and emacs before-save hook. (#1059) * chore: Add ormolu * chore: Emacs hook to format via ormolu --- .dir-locals.el | 1 + default.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .dir-locals.el diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 00000000..a317e861 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1 @@ +((haskell-mode (eval . (ormolu-format-on-save-mode 1)))) diff --git a/default.nix b/default.nix index 200b327e..59721d3c 100644 --- a/default.nix +++ b/default.nix @@ -17,7 +17,7 @@ let , cmark, containers, directory, edit-distance, filepath , haskeline, HUnit, mtl, optparse-applicative, parsec, process, split, text , darwin, glfw3, SDL2, SDL2_image, SDL2_gfx, SDL2_mixer, SDL2_ttf - , ghc-prof-flamegraph + , ghc-prof-flamegraph, ormolu , clang , makeWrapper , libXext, libXcursor, libXinerama, libXi, libXrandr, libXScrnSaver, libXxf86vm, libpthreadstubs, libXdmcp, libGL @@ -47,7 +47,7 @@ let clang ]; executableToolDepends = optionals pkgs.lib.inNixShell ( - [ cabal-install clang gdb ] + [ cabal-install clang gdb ormolu ] ++ optionals stdenv.isLinux [ flamegraph linuxPackages.perf tinycc zig ] ); executableFrameworkDepends = with darwin.apple_sdk.frameworks; optionals stdenv.isDarwin [