From 7a4ddb45ca12b7448e3493f0269b3be63ee85cea Mon Sep 17 00:00:00 2001 From: larstvei Date: Fri, 23 Dec 2022 01:32:36 +0100 Subject: [PATCH] Simplify Emacs overlay --- flake.lock | 70 +++++++++++++++++++++++++++++++++++------------- flake.nix | 20 ++++---------- modules/home.nix | 2 +- 3 files changed, 57 insertions(+), 35 deletions(-) diff --git a/flake.lock b/flake.lock index 0e850ff..cc881ca 100644 --- a/flake.lock +++ b/flake.lock @@ -20,19 +20,37 @@ "type": "github" } }, - "emacs-src": { - "flake": false, + "emacs": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, "locked": { - "lastModified": 1671622837, - "narHash": "sha256-9v6yzJgtjEJTuacEe8hEzP541hivvNObEh2Hkyw1Mh0=", - "owner": "emacs-mirror", - "repo": "emacs", - "rev": "ad5a67996ddf23df904c09165475759e2e0a68b1", + "lastModified": 1671646610, + "narHash": "sha256-3PkqA8X0ISwkKBqoZcRsLc3K6Q+gRTNoc7T8PSld/50=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "b7a13b83ce72c7038d1871ccb63d055b23fc6021", "type": "github" }, "original": { - "owner": "emacs-mirror", - "repo": "emacs", + "owner": "nix-community", + "repo": "emacs-overlay", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, @@ -59,18 +77,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1671447788, - "narHash": "sha256-Nitle27Q2gXkuk66VZUT+iyisT4pGQwQwU9eyExOVEk=", - "owner": "nixos", + "lastModified": 1671458120, + "narHash": "sha256-2+k/OONN4OF21TeoNjKB5sXVZv6Zvm/uEyQIW9OYCg8=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "bfb04388d42ff49e5e81da9f0bfcb48a6367273d", + "rev": "e37ef84b478fa8da0ced96522adfd956fde9047a", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixpkgs-22.05-darwin", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "type": "indirect" } }, "nixpkgs-unstable": { @@ -89,12 +105,28 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1671447788, + "narHash": "sha256-Nitle27Q2gXkuk66VZUT+iyisT4pGQwQwU9eyExOVEk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bfb04388d42ff49e5e81da9f0bfcb48a6367273d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-22.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "darwin": "darwin", - "emacs-src": "emacs-src", + "emacs": "emacs", "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable" } }, diff --git a/flake.nix b/flake.nix index a561daa..a9565d5 100644 --- a/flake.nix +++ b/flake.nix @@ -21,10 +21,7 @@ inputs.nixpkgs.follows = "nixpkgs-unstable"; }; - emacs-src = { - url = "github:emacs-mirror/emacs"; - flake = false; - }; + emacs.url = github:nix-community/emacs-overlay; }; outputs = { self, nixpkgs, darwin, home-manager, ... }@inputs: { @@ -53,22 +50,15 @@ config.allowUnfree = true; overlays = with inputs; [ + emacs.overlays.emacs + emacs.overlays.package (final: prev: { - emacs-mac = (prev.emacs.override { - srcRepo = true; - nativeComp = true; - withSQLite3 = true; - withNS = true; - }).overrideAttrs (o: rec { - version = "30.0.50"; - src = inputs.emacs-src; - + emacsGit = (prev.emacsGit.overrideAttrs (o: rec { patches = [ - ./patches/fix-window-role.patch ./patches/no-titlebar-rounded-corners.patch ./patches/system-appearance.patch ]; - }); + })); maude-mac = final.callPackage ./pkgs/maude-mac { }; }) diff --git a/modules/home.nix b/modules/home.nix index 583e6dc..387dd55 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -2,7 +2,7 @@ home.packages = with pkgs; [ - ((emacsPackagesFor emacs-mac).emacsWithPackages + ((emacsPackagesFor emacsGit).emacsWithPackages (epkgs: with epkgs; [ vterm pdf-tools