1 ;;; init-nix.el --- Support for the Nix package manager -*- lexical-binding: t -*-
5 (if (maybe-require-package 'nix-ts-mode
)
6 ;; If the TS mode is installed, then the non-TS mode is not, so
7 ;; nobody will have added an auto-mode-alist entry
8 (add-to-list 'auto-mode-alist
'("\\.nix\\'" . nix-ts-mode
))
9 (maybe-require-package 'nix-mode
))
11 (with-eval-after-load 'eglot
12 ;; Prefer nixd to nil, and enable in nix-ts-mode too
13 (add-to-list 'eglot-server-programs
14 `((nix-mode nix-ts-mode
) .
,(eglot-alternatives '("nixd" "nil")))))
16 (maybe-require-package 'nixpkgs-fmt
)
17 (maybe-require-package 'nixfmt
)
20 ;;; init-nix.el ends here