From bc97d08de5bdc74c61131f998386f28d14d114fc Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Fri, 13 Jan 2023 18:23:06 +0100 Subject: [PATCH] Emacs source as flake input --- flake.lock | 18 ++++++++++++++++++ flake.nix | 4 ++++ hmModules/emacs/default.nix | 10 ++-------- utils/default.nix | 8 +++++++- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index e4b8931..8ab3724 100644 --- a/flake.lock +++ b/flake.lock @@ -146,6 +146,23 @@ "type": "github" } }, + "emacsSource": { + "flake": false, + "locked": { + "lastModified": 1673616960, + "narHash": "sha256-nO3HbhF5s4Dg3WXe8lDoew2STks1cVU3vHIWd7ePFBQ=", + "ref": "emacs-29", + "rev": "861556c1339cd65842ec3e24ba48590e6b72bd48", + "revCount": 164162, + "type": "git", + "url": "git://git.savannah.gnu.org/emacs.git" + }, + "original": { + "ref": "emacs-29", + "type": "git", + "url": "git://git.savannah.gnu.org/emacs.git" + } + }, "evil-escape": { "flake": false, "locked": { @@ -748,6 +765,7 @@ "agenix": "agenix", "comma": "comma", "doomEmacs": "doomEmacs", + "emacsSource": "emacsSource", "homeManager": "homeManager", "nixosHardware": "nixosHardware", "nixpkgsStable": "nixpkgsStable", diff --git a/flake.nix b/flake.nix index 75b2a37..5fba6e4 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,10 @@ doomEmacs.url = "github:nix-community/nix-doom-emacs"; comma.url = "github:nix-community/comma"; rock5b.url = "github:aciceri/rock5b-nixos"; + emacsSource = { + url = "git://git.savannah.gnu.org/emacs.git?ref=emacs-29"; + flake = false; + }; }; outputs = {self, ...} @ inputs: let utils = import ./utils inputs; diff --git a/hmModules/emacs/default.nix b/hmModules/emacs/default.nix index c138fc3..0a533b7 100644 --- a/hmModules/emacs/default.nix +++ b/hmModules/emacs/default.nix @@ -4,8 +4,6 @@ lib, ... }: let - rev = "72a94f91fd0570556ce770dc3a39e658f7588f7e"; # Current master, Emacs 29, seems a good commit - sha256 = "e5kKIEZJB9BGbBvGtiPK3gNygFoGxkG02nRLCwnGtmk="; emacsMaster = (pkgs.emacs.override { nativeComp = true; @@ -14,17 +12,13 @@ withGTK3 = true; }) .overrideAttrs (old: { - src = pkgs.fetchFromSavannah { - repo = "emacs"; - inherit rev sha256; - }; - version = rev; + src = pkgs.emacsSource; patches = []; postPatch = old.postPatch + '' substituteInPlace lisp/loadup.el \ - --replace '(emacs-repository-get-version)' '"${rev}"' \ + --replace '(emacs-repository-get-version)' '"${pkgs.emacsSource.rev}"' \ --replace '(emacs-repository-get-branch)' '"master"' '' + (lib.optionalString (old ? NATIVE_FULL_AOT) diff --git a/utils/default.nix b/utils/default.nix index dcbdbdd..c11bb37 100644 --- a/utils/default.nix +++ b/utils/default.nix @@ -8,6 +8,7 @@ nur, preCommitHooks, rock5b, + emacsSource, self, ... }: let @@ -43,7 +44,12 @@ value.file = ./.. + "/${name}"; }) (import ../secrets); }; - nixpkgs.overlays = [agenix.overlay comma.overlays.default nur.overlay]; + nixpkgs.overlays = [ + agenix.overlay + comma.overlays.default + nur.overlay + (_: _: {inherit emacsSource;}) + ]; } (../hosts + "/${name}") homeManager.nixosModule