System services provided by PantherX channel
nebula-service-type
This service is located in (px services networking)
module.
(services (cons*
(service nebula-service-type)
...))
(services (cons*
(service nebula-service-type
(list (nebula-configuration
(provision '(nebula-1))
(config-path "/etc/nebula/network1/config.yml"))
(nebula-configuration
(provision '(nebula-2))
(config-path "/etc/nebula/network2/config.yml"))))
...))
(define %nebula-configuration
(plain-file "nebula.yml"
"---
pki:
ca: /etc/nebula/certs/ca.crt
cert: /etc/nebula/certs/host.crt
key: /etc/nebula/certs/host.key
..."))
(px-server-os
(operating-system
...
(services (cons*
(service nebula-service-type
(list (nebula-configuration
(provision '(nebula-1))
(config-path %nebula-configuration))))
...))))
more details about Nebula network can be found here.
px-server-launcher-service-type
(define %launcher-configuration
(px-server-launcher-configuration
(user "panther") ;; optional, default=panther
(group "users") ;; optional, default=users
(cwd "/path/to/working/directory") ;; optional, default=#f
(executable "/path/to/executable/file")
(args '()) ;; optional, list of arguments pass to the executable
))
(services (cons*
(service px-server-launcher-service-type
%launcher-configuration)
...))
npm
command:(services (cons*
(service px-server-launcher-service-type
(px-server-launcher-configuration
(cwd "/home/panther/example-app")
(executable "npm")
(args '("start"))))
...))
pm2
installed locally on the application directory:(services (cons*
(service px-server-launcher-service-type
(px-server-launcher-configuration
(cwd "/home/panther/example-app")
(executable "./node_modules/.bin/pm2")
(args '("start" "ecosystem.config.js"))))
...))
(services (cons*
(service px-server-launcher-service-type
(px-server-launcher-configuration
(executable "/home/panther/example-app/node_modules/.bin/pm2")
(args '("start" "/home/panther/example-app/index.js"))))
...))
create-swap-space-service
This service checks if the /swapfile
is initialized and creates it with the given size if not.
(services (cons*
(create-swap-space-service "2G") ;; size of the swap file
...))
rsyslog-service-type
This service adds a new rsyslog
daemon with provided configuration to the system.
in order to add the service with default configuration:
(services (cons*
(service rsyslog-service-type)
...))
in order to modify the default configuration, first we create the configuration file:
(define %rsyslog-configuration
(plain-file "rsyslog.conf"
"..."))
then we modify the service configuration as follows:
(services (cons*
(service rsyslog-service-type
(rsyslog-configuration
(config-file %rsyslog-configuration)))
...))
in order to add log forwarding to a remote server, we need to append forwarding rules to the default configuration:
(define %remote-rsyslog-config-file
(plain-file "remote-rsyslog.conf"
(string-append %rsyslog-default-config "\n\n"
"$PreserveFQDN on
$DefaultNetstreamDriverCAFile /etc/rsyslog/ca.pem
$DefaultNetstreamDriver gtls
$ActionSendStreamDriverMode 1
$ActionSendStreamDriverAuthMode anon
*.* @@(o)log.example.com:1234
")))
then modify the service based on what mentioned in custom configuration section.
PantherX & (unofficial) GNU Guix Wiki.
Last update: 2024-04-21 10:28:03 +0000 | Apache-2.0
Inspired by the excellent Arch Linux Wiki