aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/base.scm58
-rw-r--r--gnu/services/ci.scm4
-rw-r--r--gnu/services/dbus.scm4
-rw-r--r--gnu/services/desktop.scm28
-rw-r--r--gnu/services/guix.scm2
-rw-r--r--gnu/services/networking.scm2
-rw-r--r--gnu/services/nfs.scm4
-rw-r--r--gnu/services/pam-mount.scm2
-rw-r--r--gnu/services/rsync.scm170
-rw-r--r--gnu/services/telephony.scm8
-rw-r--r--gnu/services/vpn.scm13
-rw-r--r--gnu/services/xorg.scm10
12 files changed, 228 insertions, 77 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 5f93483dda..fbd01e84d6 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
;;; Copyright © 2015, 2016, 2020 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
@@ -16,6 +16,7 @@
;;; Copyright © 2021 qblade <qblade@protonmail.com>
;;; Copyright © 2021 Hui Lu <luhuins@163.com>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022 Guillaume Le Vaillant <glv@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -35,8 +36,9 @@
(define-module (gnu services base)
#:use-module (guix store)
#:use-module (guix deprecation)
- #:autoload (guix diagnostics) (warning)
+ #:autoload (guix diagnostics) (warning &fix-hint)
#:autoload (guix i18n) (G_)
+ #:use-module (guix combinators)
#:use-module (gnu services)
#:use-module (gnu services admin)
#:use-module (gnu services shepherd)
@@ -54,7 +56,8 @@
#:select (alsa-utils crda eudev e2fsprogs fuse gpm kbd lvm2 rng-tools))
#:use-module (gnu packages bash)
#:use-module ((gnu packages base)
- #:select (coreutils glibc glibc-utf8-locales))
+ #:select (coreutils glibc glibc-utf8-locales tar))
+ #:use-module ((gnu packages compression) #:select (gzip))
#:autoload (gnu packages guile-xyz) (guile-netlink)
#:autoload (gnu packages hurd) (hurd)
#:use-module (gnu packages package-management)
@@ -72,6 +75,8 @@
#:use-module (guix i18n)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
+ #:use-module (srfi srfi-34)
+ #:use-module (srfi srfi-35)
#:use-module (ice-9 match)
#:use-module (ice-9 format)
#:re-export (user-processes-service-type ;backwards compatibility
@@ -192,6 +197,7 @@
guix-publish-configuration-nar-path
guix-publish-configuration-cache
guix-publish-configuration-ttl
+ guix-publish-configuration-negative-ttl
guix-publish-service-type
gpm-configuration
@@ -1562,7 +1568,7 @@ archive' public keys, with GUIX."
(timeout guix-configuration-timeout ;integer
(default 0))
(log-compression guix-configuration-log-compression
- (default 'bzip2))
+ (default 'gzip))
(discover? guix-configuration-discover?
(default #f))
(extra-options guix-configuration-extra-options ;list of strings
@@ -1706,7 +1712,14 @@ proxy of 'guix-daemon'...~%")
(string-append "GUIX_LOCPATH="
#$glibc-utf8-locales
"/lib/locale")
- "LC_ALL=en_US.utf8")
+ "LC_ALL=en_US.utf8"
+ ;; Make 'tar' and 'gzip' available so
+ ;; that 'guix perform-download' can use
+ ;; them when downloading from Software
+ ;; Heritage via '(guix swh)'.
+ (string-append "PATH="
+ #$(file-append tar "/bin") ":"
+ #$(file-append gzip "/bin")))
(if proxy
(list (string-append "http_proxy=" proxy)
(string-append "https_proxy=" proxy))
@@ -1817,7 +1830,9 @@ proxy of 'guix-daemon'...~%")
(workers guix-publish-configuration-workers ;#f | integer
(default #f))
(ttl guix-publish-configuration-ttl ;#f | integer
- (default #f)))
+ (default #f))
+ (negative-ttl guix-publish-configuration-negative-ttl ;#f | integer
+ (default #f)))
(define-deprecated (guix-publish-configuration-compression-level config)
"Return a compression level, the old way."
@@ -1852,8 +1867,8 @@ raise a deprecation warning if the 'compression-level' field was used."
lst))))
(match-record config <guix-publish-configuration>
- (guix port host nar-path cache workers ttl cache-bypass-threshold
- advertise?)
+ (guix port host nar-path cache workers ttl negative-ttl
+ cache-bypass-threshold advertise?)
(list (shepherd-service
(provision '(guix-publish))
(requirement `(user-processes
@@ -1879,6 +1894,11 @@ raise a deprecation warning if the 'compression-level' field was used."
#$(number->string ttl)
"s"))
#~())
+ #$@(if negative-ttl
+ #~((string-append "--negative-ttl="
+ #$(number->string negative-ttl)
+ "s"))
+ #~())
#$@(if cache
#~((string-append "--cache=" #$cache)
#$(string-append
@@ -2388,6 +2408,22 @@ Linux @dfn{kernel mode setting} (KMS).")))
"Return true if STR denotes an IPv6 address."
(false-if-exception (->bool (inet-pton AF_INET6 str))))
+(define-compile-time-procedure (assert-valid-address (address string?))
+ "Ensure ADDRESS has a valid netmask."
+ (unless (cidr->netmask address)
+ (raise
+ (make-compound-condition
+ (formatted-message (G_ "address '~a' lacks a network mask")
+ address)
+ (condition (&error-location
+ (location
+ (source-properties->location procedure-call-location))))
+ (condition (&fix-hint
+ (hint (format #f (G_ "\
+Write, say, @samp{\"~a/24\"} for a 24-bit network mask.")
+ address)))))))
+ address)
+
(define-record-type* <static-networking>
static-networking make-static-networking
static-networking?
@@ -2405,7 +2441,8 @@ Linux @dfn{kernel mode setting} (KMS).")))
network-address make-network-address
network-address?
(device network-address-device) ;string--e.g., "en01"
- (value network-address-value) ;string--CIDR notation
+ (value network-address-value ;string--CIDR notation
+ (sanitize assert-valid-address))
(ipv6? network-address-ipv6? ;Boolean
(thunked)
(default
@@ -2546,6 +2583,7 @@ to CONFIG."
#$(network-address-ipv6? address))
;; FIXME: loopback?
(link-set #$(network-address-device address)
+ #:multicast-on #t
#:up #t)))
addresses)
#$@(map (match-lambda
@@ -2716,7 +2754,7 @@ to handle."
(static-networking
(addresses (list (network-address
(device "lo")
- (value "127.0.0.1"))))
+ (value "127.0.0.1/8"))))
(requirement '())
(provision '(loopback))))
diff --git a/gnu/services/ci.scm b/gnu/services/ci.scm
index 0c3566bcaf..172f85fe8e 100644
--- a/gnu/services/ci.scm
+++ b/gnu/services/ci.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018, 2019, 2020, 2021 Christopher Baines <mail@cbaines.net>
-;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2021, 2022 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -84,6 +84,8 @@
#$home-directory)
,(string-append "LAMINAR_BIND_HTTP="
#$bind-http)
+ ,(string-append "LAMINAR_BIND_RPC="
+ #$bind-rpc)
,(string-append "LAMINAR_TITLE="
#$title)
,(string-append "LAMINAR_KEEP_RUNDIRS="
diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index 85a4c3ec9a..d2daf60497 100644
--- a/gnu/services/dbus.scm
+++ b/gnu/services/dbus.scm
@@ -106,6 +106,10 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in
(define (services->sxml services)
;; Return the SXML 'includedir' clauses for DIRS.
`(busconfig
+ ;; Increase this timeout to 60 seconds to work around race-y
+ ;; failures such as <https://issues.guix.gnu.org/52051> on slow
+ ;; computers with slow I/O.
+ (limit (@ (name "auth_timeout")) "60000")
(servicehelper "/run/setuid-programs/dbus-daemon-launch-helper")
;; First, the '.service' files of services subject to activation.
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index c6761ca784..c2ee3a3d80 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -868,22 +868,34 @@ rules.")
gnome-desktop-configuration?
(gnome gnome-package (default gnome)))
-(define (gnome-polkit-settings config)
- "Return the list of GNOME dependencies that provide polkit actions and
-rules."
+(define (gnome-packages config packages)
+ "Return the list of GNOME dependencies from CONFIG which names are part of
+the given PACKAGES list."
(let ((gnome (gnome-package config)))
(map (lambda (name)
((package-direct-input-selector name) gnome))
- '("gnome-settings-daemon"
- "gnome-control-center"
- "gnome-system-monitor"
- "gvfs"))))
+ packages)))
+
+(define (gnome-udev-rules config)
+ "Return the list of GNOME dependencies that provide udev rules."
+ (gnome-packages config '("gnome-settings-daemon")))
+
+(define (gnome-polkit-settings config)
+ "Return the list of GNOME dependencies that provide polkit actions and
+rules."
+ (gnome-packages config
+ '("gnome-settings-daemon"
+ "gnome-control-center"
+ "gnome-system-monitor"
+ "gvfs")))
(define gnome-desktop-service-type
(service-type
(name 'gnome-desktop)
(extensions
- (list (service-extension polkit-service-type
+ (list (service-extension udev-service-type
+ gnome-udev-rules)
+ (service-extension polkit-service-type
gnome-polkit-settings)
(service-extension profile-service-type
(compose list
diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm
index a5ed28647f..df5fa13bea 100644
--- a/gnu/services/guix.scm
+++ b/gnu/services/guix.scm
@@ -146,7 +146,7 @@
make-guix-build-coordinator-agent-configuration
guix-build-coordinator-agent-configuration?
(package guix-build-coordinator-agent-configuration-package
- (default guix-build-coordinator))
+ (default guix-build-coordinator/agent-only))
(user guix-build-coordinator-agent-configuration-user
(default "guix-build-coordinator-agent"))
(coordinator guix-build-coordinator-agent-configuration-coordinator
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 77841a18d4..5bb8638930 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -427,6 +427,8 @@ daemon is responsible for allocating IP addresses to its client.")))
;; Default set of NTP servers. These URLs are managed by the NTP Pool project.
;; Within Guix, Leo Famulari <leo@famulari.name> is the administrative contact
;; for this NTP pool "zone".
+ ;; The full list of available URLs are 0.guix.pool.ntp.org,
+ ;; 1.guix.pool.ntp.org, 2.guix.pool.ntp.org, and 3.guix.pool.ntp.org.
(list
(ntp-server
(type 'pool)
diff --git a/gnu/services/nfs.scm b/gnu/services/nfs.scm
index 277178c058..0d1617354e 100644
--- a/gnu/services/nfs.scm
+++ b/gnu/services/nfs.scm
@@ -304,7 +304,7 @@
'())
"--foreground"
#$@(if rpcstatd-port
- '("--port" (number->string rpcstatd-port))
+ #~("--port" #$(number->string rpcstatd-port))
'()))
#:pid-file "/var/run/rpc.statd.pid"))
(stop #~(make-kill-destructor)))
@@ -320,7 +320,7 @@
'("--debug" "all")
'())
#$@(if rpcmountd-port
- '("--port" (number->string rpcmountd-port))
+ #~("--port" #$(number->string rpcmountd-port))
'()))))
(stop #~(make-kill-destructor)))
(shepherd-service
diff --git a/gnu/services/pam-mount.scm b/gnu/services/pam-mount.scm
index 98611462c2..33649b0f7c 100644
--- a/gnu/services/pam-mount.scm
+++ b/gnu/services/pam-mount.scm
@@ -90,7 +90,7 @@
(module #~(string-append #$pam-mount "/lib/security/pam_mount.so"))))
(list (lambda (pam)
(if (member (pam-service-name pam)
- '("login" "su" "slim" "gdm-password"))
+ '("login" "su" "slim" "gdm-password" "sddm"))
(pam-service
(inherit pam)
(auth (append (pam-service-auth pam)
diff --git a/gnu/services/rsync.scm b/gnu/services/rsync.scm
index 6e27edde25..d456911563 100644
--- a/gnu/services/rsync.scm
+++ b/gnu/services/rsync.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,11 +26,23 @@
#:use-module (gnu packages admin)
#:use-module (guix records)
#:use-module (guix gexp)
+ #:use-module (guix diagnostics)
+ #:use-module (guix i18n)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
#:export (rsync-configuration
rsync-configuration?
+ rsync-configuration-modules
+
+ rsync-module
+ rsync-module?
+ rsync-module-name
+ rsync-module-file-name
+ rsync-module-comment
+ rsync-module-read-only
+ rsync-module-timeout
+
rsync-service-type))
;;;; Commentary:
@@ -39,6 +52,13 @@
;;;
;;;; Code:
+(define-with-syntax-properties (warn-share-field-deprecation (value properties))
+ (unless (unspecified? value)
+ (warning (source-properties->location properties)
+ (G_ "the 'share-path' and 'share-comment' fields is deprecated, \
+please use 'modules' instead~%")))
+ value)
+
(define-record-type* <rsync-configuration>
rsync-configuration
make-rsync-configuration
@@ -56,15 +76,22 @@
(log-file rsync-configuration-log-file ; string
(default "/var/log/rsyncd.log"))
(use-chroot? rsync-configuration-use-chroot? ; boolean
- (default #t))
+ (sanitize warn-share-field-deprecation)
+ (default *unspecified*))
+ (modules rsync-configuration-actual-modules ;list of <rsync-module>
+ (default %default-modules)) ;TODO: eventually remove default
(share-path rsync-configuration-share-path ; string
- (default "/srv/rsyncd"))
+ (sanitize warn-share-field-deprecation)
+ (default *unspecified*))
(share-comment rsync-configuration-share-comment ; string
- (default "Rsync share"))
+ (sanitize warn-share-field-deprecation)
+ (default *unspecified*))
(read-only? rsync-configuration-read-only? ; boolean
- (default #f))
+ (sanitize warn-share-field-deprecation)
+ (default *unspecified*))
(timeout rsync-configuration-timeout ; integer
- (default 300))
+ (sanitize warn-share-field-deprecation)
+ (default *unspecified*))
(user rsync-configuration-user ; string
(default "root"))
(group rsync-configuration-group ; string
@@ -74,6 +101,45 @@
(gid rsync-configuration-gid ; string
(default "rsyncd")))
+;; Rsync "module": a directory exported the rsync protocol.
+(define-record-type* <rsync-module>
+ rsync-module make-rsync-module
+ rsync-module?
+ (name rsync-module-name) ;string
+ (file-name rsync-module-file-name) ;string
+ (comment rsync-module-comment ;string
+ (default ""))
+ (read-only? rsync-module-read-only? ;boolean
+ (default #t))
+ (chroot? rsync-module-chroot? ;boolean
+ (default #t))
+ (timeout rsync-module-timeout ;integer
+ (default 300)))
+
+(define %default-modules
+ ;; Default modules, provided for backward compatibility.
+ (list (rsync-module (name "files")
+ (file-name "/srv/rsyncd")
+ (comment "Rsync share")
+ (read-only? #f)))) ;yes, that was the default
+
+(define (rsync-configuration-modules config)
+ (match-record config <rsync-configuration>
+ (modules
+ share-path share-comment use-chroot? read-only? timeout) ;deprecated
+ (if (unspecified? share-path)
+ (rsync-configuration-actual-modules config)
+ (list (rsync-module ;backward compatibility
+ (name "files")
+ (file-name share-path)
+ (comment "Rsync share")
+ (chroot?
+ (if (unspecified? use-chroot?) #t use-chroot?))
+ (read-only?
+ (if (unspecified? read-only?) #f read-only?))
+ (timeout
+ (if (unspecified? timeout) 300 timeout)))))))
+
(define (rsync-account config)
"Return the user accounts and user groups for CONFIG."
(let ((rsync-user (if (rsync-configuration-uid config)
@@ -96,55 +162,62 @@
"Return the activation GEXP for CONFIG."
(with-imported-modules '((guix build utils))
#~(begin
- (let ((share-directory #$(rsync-configuration-share-path config))
- (user (getpw (if #$(rsync-configuration-uid config)
+ (let ((user (getpw (if #$(rsync-configuration-uid config)
#$(rsync-configuration-uid config)
#$(rsync-configuration-user config))))
(group (getpw (if #$(rsync-configuration-gid config)
#$(rsync-configuration-gid config)
#$(rsync-configuration-group config)))))
(mkdir-p (dirname #$(rsync-configuration-pid-file config)))
- (and=> share-directory mkdir-p)
- (chown share-directory
- (passwd:uid user)
- (group:gid group))))))
+ (for-each (lambda (directory)
+ (mkdir-p directory)
+ (chown directory (passwd:uid user) (group:gid group)))
+ '#$(map rsync-module-file-name
+ (rsync-configuration-modules config)))))))
-(define rsync-config-file
+(define (rsync-config-file config)
;; Return the rsync configuration file corresponding to CONFIG.
- (match-lambda
- (($ <rsync-configuration> package address port-number pid-file lock-file log-file
- use-chroot? share-path share-comment read-only?
- timeout user group uid gid)
- (if (not (string=? user "root"))
- (cond
- ((<= port-number 1024)
- (error (string-append "rsync-service: to run on port "
- (number->string port-number)
- ", user must be root.")))
- (use-chroot?
- (error (string-append "rsync-service: to run in a chroot"
- ", user must be root.")))
- (uid
- (error "rsync-service: to use uid, user must be root."))
- (gid
- (error "rsync-service: to use gid, user must be root."))))
- (mixed-text-file
- "rsync.conf"
- "# Generated by 'rsync-service'.\n\n"
- "pid file = " pid-file "\n"
- "lock file = " lock-file "\n"
- "log file = " log-file "\n"
- (if address (string-append "address = " address "\n") "")
- "port = " (number->string port-number) "\n"
- "use chroot = " (if use-chroot? "true" "false") "\n"
- (if uid (string-append "uid = " uid "\n") "")
- "gid = " (if gid gid "nogroup") "\n" ; no group nobody
- "\n"
- "[files]\n"
- "path = " share-path "\n"
- "comment = " share-comment "\n"
- "read only = " (if read-only? "true" "false") "\n"
- "timeout = " (number->string timeout) "\n"))))
+ (define (module-config module)
+ (match-record module <rsync-module>
+ (name file-name comment chroot? read-only? timeout)
+ (list "[" name "]\n"
+ " path = " file-name "\n"
+ " use chroot = " (if chroot? "true" "false") "\n"
+ " comment = " comment "\n"
+ " read only = " (if read-only? "true" "false") "\n"
+ " timeout = " (number->string timeout) "\n")))
+
+ (define modules
+ (rsync-configuration-modules config))
+
+ (match-record config <rsync-configuration>
+ (package address port-number pid-file lock-file log-file
+ user group uid gid)
+ (unless (string=? user "root")
+ (cond
+ ((<= port-number 1024)
+ (error (string-append "rsync-service: to run on port "
+ (number->string port-number)
+ ", user must be root.")))
+ ((find rsync-module-chroot? modules)
+ (error (string-append "rsync-service: to run in a chroot"
+ ", user must be root.")))
+ (uid
+ (error "rsync-service: to use uid, user must be root."))
+ (gid
+ (error "rsync-service: to use gid, user must be root."))))
+
+ (apply mixed-text-file "rsync.conf"
+ "# Generated by 'rsync-service'.\n\n"
+ "pid file = " pid-file "\n"
+ "lock file = " lock-file "\n"
+ "log file = " log-file "\n"
+ (if address (string-append "address = " address "\n") "")
+ "port = " (number->string port-number) "\n"
+ (if uid (string-append "uid = " uid "\n") "")
+ "gid = " (if gid gid "nogroup") "\n" ; no group nobody
+ "\n\n"
+ (append-map module-config modules))))
(define (rsync-shepherd-service config)
"Return a <shepherd-service> for rsync with CONFIG."
@@ -172,4 +245,7 @@
(list (service-extension shepherd-root-service-type rsync-shepherd-service)
(service-extension account-service-type rsync-account)
(service-extension activation-service-type rsync-activation)))
- (default-value (rsync-configuration))))
+ (default-value (rsync-configuration))
+ (description
+ "Run the rsync file copying tool in daemon mode. This allows remote hosts
+to keep synchronized copies of the files exported by rsync.")))
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index 7c83f13b2a..e678bae87c 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 nee <nee-git@hidamari.blue>
-;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -227,7 +227,7 @@ SET-ACCOUNT-DETAILS."
(define-configuration/no-serialization jami-configuration
(jamid
- (file-like libring)
+ (file-like libjami)
"The Jami daemon package to use.")
(dbus
(file-like dbus)
@@ -265,7 +265,7 @@ consistent state."))
CONFIG, a <jami-configuration> object."
(match-record config <jami-configuration>
(jamid dbus enable-logging? debug? auto-answer?)
- `(,(file-append jamid "/lib/ring/dring")
+ `(,(file-append jamid "/libexec/jamid")
"--persistent" ;stay alive after client quits
,@(if enable-logging?
'() ;logs go to syslog by default
@@ -739,7 +739,7 @@ argument, either a registered username or the fingerprint of the account.")
(const %jami-accounts))
(service-extension activation-service-type
jami-dbus-session-activation)))
- (description "Run the Jami daemon (@command{dring}). This service is
+ (description "Run the Jami daemon (@command{jamid}). This service is
geared toward the use case of hosting Jami rendezvous points over a headless
server. If you use Jami on your local machine, you may prefer to setup a user
Shepherd service for it instead; this way, the daemon will be shared via your
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index 6004e41d8d..3e370ba4be 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 jgart <jgart@dismail.de>
+;;; Copyright © 2021 Nathan Dehnel <ncdehnel@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -67,6 +68,7 @@
wireguard-configuration-interface
wireguard-configuration-addresses
wireguard-configuration-port
+ wireguard-configuration-dns
wireguard-configuration-private-key
wireguard-configuration-peers
@@ -715,7 +717,9 @@ strongSwan.")))
(private-key wireguard-configuration-private-key ;string
(default "/etc/wireguard/private.key"))
(peers wireguard-configuration-peers ;list of <wiregard-peer>
- (default '())))
+ (default '()))
+ (dns wireguard-configuration-dns ;list of strings
+ (default #f)))
(define (wireguard-configuration-file config)
(define (peer->config peer)
@@ -739,7 +743,7 @@ AllowedIPs = ~a
"\n"))))
(match-record config <wireguard-configuration>
- (wireguard interface addresses port private-key peers)
+ (wireguard interface addresses port private-key peers dns)
(let* ((config-file (string-append interface ".conf"))
(peers (map peer->config peers))
(config
@@ -755,6 +759,7 @@ AllowedIPs = ~a
Address = ~a
PostUp = ~a set %i private-key ~a
~a
+~a
~{~a~^~%~}"
#$(string-join addresses ",")
#$(file-append wireguard "/bin/wg")
@@ -762,6 +767,10 @@ PostUp = ~a set %i private-key ~a
#$(if port
(format #f "ListenPort = ~a" port)
"")
+ #$(if dns
+ (format #f "DNS = ~a"
+ (string-join dns ","))
+ "")
(list #$@peers)))))))))
(file-append config "/" config-file))))
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 82a7d25602..a5e1a1471d 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -11,6 +11,7 @@
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2021 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2021 Josselin Poiret <josselin.poiret@protonmail.ch>
+;;; Copyright © 2022 Chris Marusich <cmmarusich@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -28,6 +29,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu services xorg)
+ #:autoload (gnu services sddm) (sddm-service-type)
#:use-module (gnu artwork)
#:use-module (gnu services)
#:use-module (gnu services shepherd)
@@ -57,6 +59,7 @@
#:use-module (guix derivations)
#:use-module (guix records)
#:use-module (guix deprecation)
+ #:use-module (guix utils)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-26)
@@ -1040,10 +1043,15 @@ the GNOME desktop environment.")
"Run the GNOME Desktop Manager (GDM), a program that allows
you to log in in a graphical session, whether or not you use GNOME."))))
+;; Since GDM depends on Rust (gdm -> gnome-shell -> gjs -> mozjs -> rust)
+;; and Rust is currently unavailable on non-x86_64 platforms, default to
+;; SDDM there (FIXME).
(define* (set-xorg-configuration config
#:optional
(login-manager-service-type
- gdm-service-type))
+ (if (target-x86-64?)
+ gdm-service-type
+ sddm-service-type)))
"Tell the log-in manager (of type @var{login-manager-service-type}) to use
@var{config}, an <xorg-configuration> record."
(simple-service 'set-xorg-configuration