babariviere / guix-emacs

[UNMAINTAINED] Guix channel for automatically generated emacs packages.
GNU General Public License v3.0
28 stars 4 forks source link
emacs guix guix-channel melpa

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.

** Quickstart

To use this channel, add to your ~.config/guix/channels.scm~:

+begin_src scheme

(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... )

+end_src

Then run ~guix pull~ to be able to install packages.

** Content of this channel *** Melpa 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+>~.

** Override package In emacs/packages/melpa-overrides, define a new package:

+begin_src scheme

(define-override emacs-my-package pkg (package (inherit pkg) ; inherit from generated package ))

+end_src

To build your package, you can run:

+begin_src sh

guix build -L . '(@@ (emacs packages melpa) emacs-my-package)'

+end_src

** Potential improvements Note: I don't plan them to do it for now. So, don't expect anything from this list.

*** Allow to import only one package

*** Support Emacs native compilation

*** Export sources as a json We could export sources as a json file like it's done in [[https://github.com/nix-community/emacs-overlay/blob/master/repos/melpa/recipes-archive-melpa.json][Nix emacs-overlay]]. After that, we could provide a function to generate packages dynamically.

Example:

+begin_src scheme

(melpa-package "my-package") ; would return a with all dependencies.

+end_src

This would avoid the long compile time but might be less practical to use.

*** Reuse packages from guix channel 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:

+begin_src scheme

(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... )))

+end_src

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.

** Internals There is a small documentation to explain how the updating is done: [[file:docs/how_it_works.org]]