From 677f1f05df2a2fe64d181b95f5210a218844a0b6 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 30 Sep 2021 23:46:36 +0200 Subject: [PATCH] emacs: remove custom emacsPackages We can now directly use the existing package set since it supports overrides. --- modules/programs/emacs.nix | 6 +----- tests/modules/services/emacs/emacs-service-27.nix | 4 ++-- tests/modules/services/emacs/emacs-service-28.nix | 4 ++-- tests/modules/services/emacs/emacs-socket-27.nix | 4 ++-- tests/modules/services/emacs/emacs-socket-28.nix | 4 ++-- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/modules/programs/emacs.nix b/modules/programs/emacs.nix index bd68f68a..2c006bba 100644 --- a/modules/programs/emacs.nix +++ b/modules/programs/emacs.nix @@ -6,11 +6,7 @@ let cfg = config.programs.emacs; - # Copied from all-packages.nix, with modifications to support - # overrides. - emacsPackages = let epkgs = pkgs.emacsPackagesFor cfg.package; - in epkgs.overrideScope' cfg.overrides; - + emacsPackages = cfg.package.pkgs.overrideScope' cfg.overrides; emacsWithPackages = emacsPackages.emacsWithPackages; createConfPackage = epkgs: diff --git a/tests/modules/services/emacs/emacs-service-27.nix b/tests/modules/services/emacs/emacs-service-27.nix index fa5f9f62..7ddf8fc2 100644 --- a/tests/modules/services/emacs/emacs-service-27.nix +++ b/tests/modules/services/emacs/emacs-service-27.nix @@ -8,9 +8,9 @@ with lib; (self: super: rec { emacs = pkgs.writeShellScriptBin "dummy-emacs-27.2" "" // { outPath = "@emacs@"; + pkgs = + makeScope super.newScope (_: { emacsWithPackages = _: emacs; }); }; - emacsPackagesFor = _: - makeScope super.newScope (_: { emacsWithPackages = _: emacs; }); }) ]; diff --git a/tests/modules/services/emacs/emacs-service-28.nix b/tests/modules/services/emacs/emacs-service-28.nix index 092cd145..3effc2ae 100644 --- a/tests/modules/services/emacs/emacs-service-28.nix +++ b/tests/modules/services/emacs/emacs-service-28.nix @@ -8,9 +8,9 @@ with lib; (self: super: rec { emacs = pkgs.writeShellScriptBin "dummy-emacs-28.0.5" "" // { outPath = "@emacs@"; + pkgs = + makeScope super.newScope (_: { emacsWithPackages = _: emacs; }); }; - emacsPackagesFor = _: - makeScope super.newScope (_: { emacsWithPackages = _: emacs; }); }) ]; diff --git a/tests/modules/services/emacs/emacs-socket-27.nix b/tests/modules/services/emacs/emacs-socket-27.nix index 0fd1be1b..5757f8c5 100644 --- a/tests/modules/services/emacs/emacs-socket-27.nix +++ b/tests/modules/services/emacs/emacs-socket-27.nix @@ -10,9 +10,9 @@ in { (self: super: rec { emacs = pkgs.writeShellScriptBin "dummy-emacs-27.2" "" // { outPath = "@emacs@"; + pkgs = + makeScope super.newScope (_: { emacsWithPackages = _: emacs; }); }; - emacsPackagesFor = _: - makeScope super.newScope (_: { emacsWithPackages = _: emacs; }); }) ]; diff --git a/tests/modules/services/emacs/emacs-socket-28.nix b/tests/modules/services/emacs/emacs-socket-28.nix index d2c04239..c4e7fb09 100644 --- a/tests/modules/services/emacs/emacs-socket-28.nix +++ b/tests/modules/services/emacs/emacs-socket-28.nix @@ -10,9 +10,9 @@ in { (self: super: rec { emacs = pkgs.writeShellScriptBin "dummy-emacs-28.0.5" "" // { outPath = "@emacs@"; + pkgs = + makeScope super.newScope (_: { emacsWithPackages = _: emacs; }); }; - emacsPackagesFor = _: - makeScope super.newScope (_: { emacsWithPackages = _: emacs; }); }) ];