emacs: enable nix option completion in this repo
1 file changed, 18 insertions(+), 6 deletions(-)
changed files
M user/settings/emacs/init.el → user/settings/emacs/init.el
@@ -1201,11 +1201,21 @@ (s-starts-with-p "Connected!" formatstring))) (defun my/setup-eglot-eldoc () (push 'flymake-eldoc-function eldoc-documentation-functions)) (add-hook 'eglot-managed-mode-hook 'my/setup-eglot-eldoc) - (setq-default eglot-workspace-configuration - '( :yaml (:keyOrdering :json-false) - :nil (:nix (:flake (:autoArchive t))) - :gopls ( :staticcheck t - :usePlaceholders t))) + (let ((nixfiles (expand-file-name "~/projects/alin.ovh/nixfiles"))) + (setq-default + eglot-workspace-configuration + `( :yaml (:keyOrdering :json-false) + :nixd ( :nixpkgs (:expr ,(format "import (builtins.getFlake \"%s\").inputs.nixpkgs" nixfiles)) + :formatting (:command ("nixfmt")) + :options ( :darwin (:expr ,(format "(builtins.getFlake \"%s\").darwinConfigurations.%s.options" + nixfiles + (system-name))) + :home-manager (:expr ,(format "(builtins.getFlake \"%s\").homeConfigurations.\"%s@%s\".options" + nixfiles + user-login-name + (system-name))))) + :gopls ( :staticcheck t + :usePlaceholders t)))) (defun my/eglot-capf () (setq-local completion-at-point-functions (list (cape-capf-super@@ -1386,10 +1396,12 @@ "gl" #'magit-log-buffer-file "l" #'link-hint-open-link "bz" #'bury-buffer "iu" #'insert-char + "ss" #'consult-ripgrep "xe" #'eval-last-sexp "xx" #'eval-defun "xi" #'consult-imenu - "z" '(:keymap ssh-deploy-prefix-map :package ssh-deploy)) + "z" '(:keymap ssh-deploy-prefix-map :package ssh-deploy) + "/" #'swiper) (let ((mail-config (expand-file-name "mail.el" user-emacs-directory))) (if (file-readable-p mail-config)