From 1e98c823ea1d0cb9c5348a8ebb43a58a77bf9cce Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sun, 28 May 2023 23:38:10 +0200 Subject: [PATCH] Emacs: add tree-stitter support This reverts commit 069072653a5c7713f13e7c895d0ce2e531ae34c3. --- flake.lock | 30 +++++++++++++++++++++++++++--- flake.nix | 10 ++++++++++ modules/emacs.nix | 9 ++++++++- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 9c51dfa..efb6301 100644 --- a/flake.lock +++ b/flake.lock @@ -33,6 +33,29 @@ "type": "github" } }, + "emacs-overlay": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs-unstable" + ] + }, + "locked": { + "lastModified": 1685293468, + "narHash": "sha256-weksQQ0YGFk6pjW4Ms5eC1HURH8otWjIb8lJhkvKkZE=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "8b10f751e48ae0e48b3f037a352c7447dc7d1afe", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "emacs-overlay", + "type": "github" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -184,11 +207,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1685043448, - "narHash": "sha256-U3BwyDc2OzBcZ8tD09qXibyivgOtOQFTFCVgFyJ+6MM=", + "lastModified": 1685215858, + "narHash": "sha256-IRMFoDXA6cYx3ifVw3B2JcC4JrjT5v7tRAx2vro2Ffs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9886352ec9ab3945896ee8a4185e961fe29df209", + "rev": "ba6e4ddeb3e8ad3f3e3bec63dafbc9fe558729bb", "type": "github" }, "original": { @@ -279,6 +302,7 @@ }, "root": { "inputs": { + "emacs-overlay": "emacs-overlay", "fenix": "fenix", "flake-utils": "flake-utils", "lanzaboote": "lanzaboote", diff --git a/flake.nix b/flake.nix index e755db5..079c160 100644 --- a/flake.nix +++ b/flake.nix @@ -36,10 +36,19 @@ flake-utils.follows = "flake-utils"; }; }; + + emacs-overlay = { + url = "github:nix-community/emacs-overlay"; + inputs = { + nixpkgs.follows = "nixpkgs-unstable"; + flake-utils.follows = "flake-utils"; + }; + }; }; outputs = inputs@{ self + , emacs-overlay , fenix , flake-utils , lanzaboote @@ -79,6 +88,7 @@ ./modules/basic-tools ./modules/binary-caches.nix ./modules/devtools.nix + ./modules/emacs.nix ./modules/gnome.nix ./modules/gnupg.nix ./modules/mail diff --git a/modules/emacs.nix b/modules/emacs.nix index a6a4b22..67aa4b6 100644 --- a/modules/emacs.nix +++ b/modules/emacs.nix @@ -12,7 +12,14 @@ services.emacs = { install = true; enable = false; - package = with pkgs; ((emacsPackagesFor emacsPgtk).emacsWithPackages (epkgs: with epkgs; [ + package = with pkgs; ((emacsPackagesFor (emacsPgtk.overrideAttrs (old: { + passthru = old.passthru // { + treeSitter = true; + }; + }))).emacsWithPackages (epkgs: with epkgs; [ + # treesitter bits + treesit-grammars.with-all-grammars + vterm pdf-tools ]));