Clojure lib for reading/writing systemd and quadlet config files
| bin | ||
| specs | ||
| src/co/gaiwan | ||
| test/co/gaiwan | ||
| .gitignore | ||
| bb.edn | ||
| deps.edn | ||
| README.md | ||
| tests.edn | ||
co.gaiwan/systemd-config
Read and write systemd/quadlet type configuration files. In particular this
converts back and forth between a pure clojure/edn data structure, and a
.service, .container, etc file.
Clojure version:
{:Unit/Description "PostgreSQL"
:Container/Image "docker.io/library/postgres:17-alpine"
:Container/Environment {"POSTGRES_PASSWORD" "postgres"
"POSTGRES_USER" "postgres"}
:Container/Volume "%h/pg-data:/var/lib/postgresql/data:Z"
:Service/Restart "always"
:Install/WantedBy ["default.target"]}
postgresql.container file
[Unit]
Description=PostgreSQL
[Container]
Image=docker.io/library/postgres:17-alpine
Environment=POSTGRES_PASSWORD=postgres
Environment=POSTGRES_USER=postgres
Volume=%h/oak-data/pg-data:/var/lib/postgresql/data:Z
[Service]
Restart=always
[Install]
WantedBy=default.target
REPL operations
Run all tests
(do (require 'kaocha.repl) (require 'co.gaiwan.systemd-config-test :reload) (kaocha.repl/run-all))
Run specific test
(do (require 'kaocha.repl) (kaocha.repl/run 'co.gaiwan.systemd-config-test/write-val-test))