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 `init.el`:
12 ;; optional. makes unpure packages archives unavailable
13 (setq package-archives nil)
15 ;; optional. use this if you install emacs packages to the system profile
16 (add-to-list 'package-directory-list "/run/current-system/sw/share/emacs/site-lisp/elpa")
18 ;; optional. use this if you install emacs packages to user profiles (with nix-env)
19 (add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
28 , dontRecurseIntoAttrs
33 mkElpaPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/elpa-packages.nix {
34 inherit (pkgs) stdenv texinfo writeText gcc pkgs buildPackages;
38 mkNongnuPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/nongnu-packages.nix {
39 inherit (pkgs) buildPackages;
43 # Contains both melpa stable & unstable
44 melpaGeneric = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/melpa-packages.nix {
48 mkManualPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/manual-packages.nix {
52 emacsWithPackages = { pkgs, lib }: import ../build-support/emacs/wrapper.nix {
53 inherit (pkgs) makeWrapper runCommand gcc;
54 inherit (pkgs.xorg) lndir;
58 in makeScope pkgs'.newScope (self: makeOverridable ({
61 , elpaPackages ? mkElpaPackages { inherit pkgs lib; } self
62 , nongnuPackages ? mkNongnuPackages { inherit pkgs lib; } self
63 , melpaStablePackages ? melpaGeneric { inherit pkgs lib; } "stable" self
64 , melpaPackages ? melpaGeneric { inherit pkgs lib; } "unstable" self
65 , manualPackages ? mkManualPackages { inherit pkgs lib; } self
67 // elpaPackages // { inherit elpaPackages; }
68 // nongnuPackages // { inherit nongnuPackages; }
69 // melpaStablePackages // { inherit melpaStablePackages; }
70 // melpaPackages // { inherit melpaPackages; }
71 // manualPackages // { inherit manualPackages; }
74 # Propagate overriden scope
75 emacs = emacs'.overrideAttrs(old: {
76 passthru = (old.passthru or {}) // {
77 pkgs = dontRecurseIntoAttrs self;
81 trivialBuild = pkgs.callPackage ../build-support/emacs/trivial.nix {
85 melpaBuild = pkgs.callPackage ../build-support/emacs/melpa.nix {
89 emacsWithPackages = emacsWithPackages { inherit pkgs lib; } self;
90 withPackages = emacsWithPackages { inherit pkgs lib; } self;
94 # Package specific priority overrides goes here
96 # Telega uploads packages incompatible with stable tdlib to melpa
97 # Prefer the one from melpa stable
98 inherit (melpaStablePackages) telega;