Emacs: Difference between revisions
imported>LoganWalls m Fix typo |
imported>Fxttr Adds a chapter regarding packing and testing emacs nixpkgs |
||
Line 235: | Line 235: | ||
... | ... | ||
]; | ]; | ||
}</nowiki>}} | |||
=== Packaging and testing emacs nixpkgs === | |||
Emacs packages can be defined and tested like other nixpkgs. | |||
They can be obtained from melpa, elpa or other sources such as github. | |||
{{file|default.nix|nix|<nowiki> | |||
{ trivialBuild | |||
, lib | |||
, fetchFromGitHub | |||
... | |||
}: | |||
trivialBuild { | |||
pname = "..."; | |||
version = "..."; | |||
src = fetchFromGitHub { | |||
owner = "..."; | |||
repo = "..."; | |||
rev = "..."; | |||
sha256 = "..."; | |||
}; | |||
packageRequires = [ ... ]; | |||
patches = [ ... ]; | |||
meta = { | |||
description = "..."; | |||
license = lib.licenses.gpl3; | |||
platforms = lib.platforms.all; | |||
}; | |||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
They are located at pkgs/applications/editors/emacs/elisp-packages/manual-packages/ and a new pkg must be added under pkgs/applications/editors/elisp-packages/manual-packages.nix. | |||
Once the nixpkg is ready, it can be tested using the following command. This inserts the nixpkg into the load-path of emacs. | |||
nix-shell -I nixpkgs=<path_to_nixpkgs_copy> -p "(emacsPackagesFor pkgs.emacs28).emacsWithPackages (epkgs: [ epkgs.<package> ])" | |||
[[Category:NixOS]] | [[Category:NixOS]] | ||
[[Category:Incomplete]] | [[Category:Incomplete]] | ||
[[Category:Applications]] | [[Category:Applications]] |