From b70a9baee0fed2d94132debb0ba7a37f302d425d Mon Sep 17 00:00:00 2001 From: Paul-Henri Froidmont Date: Thu, 4 Jul 2024 03:01:49 +0200 Subject: [PATCH] emacs/nix: use nixpkgs-fmt --- modules/editor/emacs/doom.d/config.el | 2 ++ modules/editor/emacs/doom.d/init.el | 4 ++-- modules/editor/emacs/emacs.nix | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/editor/emacs/doom.d/config.el b/modules/editor/emacs/doom.d/config.el index 6c6f738..b392838 100644 --- a/modules/editor/emacs/doom.d/config.el +++ b/modules/editor/emacs/doom.d/config.el @@ -21,6 +21,8 @@ (setq lsp-tailwindcss-experimental-class-regex [ [ "cls\\(([^)]*)\\)" "\"([^']*)\"" ] [ "cls\\s*:=\\s*\\(?([^,^\\n^\\)]*)" "\"([^']*)\"" ]])) +(after! nix-mode + (set-formatter! 'nixpkgs-fmt '("nixpkgs-fmt" ) :modes '(nix-mode))) (use-package! websocket :after org-roam) diff --git a/modules/editor/emacs/doom.d/init.el b/modules/editor/emacs/doom.d/init.el index cc937ba..36927f5 100644 --- a/modules/editor/emacs/doom.d/init.el +++ b/modules/editor/emacs/doom.d/init.el @@ -89,7 +89,7 @@ (debugger +lsp) ; FIXME stepping through code, to help you add bugs direnv ;;docker - ;;editorconfig ; let someone else argue about tabs vs spaces + editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists @@ -149,7 +149,7 @@ ;;lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c - (nix +tree-sitter) ; I hereby declare "nix geht mehr!" + (nix +lsp +tree-sitter) ; I hereby declare "nix geht mehr!" (ocaml +lsp +tree-sitter) ; an objective camel (org +roam2 +present +hugo +dragndrop) ; organize your plain life in plain text (php +lsp +tree-sitter) ; perl's insecure younger brother diff --git a/modules/editor/emacs/emacs.nix b/modules/editor/emacs/emacs.nix index b1f7d54..70fd158 100644 --- a/modules/editor/emacs/emacs.nix +++ b/modules/editor/emacs/emacs.nix @@ -27,7 +27,8 @@ in { pandoc # Formatters and linters - nixfmt # nix formatter + nixfmt-rfc-style # nix formatter + nixpkgs-fmt shfmt # sh formatter shellcheck # sh linter html-tidy # HTML formatter @@ -37,8 +38,10 @@ in { # LSPs coursier # metals # Scala + # Nix nil + phpactor # PHP #OCaml ocaml