On 2022-12-18 09:11, Liliana Marie Prikler wrote: > Am Sonntag, dem 18.12.2022 um 01:54 +0000 schrieb Mekeor Melire: >> Nevertheless, for me, personally, it's pretty neat and handy to >> use, because I don't need to maintain the list of emacs-packages >> in two places. I also think that it could come pretty handy for >> many others, at least in order to initialize their user-profile, >> by running something like ~guix package -e '(some-magic >> "/home/user/.emacs.d/init.el")'~. > I think we should be able to build an Emacs service in Guix Home that > can manage init.el. As a workaround, use-package should also have a > :when clause, so you can use :when (featurep 'some-package-autoloads) > if you're unsure whether 'some-package is actually installed. This > makes your init file a little more resilient and is particularly useful > with pure shells. > >> What do you think? Should this go into a separate, private >> channel? Into the Guix Cookbook? Into Guix, if so, then probably >> with lots of changes? Should it just stay here, in this mailing >> list thread? Or do you think this is just a bad idea in general? > Given the caveats, I would rather like to see an Emacs Lisp based > script that mocks use-package and generates a manifest by evaluting > init.el. This should give you more correct results. It's not a bad > idea per se, but as-is, I think it would better be maintained in your > own channel before upstreaming. > > For upstreaming, I see two potential paths. The first one would be > integration to `guix home import', which Andrew Tropin (CC'd) could > probably tell you more on. 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. 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: --8<---------------cut here---------------start------------->8--- ;; (setq use-package-always-ensure t) ; as an alternative to :ensure t (use-package vertico :ensure t ...) (use-package vertico-directory :ensure vertico ...) --8<---------------cut here---------------end--------------->8--- This way you won't need a concept of "blocked" packages. 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. 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 Nevertheless, your idea with use-package looks good to me. > The second would be integration into `guix package' as a callable > function/command line argument, but IMHO that's less likely to pass. > > > Cheers -- Best regards, Andrew Tropin