[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proof of Concept: Import Emacs' use-packaged packages into Guix' man
From: |
Mekeor Melire |
Subject: |
Re: Proof of Concept: Import Emacs' use-packaged packages into Guix' manifest.scm |
Date: |
Tue, 20 Dec 2022 09:45:40 +0000 |
2022-12-19 14:15 andrew@trop.in:
On 2022-12-18 09:11, Liliana Marie Prikler wrote:
> Am Sonntag, dem 18.12.2022 um 01:54 +0000 schrieb Mekeor Melire:
I'm neither the author, nor the user of guix home import, however I think it
could be a good place for such a functionality, but I would suggest to
maintain this helper functions for a while in a personal channel, mature it
and revisit this question later.
Good idea. But separating this into a personal channel could also lead to the
feature being forgotten.
To make a solution more robust and complete, you can take a look at
straight.el and how it redefines use-package-ensure-function and do
something similiar to generate a list of packages for guix. Another detail
is that use-package accepts a symbol value for :ensure and you can write
something like:
;; (setq use-package-always-ensure t) ; as an alternative to :ensure t
(use-package vertico
:ensure t
...)
(use-package vertico-directory
:ensure vertico
...)
True! The parser should consider the :ensure keyword.
This way you won't need a concept of "blocked" packages.
It'd still be good to have such a concept in order to block packages that
won't be used on Guix-driven system. For example:
#+begin_src elisp
(when (this-is-not-a-guix-driven-system)
(use-package some-package-that-is-not-packaged-for-guix))
;; or equivalently
(use-package some-package-that-is-not-packaged-for-guix
:when (this-is-not-a-guix-driven-system))
#+end_src
One more idea: make a function which accepts file-like/origin object instead
of string and generates a package with propagated-dependencies based on the
content of source code provided as an argument.
You mean something like this?:
#+begin_src scheme
(define-public my-emacs
(emacs-from-init
:custom-emacs-package emacs-with-athena-instead-of-gtk
:init "/home/user/.emacs.d/init.el"))
#+end_src
By the way, this won't be a "pure" package. When using
=emacsWithPackagesFromUsePackage= feature from nix-community's emacs-overlay,
I needed to pass an --impure flag.
Personally, with my emacs config I do the things vice versa: I have elisp
code in scheme files with a list of explicit dependencies:
https://git.sr.ht/~abcdw/rde/tree/b57387f2/src/rde/features/emacs-xyz.scm#L946
Interesting!