This commit is contained in:
Daniel Ziltener 2023-12-12 10:57:23 +01:00
parent 5fd0737748
commit 75e8c9aaa9
Signed by: zilti
GPG key ID: B38976E82C9DAE42
4 changed files with 103 additions and 36 deletions

View file

@ -1,3 +1,4 @@
((nil . ((geiser-scheme-implementation . guile) ((nil . ((geiser-scheme-implementation . guile)
(geiser-guile-binary . ("guix" "repl")))) ;;(geiser-guile-binary . ("guix" "repl"))
))
(org-mode . ((org-confirm-babel-evaluate . nil)))) (org-mode . ((org-confirm-babel-evaluate . nil))))

View file

@ -1,7 +1,7 @@
#+TITLE: GUIX System Configuration #+TITLE: GUIX System Configuration
#+AUTHOR: Daniel Ziltener #+AUTHOR: Daniel Ziltener
#+PROPERTY: scheme-implementation guile #+PROPERTY: scheme-implementation guile
#+PROPERTY: header-args:scheme :comments both #+PROPERTY: header-args:scheme :comments both :session *guile*
#+begin_src emacs-lisp :results none #+begin_src emacs-lisp :results none
(org-babel-lob-ingest "./library.org") (org-babel-lob-ingest "./library.org")
@ -53,7 +53,7 @@ This is to be run after setting up the partitions.
- nongnu packages linux - nongnu packages linux
- nongnu system linux-initrd - nongnu system linux-initrd
#+begin_src scheme :noweb yes :exports none :results code pp :tangle config.scm #+begin_src scheme :noweb yes :exports none :results output :tangle config.scm
<<list-to-use(use-call="use-modules",entries=module-list,all-parens=1)>> <<list-to-use(use-call="use-modules",entries=module-list,all-parens=1)>>
#+end_src #+end_src
@ -63,10 +63,12 @@ This is to be run after setting up the partitions.
- desktop - desktop
- xorg - xorg
#+begin_src scheme :noweb yes :exports none :results code pp :tangle config.scm #+begin_src scheme :noweb yes :exports none :results output :tangle config.scm
<<list-to-use(use-call="use-service-modules",entries=service-module-list)>> <<list-to-use(use-call="use-service-modules",entries=service-module-list)>>
#+end_src #+end_src
#+RESULTS:
** Package Modules ** Package Modules
#+NAME: package-module-list #+NAME: package-module-list
@ -82,7 +84,7 @@ This is to be run after setting up the partitions.
- wm - wm
- xorg - xorg
#+begin_src scheme :noweb yes :exports none :results code pp :tangle config.scm #+begin_src scheme :noweb yes :exports none :results output :tangle config.scm
<<list-to-use(use-call="use-package-modules",entries=package-module-list)>> <<list-to-use(use-call="use-package-modules",entries=package-module-list)>>
#+end_src #+end_src
@ -103,6 +105,8 @@ The variable ~%local-filesystem~ extracts the file system definitions from the i
(interaction-environment))))) (interaction-environment)))))
#+end_src #+end_src
#+RESULTS:
As a sibling to the former, the variable ~%local-swap~ does the same with the swap partition. As a sibling to the former, the variable ~%local-swap~ does the same with the swap partition.
#+begin_src scheme :tangle config.scm #+begin_src scheme :tangle config.scm
@ -157,6 +161,8 @@ This adds the Nonguix channel.
%base-packages)) %base-packages))
#+end_src #+end_src
#+RESULTS: root-package-block
** Services ** Services
#+NAME: root-services-block #+NAME: root-services-block
@ -189,7 +195,7 @@ These services are unmodified, or have just few settings.
| fprintd | () | | fprintd | () |
#+NAME: root-simple-service-block #+NAME: root-simple-service-block
#+begin_src scheme :noweb yes :exports none :results code #+begin_src scheme :noweb yes :exports none :results output
<<service-converter(input=root-simple-services)>> <<service-converter(input=root-simple-services)>>
#+end_src #+end_src

View file

@ -18,7 +18,20 @@
;; [[file:config.org::*Modules][Modules:1]] ;; [[file:config.org::*Modules][Modules:1]]
nil (use-modules (gnu)
(gnu image)
(gnu services authentication)
(gnu services base)
(gnu services dbus)
(gnu services desktop)
(gnu services linux)
(gnu services networking)
(gnu services pm)
(gnu services virtualization)
(gnu services xorg)
(gnu system nss)
(nongnu packages linux)
(nongnu system linux-initrd))
;; Modules:1 ends here ;; Modules:1 ends here
;; Service Modules ;; Service Modules
@ -29,7 +42,7 @@ nil
;; [[file:config.org::*Service Modules][Service Modules:1]] ;; [[file:config.org::*Service Modules][Service Modules:1]]
nil (use-service-modules desktop xorg)
;; Service Modules:1 ends here ;; Service Modules:1 ends here
;; Package Modules ;; Package Modules
@ -49,7 +62,17 @@ nil
;; [[file:config.org::*Package Modules][Package Modules:1]] ;; [[file:config.org::*Package Modules][Package Modules:1]]
nil (use-package-modules bootloaders
certs
emacs
emacs-xyz
fonts
pciutils
readline
terminals
version-control
wm
xorg)
;; Package Modules:1 ends here ;; Package Modules:1 ends here
;; File System ;; File System
@ -70,6 +93,8 @@ nil
;; #+RESULTS:
;; As a sibling to the former, the variable ~%local-swap~ does the same with the swap partition. ;; As a sibling to the former, the variable ~%local-swap~ does the same with the swap partition.
@ -121,7 +146,13 @@ nil
%base-user-accounts)) %base-user-accounts))
(packages (packages
(append (append
nil (list emacs
emacs-desktop-environment
font-terminus
git
hwdata
nss-certs
readline)
%base-packages)) %base-packages))
(services (services
(append (append
@ -138,7 +169,22 @@ nil
(authorized-keys (authorized-keys
(append (list (plain-file "non-guix.pub" (append (list (plain-file "non-guix.pub"
"<<nonguix-pubkey>>"))))))) "<<nonguix-pubkey>>")))))))
nil (list
(service tlp-service-type)
(service thermald-service-type
(thermald-configuration
(adaptive? #t)))
(service bluetooth-service-type)
(service earlyoom-service-type
(earlyoom-configuration
(minimum-available-memory 5)
(minimum-free-swap 5)))
(service inputattach-service-type)
(service libvirt-service-type
(libvirt-configuration
(unix-sock-group "libvirt")))
(service fstrim-service-type)
(service fprintd-service-type))
(list (list
(service greetd-service-type (service greetd-service-type
(greetd-configuration (greetd-configuration

View file

@ -1,5 +1,5 @@
# -*- geiser-scheme-implementation: guile -*-
#+TITLE: Babel Library #+TITLE: Babel Library
#+PROPERTY: header-args:scheme: :session *guile* :prologue "(use-modules (ice-9 pretty-print))"
This library contains code blocks to be used by other files in this repository. This library contains code blocks to be used by other files in this repository.
@ -8,7 +8,8 @@ This library contains code blocks to be used by other files in this repository.
Converting org lists into guix ~use-~ calls. Converting org lists into guix ~use-~ calls.
#+NAME: list-to-use #+NAME: list-to-use
#+begin_src scheme :var use-call="use-modules" :var entries='() :var all-parens=0 :results code pp #+begin_src scheme :var use-call="use-modules" :var entries='() :var all-parens=0 :results output
(pretty-print
`(,(string->symbol use-call) `(,(string->symbol use-call)
,@(map (lambda (x) ,@(map (lambda (x)
(let ((splits (string-split x #\ ))) (let ((splits (string-split x #\ )))
@ -17,21 +18,34 @@ Converting org lists into guix ~use-~ calls.
(string->symbol (car splits)) (string->symbol (car splits))
(map (lambda (y) (string->symbol y)) (map (lambda (y) (string->symbol y))
splits)))) splits))))
entries)) entries)))
#+end_src #+end_src
Converting Org lists into Scheme symbol lists. Converting Org lists into Scheme symbol lists.
#+NAME: sym-list-sample
- Entry 1
- Entry 2
#+NAME: org-to-scheme-sym-list #+NAME: org-to-scheme-sym-list
#+begin_src scheme :var input='() :results code pp #+begin_src scheme :var input=sym-list-sample :results output
(pretty-print
`(list `(list
,@(map (lambda (x) (string->symbol x)) input)) ,@(map (lambda (x) (string->symbol x)) input)))
#+end_src #+end_src
#+RESULTS: org-to-scheme-sym-list
: ice-9/boot-9.scm:1685:16: In procedure raise-exception:
: Wrong type to apply: "Entry 1"
:
: Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
: scheme@(guile-user) [1]>
* Converting Tables * Converting Tables
#+NAME: service-converter #+NAME: service-converter
#+begin_src scheme :var input='() :colnames yes :results code pp #+begin_src scheme :var input='() :colnames yes :results code
(pretty-print
`(list `(list
,@(map ,@(map
(lambda (row) (lambda (row)
@ -41,5 +55,5 @@ Converting Org lists into Scheme symbol lists.
(,(string->symbol (string-append service-name "-configuration")) (,(string->symbol (string-append service-name "-configuration"))
,@(call-with-input-string configuration ,@(call-with-input-string configuration
read))))) read)))))
input)) input)))
#+end_src #+end_src