1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00

Add haskell support to emacs, setup dev-shell for haskell

This commit is contained in:
Stefan Ellmauthaler 2023-05-09 12:39:49 +02:00
parent 52ff93af69
commit 597bad29c4
Failed to extract signature
3 changed files with 46 additions and 18 deletions

View File

@ -577,6 +577,25 @@
(use-package lsp-ui) (use-package lsp-ui)
;; haskell
(use-package haskell-mode
:diminish subword-mode
:hook
(haskell-mode . turn-on-haskell-doc)
(haskell-mode . subword-mode))
(use-package haskell
:ensure haskell-mode)
(use-package haskell-font-lock
:ensure haskell-mode)
(use-package lsp-haskell
:demand t)
(use-package shakespeare-mode)
(use-package company-cabal
:defer t
:init
(with-eval-after-load 'company
(add-to-list 'company-backends '(company-cabal))))
;; misc ;; misc
(use-package academic-phrases (use-package academic-phrases
:defer t :defer t

View File

@ -1,6 +1,10 @@
{ config, lib, pkgs, ... }: {
with lib; config,
let lib,
pkgs,
...
}:
with lib; let
defaultEl = ./default.el; defaultEl = ./default.el;
environment.systemPackages = [pkgs.gdb]; # use gdb for dap-mode environment.systemPackages = [pkgs.gdb]; # use gdb for dap-mode
localsettings = pkgs.writeText "local-settings.el" '' localsettings = pkgs.writeText "local-settings.el" ''
@ -14,8 +18,7 @@ let
cp ${defaultEl} $out/share/emacs/site-lisp/default.el cp ${defaultEl} $out/share/emacs/site-lisp/default.el
cp ${localsettings} $out/share/emacs/site-lisp/local-settings.el cp ${localsettings} $out/share/emacs/site-lisp/local-settings.el
''; '';
emacsPackage = (pkgs.emacsPackagesFor pkgs.emacs).emacsWithPackages (epkgs: emacsPackage = (pkgs.emacsPackagesFor pkgs.emacs).emacsWithPackages (epkgs: let
let
lpkgs = import ./packages.nix {inherit config lib pkgs epkgs;}; lpkgs = import ./packages.nix {inherit config lib pkgs epkgs;};
#[ (defaultConfig lpkgs) ] ++ (with pkgs; [ #[ (defaultConfig lpkgs) ] ++ (with pkgs; [
# aspell # aspell
@ -23,9 +26,11 @@ let
# gnupg # gnupg
# nixpkgs-fmt # nixpkgs-fmt
#]) #])
in [ defaultConfig ] in
[defaultConfig]
++ [(with epkgs.elpaPackages; [auctex org flymake])] ++ [(with epkgs.elpaPackages; [auctex org flymake])]
++ (with epkgs.melpaStablePackages; [ ]) ++ (with epkgs.melpaPackages; ++ (with epkgs.melpaStablePackages; [])
++ (with epkgs.melpaPackages;
[ [
ac-helm ac-helm
academic-phrases academic-phrases
@ -51,6 +56,7 @@ let
docker-compose-mode docker-compose-mode
flycheck flycheck
free-keys free-keys
haskell-mode
highlight-indentation highlight-indentation
helm helm
#helm-bbdb #helm-bbdb
@ -62,6 +68,7 @@ let
helm-rg helm-rg
json-mode json-mode
less-css-mode less-css-mode
lsp-haskell
lsp-mode lsp-mode
lsp-ui lsp-ui
magit magit
@ -87,7 +94,8 @@ let
yaml-mode yaml-mode
yasnippet yasnippet
#zenburn-theme #zenburn-theme
] ++ (with lpkgs; [ org-roam-ui ligatures ]))); ]
++ (with lpkgs; [org-roam-ui ligatures])));
in { in {
options.elss.programs.emacs.enable = options.elss.programs.emacs.enable =
mkEnableOption "Setup emacs package and install it"; mkEnableOption "Setup emacs package and install it";

View File

@ -0,0 +1 @@
use flake