From 0f4d751e3da412c60d1f4c22026290d5ae01807b Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Mon, 20 Mar 2023 10:42:42 +0100 Subject: [PATCH] Rust stuff and `eat` instead of `vterm` --- diff-closures/default.nix | 4 ++-- flake.nix | 3 +-- hmModules/default.nix | 2 +- init.el | 30 ++++++++++++++++++++++++++++-- packages/default.nix | 17 +++++++++++++++++ packages/packages.nix | 5 ++++- 6 files changed, 53 insertions(+), 8 deletions(-) diff --git a/diff-closures/default.nix b/diff-closures/default.nix index 274c48a..bf7e818 100644 --- a/diff-closures/default.nix +++ b/diff-closures/default.nix @@ -6,7 +6,7 @@ }: { packages.diff-closures = pkgs.writeShellApplication { name = "diff-closures"; - runtimeInputs = [ pkgs.ansifilter ]; + runtimeInputs = [pkgs.ansifilter]; text = '' nix store diff-closures --derivation \ github:aciceri/emacs/master#ccrEmacs \ @@ -14,7 +14,7 @@ | ansifilter --text ''; }; - + apps.diff-closures.program = "${self'.packages.diff-closures}/bin/diff-closures"; }; } diff --git a/flake.nix b/flake.nix index ed34727..d17b520 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,7 @@ ./diff-closures ]; }; - + nixConfig = { extra-substituters = [ "https://aciceri-emacs.cachix.org" @@ -35,6 +35,5 @@ "aciceri-emacs.cachix.org-1:kxDGDFWV6LUj41tb8xmPRBI56UJSZOVveN49LZDUKdA=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; - }; } diff --git a/hmModules/default.nix b/hmModules/default.nix index ac01b51..aea89dd 100644 --- a/hmModules/default.nix +++ b/hmModules/default.nix @@ -35,7 +35,7 @@ client.enable = true; defaultEditor = true; socketActivation.enable = false; - startWithUserSession = false; + startWithUserSession = true; }; systemd.user.sessionVariables = { # TODO user `gpgconf --list-dirs agent-ssh-socket` diff --git a/init.el b/init.el index e574706..0bf0d51 100644 --- a/init.el +++ b/init.el @@ -60,7 +60,8 @@ backup-by-copying t) (defun ccr/set-faces () (set-face-attribute 'default nil :font "Fira Code 12") - (meow--prepare-face)) + ;; (meow--prepare-face) + ) (if (daemonp) (add-hook 'server-after-make-frame-hook #'ccr/set-faces) (ccr/set-faces)) @@ -126,6 +127,8 @@ (setup haskell-mode (:hook eglot-ensure tree-sitter-hl-mode)) +(setup rust-mode (:hook eglot-ensure tree-sitter-hl-mode)) + (setup terraform-mode (:hook eglot-ensure tree-sitter-hl-mode)) (setup yaml-mode (:hook tree-sitter-hl-mode)) @@ -266,10 +269,19 @@ cape-dabbrev-min-length 5)) (setup eshell + (:require projectile) (:hook esh-autosuggest-mode) + (:with-mode eshell-load (:hook #'eat-eshell-mode #'eat-eshell-visual-command-mode)) (eshell-syntax-highlighting-global-mode +1) + (defun ccr/projectile-run-eat (&optional arg) + (interactive "P") + (let ((project (projectile-acquire-root))) + (projectile-with-default-dir project + (let ((eat-buffer-name (projectile-generate-process-name "eat" arg project))) + (eat))))) (:global "C-c o e" #'projectile-run-eshell - "C-c o t" #'projectile-run-vterm)) + "C-c o t" #'ccr/projectile-run-eat + "C-c o v" #'projectile-run-vterm)) (setup vterm (:option vterm-timer-delay 0.01)) @@ -391,6 +403,7 @@ "^\\*eshell.*\\*$" eshell-mode ;eshell as a popup "^\\*shell.*\\*$" shell-mode ;shell as a popup "^\\*term.*\\*$" term-mode ;term as a popup + "^\\*eat.*\\*$" term-mode ;eat as a popup "^\\*vterm.*\\*$" vterm-mode ;vterm as a popup ) popper-echo-lines 1 @@ -461,3 +474,16 @@ (provide 'init) ;;; init.el ends here +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages + '(lsp-mode diff-hl org-roam-ui consult-flycheck dirvish flycheck-inline orderless diredfl rustic ef-themes corfu-doc which-key popper envrc flycheck-posframe pdf-tools embark-consult vertico tree-sitter-langs paredit ligature hl-todo vterm yaml-mode eat kind-icon terraform-mode sway corfu-terminal shackle consult-projectile magit-delta nix-mode code-review haskell-mode delight marginalia meow eshell-syntax-highlighting all-the-icons-completion esh-autosuggest cape setup))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/packages/default.nix b/packages/default.nix index 7161d22..7b0b37b 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -8,10 +8,27 @@ inputs', pkgs, final, + lib, + system, ... }: let inherit (inputs.emacs-overlay.overlays.default pkgs pkgs) emacsPackagesFor; in { + # Some tree-sitter grammars in nixpksg are built with a too new ABI + # https://github.com/NixOS/nixpkgs/issues/209114 + _module.args.pkgs = inputs.nixpkgs.legacyPackages.${system}.extend (self: super: { + tree-sitter-grammars = + super.tree-sitter-grammars + // { + tree-sitter-rust = super.tree-sitter-grammars.tree-sitter-rust.overrideAttrs (_: { + nativeBuildInputs = [self.nodejs self.tree-sitter]; + configurePhase = '' + tree-sitter generate --abi 13 src/grammar.json + ''; + }); + }; + }); + packages = { ccrEmacsWithoutPackages = (inputs'.emacs-overlay.packages.emacsPgtk.override { diff --git a/packages/packages.nix b/packages/packages.nix index ab4007e..e1ad9a2 100644 --- a/packages/packages.nix +++ b/packages/packages.nix @@ -49,7 +49,10 @@ with epkgs; [ eshell-syntax-highlighting projectile consult-projectile - + eat + rust-mode + rustic + # TODO playing with these sway shackle