2020-04-24 23:36:52 +00:00
|
|
|
# package.el-based emacs packages
|
|
|
|
|
|
|
|
## FOR USERS
|
|
|
|
#
|
|
|
|
# Recommended: simply use `emacsWithPackages` with the packages you want.
|
|
|
|
#
|
2020-12-25 13:55:36 +00:00
|
|
|
# Alternative: use `emacs`, install everything to a system or user profile
|
2020-04-24 23:36:52 +00:00
|
|
|
# and then add this at the start your `init.el`:
|
|
|
|
/*
|
|
|
|
(require 'package)
|
|
|
|
|
|
|
|
;; optional. makes unpure packages archives unavailable
|
|
|
|
(setq package-archives nil)
|
|
|
|
|
|
|
|
;; optional. use this if you install emacs packages to the system profile
|
|
|
|
(add-to-list 'package-directory-list "/run/current-system/sw/share/emacs/site-lisp/elpa")
|
|
|
|
|
|
|
|
;; optional. use this if you install emacs packages to user profiles (with nix-env)
|
|
|
|
(add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
|
|
|
|
|
|
|
|
(package-initialize)
|
|
|
|
*/
|
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
{ pkgs', makeScope, makeOverridable, emacs }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
mkElpaPackages = { pkgs, lib }: import ../applications/editors/emacs-modes/elpa-packages.nix {
|
|
|
|
inherit (pkgs) stdenv texinfo writeText;
|
|
|
|
inherit lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Contains both melpa stable & unstable
|
2021-02-24 18:30:23 +00:00
|
|
|
melpaGeneric = { pkgs, lib }: import ../applications/editors/emacs-modes/melpa-packages.nix {
|
|
|
|
inherit lib pkgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
mkOrgPackages = { lib }: import ../applications/editors/emacs-modes/org-packages.nix {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit lib;
|
|
|
|
};
|
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
mkManualPackages = { pkgs, lib }: import ../applications/editors/emacs-modes/manual-packages.nix {
|
|
|
|
inherit lib pkgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
emacsWithPackages = { pkgs, lib }: import ../build-support/emacs/wrapper.nix {
|
|
|
|
inherit (pkgs) makeWrapper runCommand;
|
|
|
|
inherit (pkgs.xorg) lndir;
|
|
|
|
inherit lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
in makeScope pkgs'.newScope (self: makeOverridable ({
|
|
|
|
pkgs ? pkgs'
|
|
|
|
, lib ? pkgs.lib
|
|
|
|
, elpaPackages ? mkElpaPackages { inherit pkgs lib; } self
|
|
|
|
, melpaStablePackages ? melpaGeneric { inherit pkgs lib; } "stable" self
|
|
|
|
, melpaPackages ? melpaGeneric { inherit pkgs lib; } "unstable" self
|
|
|
|
, orgPackages ? mkOrgPackages { inherit lib; } self
|
|
|
|
, manualPackages ? mkManualPackages { inherit pkgs lib; } self
|
2020-04-24 23:36:52 +00:00
|
|
|
}: ({}
|
|
|
|
// elpaPackages // { inherit elpaPackages; }
|
|
|
|
// melpaStablePackages // { inherit melpaStablePackages; }
|
|
|
|
// melpaPackages // { inherit melpaPackages; }
|
|
|
|
// orgPackages // { inherit orgPackages; }
|
2020-05-03 17:38:23 +00:00
|
|
|
// manualPackages // { inherit manualPackages; }
|
2020-04-24 23:36:52 +00:00
|
|
|
// {
|
2021-02-24 18:30:23 +00:00
|
|
|
|
|
|
|
inherit emacs;
|
|
|
|
|
|
|
|
trivialBuild = pkgs.callPackage ../build-support/emacs/trivial.nix {
|
|
|
|
inherit (self) emacs;
|
|
|
|
};
|
|
|
|
|
|
|
|
melpaBuild = pkgs.callPackage ../build-support/emacs/melpa.nix {
|
|
|
|
inherit (self) emacs;
|
|
|
|
};
|
|
|
|
|
|
|
|
emacsWithPackages = emacsWithPackages { inherit pkgs lib; } self;
|
|
|
|
withPackages = emacsWithPackages { inherit pkgs lib; } self;
|
|
|
|
|
|
|
|
}// {
|
|
|
|
|
|
|
|
# Package specific priority overrides goes here
|
|
|
|
|
|
|
|
# Telega uploads packages incompatible with stable tdlib to melpa
|
|
|
|
# Prefer the one from melpa stable
|
|
|
|
inherit (melpaStablePackages) telega;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
) {})
|