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) stdenv texinfo writeText gcc pkgs buildPackages;
31 mkElpaPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/elpa-packages.nix {
32 inherit (pkgs) stdenv texinfo writeText gcc pkgs buildPackages;
36 mkNongnuPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/nongnu-packages.nix {
37 inherit (pkgs) buildPackages;
41 # Contains both melpa stable & unstable
42 melpaGeneric = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/melpa-packages.nix {
46 mkManualPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/manual-packages.nix {
50 emacsWithPackages = { pkgs, lib }: pkgs.callPackage ../build-support/emacs/wrapper.nix {
51 inherit (pkgs.xorg) lndir;
55 in makeScope pkgs'.newScope (self: makeOverridable ({
58 , elpaDevelPackages ? mkElpaDevelPackages { inherit pkgs lib; } self
59 , elpaPackages ? mkElpaPackages { inherit pkgs lib; } self
60 , nongnuPackages ? mkNongnuPackages { inherit pkgs lib; } self
61 , melpaStablePackages ? melpaGeneric { inherit pkgs lib; } "stable" self
62 , melpaPackages ? melpaGeneric { inherit pkgs lib; } "unstable" self
63 , manualPackages ? mkManualPackages { inherit pkgs lib; } self
65 // elpaDevelPackages // { inherit elpaDevelPackages; }
66 // elpaPackages // { inherit elpaPackages; }
67 // nongnuPackages // { inherit nongnuPackages; }
68 // melpaStablePackages // { inherit melpaStablePackages; }
69 // melpaPackages // { inherit melpaPackages; }
70 // manualPackages // { inherit manualPackages; }
73 # Propagate overridden scope
74 emacs = emacs'.overrideAttrs(old: {
75 passthru = (old.passthru or {}) // {
76 pkgs = dontRecurseIntoAttrs self;
80 trivialBuild = pkgs.callPackage ../build-support/emacs/trivial.nix {
84 melpaBuild = pkgs.callPackage ../build-support/emacs/melpa.nix {
88 emacsWithPackages = emacsWithPackages { inherit pkgs lib; } self;
89 withPackages = emacsWithPackages { inherit pkgs lib; } self;
93 # Package specific priority overrides goes here
95 # EXWM is not tagged very often, prefer it from elpa devel.
96 inherit (elpaDevelPackages) exwm;
98 # Telega uploads packages incompatible with stable tdlib to melpa
99 # Prefer the one from melpa stable
100 inherit (melpaStablePackages) telega;