Skip to content

Instantly share code, notes, and snippets.

@dmvianna
Created June 7, 2024 04:47
Show Gist options
  • Save dmvianna/f162f1b6d5f8261660621958acee6907 to your computer and use it in GitHub Desktop.
Save dmvianna/f162f1b6d5f8261660621958acee6907 to your computer and use it in GitHub Desktop.
.dir-locals.el for Haskell cabal projects with unusual setups
;;; Package --- dir-locals.el -*- lexical-binding: t; -*-
;;; Summary: This project's configurations for emacs.
;;;
;;; Commentary:
;;;
;;; If you don't use the `emacs` editor, you can safely ignore this file.
;;; If you do use it, you may want to copy it to `.dir-locals.el`. It will
;;; set up some configuration variables that will only work when Emacs is
;;; visiting this project.
;;;
;;; Code:
((nil
. ((eglot-workspace-configuration
. (:haskell
(:formattingProvider "fourmolu"
:plugin (:importQualifiedPost
(:globalOn t))
:checkProject nil)))
(haskell-process-type . 'cabal-repl)
(cabal-project
. (locate-dominating-file default-directory "cabal-dev.project"))
(haskell-compile-cabal-build-command
. "cabal build -j \
--ghc-option=-ferror-spans \
--ghc-option=-fdefer-type-errors \
--builddir=dist-custom-build/dev \
--project-file=cabal-dev.project"))))
(provide 'dir-locals.el)
;;; .dir-locals.el.RECOMMENDED ends here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment