.
This commit is contained in:
parent
5fd0737748
commit
75e8c9aaa9
4 changed files with 103 additions and 36 deletions
|
@ -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))))
|
||||||
|
|
16
config.org
16
config.org
|
@ -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
|
||||||
|
|
||||||
|
|
56
config.scm
56
config.scm
|
@ -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
|
||||||
|
|
64
library.org
64
library.org
|
@ -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,38 +8,52 @@ 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
|
||||||
`(,(string->symbol use-call)
|
(pretty-print
|
||||||
,@(map (lambda (x)
|
`(,(string->symbol use-call)
|
||||||
(let ((splits (string-split x #\ )))
|
,@(map (lambda (x)
|
||||||
(if (and (= (length splits) 1)
|
(let ((splits (string-split x #\ )))
|
||||||
(= 0 all-parens))
|
(if (and (= (length splits) 1)
|
||||||
(string->symbol (car splits))
|
(= 0 all-parens))
|
||||||
(map (lambda (y) (string->symbol y))
|
(string->symbol (car splits))
|
||||||
splits))))
|
(map (lambda (y) (string->symbol y))
|
||||||
entries))
|
splits))))
|
||||||
|
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
|
||||||
`(list
|
(pretty-print
|
||||||
,@(map (lambda (x) (string->symbol x)) input))
|
`(list
|
||||||
|
,@(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
|
||||||
`(list
|
(pretty-print
|
||||||
,@(map
|
`(list
|
||||||
(lambda (row)
|
,@(map
|
||||||
(let ((service-name (car row))
|
(lambda (row)
|
||||||
(configuration (cadr row)))
|
(let ((service-name (car row))
|
||||||
`(service ,(string->symbol (string-append service-name "-service-type"))
|
(configuration (cadr row)))
|
||||||
(,(string->symbol (string-append service-name "-configuration"))
|
`(service ,(string->symbol (string-append service-name "-service-type"))
|
||||||
,@(call-with-input-string configuration
|
(,(string->symbol (string-append service-name "-configuration"))
|
||||||
read)))))
|
,@(call-with-input-string configuration
|
||||||
input))
|
read)))))
|
||||||
|
input)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
Loading…
Reference in a new issue