diff --git a/flake.lock b/flake.lock index 76ce7cf..19ffbd2 100644 --- a/flake.lock +++ b/flake.lock @@ -76,6 +76,28 @@ "type": "github" } }, + "emacs-overlay": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1728493181, + "narHash": "sha256-a5BQny7/ncCIybTS+Nyh2AxfNvgrXuSJQChNmnkAtpI=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "2740ccfee65e8483cdabd097d98feec9f3f089c8", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "emacs-overlay", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -203,6 +225,24 @@ "inputs": { "systems": "systems" }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, "locked": { "lastModified": 1709126324, "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", @@ -217,9 +257,9 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_3": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -235,9 +275,9 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_4": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1710146030, @@ -293,7 +333,7 @@ "helix": { "inputs": { "crane": "crane", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" }, @@ -418,7 +458,7 @@ "hyprwayland-scanner": "hyprwayland-scanner", "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems_2", + "systems": "systems_3", "xdph": "xdph" }, "locked": { @@ -600,7 +640,7 @@ }, "lix-module": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "flakey-profile": "flakey-profile", "lix": "lix", "nixpkgs": [ @@ -659,7 +699,7 @@ "neovim-flake": { "inputs": { "flake-parts": "flake-parts_2", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "mnw": "mnw", "nil": "nil", "nixpkgs": [ @@ -768,7 +808,7 @@ "plugin-vim-vsnip": "plugin-vim-vsnip", "plugin-which-key": "plugin-which-key", "rnix-lsp": "rnix-lsp", - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1728378979, @@ -910,6 +950,22 @@ } }, "nixpkgs-stable": { + "locked": { + "lastModified": 1728328465, + "narHash": "sha256-a0a0M1TmXMK34y3M0cugsmpJ4FJPT/xsblhpiiX1CXo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1bfbbbe5bbf888d675397c66bfdb275d0b99361c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { "locked": { "lastModified": 1720386169, "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", @@ -2662,7 +2718,7 @@ "hyprland", "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { "lastModified": 1728092656, @@ -2720,6 +2776,7 @@ }, "root": { "inputs": { + "emacs-overlay": "emacs-overlay", "flake-parts": "flake-parts", "helix": "helix", "home-manager": "home-manager", @@ -2799,7 +2856,7 @@ "nixpkgs" ], "searx-randomizer": "searx-randomizer", - "systems": "systems_6" + "systems": "systems_7" }, "locked": { "lastModified": 1725210690, @@ -2894,21 +2951,6 @@ } }, "systems_2": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -2923,6 +2965,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "systems_4": { "locked": { "lastModified": 1681028828, @@ -2954,6 +3011,21 @@ } }, "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_7": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", diff --git a/flake.nix b/flake.nix index 40b5286..a8e79e5 100644 --- a/flake.nix +++ b/flake.nix @@ -53,6 +53,10 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + emacs-overlay = { + url = "github:nix-community/emacs-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # I use schizofox as my personal browser. This is because I am schizophrenic. schizofox = { url = "github:schizofox/schizofox"; diff --git a/modules/programs/editors/emacs/module.nix b/modules/programs/editors/emacs/module.nix index d14df08..d989b5a 100644 --- a/modules/programs/editors/emacs/module.nix +++ b/modules/programs/editors/emacs/module.nix @@ -10,27 +10,62 @@ inherit (lib) mkIf; # Taken from outfoxxed since figuring this out is really annoying. - # newpkgs = - # pkgs.appendOverlays - # (with inputs.emacs-overlay.overlays; [ - # emacs - # package - # ]); + newpkgs = + pkgs.appendOverlays + (with inputs.emacs-overlay.overlays; [ + emacs + package - # custom-emacs = with newpkgs; - # (emacsPackagesFor emacs-pgtk) - # .emacsWithPackages (epkgs: - # with epkgs; [ - # vterm - # treesit-grammars.with-all-grammars - # ]); + (_: prev: { + tree-sitter = prev.tree-sitter.override { + extraGrammars = { + tree-sitter-qmljs = { + version = "master"; + src = pkgs.fetchFromGitHub { + owner = "yuja"; + repo = "tree-sitter-qmljs"; + rev = "35ead5b9955cdb29bcf709d622fa960ff33992b6"; + sha256 = "jT47lEGuk6YUjcHB0ZMyL3i5PqyUaCQmt0j78cUpy8Q="; + }; + }; + }; + }; + }) + ]); + + tree-sitter-parsers = grammars: + with grammars; [ + tree-sitter-qmljs + ]; + + emaks = with newpkgs; + (emacsPackagesFor (emacs-pgtk.override {withNativeCompilation = true;})) + .emacsWithPackages (epkgs: + with epkgs; let + qml-ts-mode = trivialBuild { + pname = "qml-ts-mode"; + version = "master"; + src = fetchFromGitHub { + owner = "outfoxxed"; + repo = "qml-ts-mode"; + rev = "b24b9e78305ed045baa136782623ad16de01b7b8"; + sha256 = "PgXm/a92cX5zjA9blTrIRH7DfOUczRwb9oBcMMEzF2I="; + }; + }; + in [ + vterm + treesit-grammars.with-all-grammars + (treesit-grammars.with-grammars (grammars: tree-sitter-parsers grammars)) + qml-ts-mode + ]); in { config = mkIf cfg.enable { home-manager.users.${username} = { home.packages = with pkgs; [ - # custom-emacs + emaks + clang-tools - emacs30-pgtk + # emacs30-pgtk binutils ## Doom dependencies @@ -41,9 +76,6 @@ in { ## Optional dependencies fd # faster projectile indexing imagemagick # for image-dired - (mkIf (config.programs.gnupg.agent.enable) - pinentry-emacs) # in-emacs gnupg prompts - zstd # for undo-fu-session/undo-tree compression ## Module dependencies # :email mu4e mu @@ -62,7 +94,7 @@ in { services.emacs = { enable = true; - package = pkgs.emacs30-pgtk; + package = emaks; }; }; };