diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index 4dd6d4d..bf0460c 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -24,7 +24,8 @@ ./modules/bemenu ./modules/syncthing ./modules/firefox - ./modules/calibre + ./modules/calibre + ./modules/go ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/hosts/pinwheel/modules/emacs/config.org b/hosts/pinwheel/modules/emacs/config.org index 5ca8b59..313c783 100644 --- a/hosts/pinwheel/modules/emacs/config.org +++ b/hosts/pinwheel/modules/emacs/config.org @@ -385,3 +385,31 @@ https://github.com/justbur/emacs-which-key (setq diff-hl-side 'right) (global-diff-hl-mode t)) #+END_SRC + +* LSP +** Eglot +#+BEGIN_SRC emacs-lisp + (defun alex/eglot-organize-imports () (interactive) + (call-interactively 'eglot-code-action-organize-imports)) + + (defun alex/eglot-on-save () + (add-hook 'before-save-hook #'eglot-format-buffer -10 t) + (add-hook 'before-save-hook #'alex/eglot-organize-imports nil t) + ) + + (use-package eglot + :hook ( + (eglot-managed-mode . alex/eglot-on-save) + (go-mode . eglot-ensure) + (nix-mode . eglot-ensure) + ) + ) +#+END_SRC +** Go +#+BEGIN_SRC emacs-lisp + (use-package go-mode + :hook ( + (go-mode . eglot-ensure) + ) + ) +#+END_SRC diff --git a/hosts/pinwheel/modules/emacs/default.nix b/hosts/pinwheel/modules/emacs/default.nix index 8603adc..7238a9d 100644 --- a/hosts/pinwheel/modules/emacs/default.nix +++ b/hosts/pinwheel/modules/emacs/default.nix @@ -17,4 +17,6 @@ in pkgs.wl-clipboard ]; }; + + environment.systemPackages = [ pkgs.ripgrep ]; } diff --git a/hosts/pinwheel/modules/go/default.nix b/hosts/pinwheel/modules/go/default.nix new file mode 100644 index 0000000..d406257 --- /dev/null +++ b/hosts/pinwheel/modules/go/default.nix @@ -0,0 +1,8 @@ +{ home-manager, pkgs, ... }: +{ + home-manager.users.alex = { + home.packages = [ pkgs.gopls ]; + }; + + environment.systemPackages = [ pkgs.go ]; +}