Maintained fork can be found here: https://github.com/garrgravarr/guix-emacs.
This repo is meant to mirror packages from melpa (primarily). Packages without any external dependencies (non-emacs packages) will work perfectly fine (but you may not have info
documentation from emacs).
For packages with external dependencies, there are a few that are patched in emacs/packages/melpa-overrides.
I do not plan to patch them since there is a lot of them. But you can always open a merge request to patch your package and/or include it in your code with a simple package redefinition.
To use this channel, add to your .config/guix/channels.scm
:
(cons*
(channel
(name 'emacs)
(url "https://github.com/babariviere/guix-emacs")
(introduction
(make-channel-introduction
"72ca4ef5b572fea10a4589c37264fa35d4564783"
(openpgp-fingerprint
"261C A284 3452 FB01 F6DF 6CF4 F9B7 864F 2AB4 6F18"))))
;; other channels here...
)
Then run guix pull
to be able to install packages.
In (emacs packages melpa)
, you have a list of all packages from melpa (unstable).
These will be updated daily.
All packages that are unfetchable will not be included in the package list.
If this happens, you can always use guix import elpa -t melpa <package_name+>
.
In emacs/packages/melpa-overrides, define a new package:
(define-override emacs-my-package pkg
(package
(inherit pkg) ; inherit from generated package
))
To build your package, you can run:
guix build -L . '(@@ (emacs packages melpa) emacs-my-package)'
Note: I don’t plan them to do it for now. So, don’t expect anything from this list.
We could export sources as a json file like it’s done in Nix emacs-overlay. After that, we could provide a function to generate packages dynamically.
Example:
(melpa-package "my-package") ; would return a <package emacs-my-package> with all dependencies.
This would avoid the long compile time but might be less practical to use.
Instead of overriding packages manually by copy pasting code from guix, we can try to inherit packages from guix and change source + build inputs to include up-to-date packages.
What this can look like:
(define-public emacs-my-package
(inherit e/emacs-my-package)
(source (package-source g/emacs-my-source))
(build-system melpa-build-system)
(build-inputs (replace (package-build-inputs e/emacs-my-package)
; replace all emacs packages...
)))
One issue with this: some packages will fail to build since they expect files to be at a certain place. So it may cause more issue than just plain elisp files.
There is a small documentation to explain how the updating is done: docs/how_it_works.org