From 0aa212b83dc462bb7e59defbb437b2ed2535647d Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 16 Dec 2023 13:46:53 -0700 Subject: [PATCH] [Emacs] Run alejandra automatically --- dotfiles/emacs.d/README.org | 7 +++++++ nixos/code.nix | 1 + 2 files changed, 8 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 6c269b85..e911b8ec 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2622,6 +2622,13 @@ eval-last-sexp. (shell-command-to-string "nix eval -I \"$NIX_PATH\" --expr '' --impure")))) :config (progn + (use-package apheleia + :demand t + :config + (progn + (add-to-list 'apheleia-formatters '(alejandra . ("alejandra"))) + (setf (alist-get 'nix-mode apheleia-mode-alist) + '(alejandra)))) (setq nix-indent-function 'nix-indent-line))) (use-package lsp-nix diff --git a/nixos/code.nix b/nixos/code.nix index 825c7b0d..bc382e48 100644 --- a/nixos/code.nix +++ b/nixos/code.nix @@ -57,6 +57,7 @@ makeEnable config "modules.code" true { # nix nixd nil + alejandra ] ++ (if pkgs.system == "x86_64-linux" then with pkgs; [ # purescript purescript