This commit is contained in:
Daniel Ziltener 2023-12-01 14:32:56 +01:00
parent 9d4b32fe67
commit 84deca651f
Signed by: zilti
GPG key ID: B38976E82C9DAE42
3 changed files with 19 additions and 13 deletions

View file

@ -10,6 +10,8 @@
#+NAME: module-list
- gnu
- gnu image
- gnu services authentication
- gnu services base
- gnu services dbus
- gnu services desktop
@ -21,7 +23,7 @@
- gnu system nss
#+begin_src scheme :noweb yes :exports none :results code pp :tangle config.scm
<<list-to-use(use-call="use-modules",entries=module-list)>>
<<list-to-use(use-call="use-modules",entries=module-list,all-parens=1)>>
#+end_src
** Service Modules

View file

@ -1,4 +1,7 @@
(use-modules gnu
(use-modules
(gnu)
(gnu image)
(gnu services authentication)
(gnu services base)
(gnu services dbus)
(gnu services desktop)

View file

@ -7,11 +7,12 @@ This library contains code blocks to be used by other files in this repository.
Converting org lists into guix ~use-~ calls.
#+NAME: list-to-use
#+begin_src emacs-lisp :var use-call="use-modules" :var entries='() :results code pp
#+begin_src emacs-lisp :var use-call="use-modules" :var entries='() :var all-parens=0 :results code pp
`(,(make-symbol use-call)
,@(mapcar (lambda (x)
(let ((splits (split-string x)))
(if (length= splits 1)
(if (and (length= splits 1)
(= 0 all-parens))
(make-symbol (car splits))
(mapcar (lambda (y) (make-symbol y))
splits))))