1 # package.el-based emacs packages
5 # Recommended: simply use `emacsWithPackages` with the packages you want.
7 # Alternative: use `emacs`, install everything to a system or user profile
8 # and then add this at the start your `early-init.el`:
10 ;; optional. use this if you install emacs packages to the system profile
11 (add-to-list 'package-directory-list "/run/current-system/sw/share/emacs/site-lisp/elpa")
13 ;; optional. use this if you install emacs packages to user profiles (with nix-env)
14 (add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
21 , dontRecurseIntoAttrs
26 mkElpaDevelPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/elpa-devel-packages.nix {
27 inherit (pkgs) pkgs buildPackages;
31 mkElpaPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/elpa-packages.nix {
32 inherit (pkgs) pkgs buildPackages;
36 mkNongnuDevelPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/nongnu-devel-packages.nix {
37 inherit (pkgs) pkgs buildPackages;
41 mkNongnuPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/nongnu-packages.nix {
42 inherit (pkgs) pkgs buildPackages;
46 # Contains both melpa stable & unstable
47 melpaGeneric = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/melpa-packages.nix {
51 mkManualPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/manual-packages.nix {
55 emacsWithPackages = { pkgs, lib }: pkgs.callPackage ../applications/editors/emacs/build-support/wrapper.nix {
56 inherit (pkgs.xorg) lndir;
60 in makeScope pkgs'.newScope (self: makeOverridable ({
63 , elpaDevelPackages ? mkElpaDevelPackages { inherit pkgs lib; } self
64 , elpaPackages ? mkElpaPackages { inherit pkgs lib; } self
65 , nongnuDevelPackages ? mkNongnuDevelPackages { inherit pkgs lib; } self
66 , nongnuPackages ? mkNongnuPackages { inherit pkgs lib; } self
67 , melpaStablePackages ? melpaGeneric { inherit pkgs lib; } "stable" self
68 , melpaPackages ? melpaGeneric { inherit pkgs lib; } "unstable" self
69 , manualPackages ? mkManualPackages { inherit pkgs lib; } self
71 // elpaDevelPackages // { inherit elpaDevelPackages; }
72 // elpaPackages // { inherit elpaPackages; }
73 // nongnuDevelPackages // { inherit nongnuDevelPackages; }
74 // nongnuPackages // { inherit nongnuPackages; }
75 // melpaStablePackages // { inherit melpaStablePackages; }
76 // melpaPackages // { inherit melpaPackages; }
77 // manualPackages // { inherit manualPackages; }
80 # Propagate overridden scope
81 emacs = emacs'.overrideAttrs(old: {
82 passthru = (old.passthru or {}) // {
83 pkgs = dontRecurseIntoAttrs self;
87 trivialBuild = pkgs.callPackage ../applications/editors/emacs/build-support/trivial.nix {
91 elpaBuild = pkgs.callPackage ../applications/editors/emacs/build-support/elpa.nix {
95 melpaBuild = pkgs.callPackage ../applications/editors/emacs/build-support/melpa.nix {
99 emacsWithPackages = emacsWithPackages { inherit pkgs lib; } self;
100 withPackages = emacsWithPackages { inherit pkgs lib; } self;
104 # Package specific priority overrides goes here
106 # EXWM is not tagged very often, prefer it from elpa devel.
107 inherit (elpaDevelPackages) exwm;
109 # Telega uploads packages incompatible with stable tdlib to melpa
110 # Prefer the one from melpa stable
111 inherit (melpaStablePackages) telega;