aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-10-21 00:33:43 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-10-21 00:33:43 +0200
commit023522d3a1e81fe9bc803183337fdc8c183a88c4 (patch)
treeec374744812891a627f33fa457b0bcf083e2c142 /gnu/services
parent07abc851ce8a580253061e065b31a4037d2f965d (diff)
parent7373eb8304e0ebbfabe66deb59e78187013403dd (diff)
downloadguix-023522d3a1e81fe9bc803183337fdc8c183a88c4.tar
guix-023522d3a1e81fe9bc803183337fdc8c183a88c4.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/desktop.scm15
-rw-r--r--gnu/services/herd.scm7
-rw-r--r--gnu/services/networking.scm33
3 files changed, 49 insertions, 6 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index a32756e040..5a7f8be4bb 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
+;;; Copyright © 2019 David Wilson <david@daviwil.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -907,15 +908,21 @@ and extends polkit with the actions from @code{mate-settings-daemon}."
xfce-desktop-configuration
(xfce xfce-package (default xfce)))
+(define (xfce-polkit-settings config)
+ "Return the list of XFCE dependencies that provide polkit actions and
+rules."
+ (let ((xfce (xfce-package config)))
+ (map (lambda (name)
+ ((package-direct-input-selector name) xfce))
+ '("thunar"
+ "xfce4-power-manager"))))
+
(define xfce-desktop-service-type
(service-type
(name 'xfce-desktop)
(extensions
(list (service-extension polkit-service-type
- (compose list
- (package-direct-input-selector
- "thunar")
- xfce-package))
+ xfce-polkit-settings)
(service-extension profile-service-type
(compose list xfce-package))))
(default-value (xfce-desktop-configuration))
diff --git a/gnu/services/herd.scm b/gnu/services/herd.scm
index 2207b2d34b..112a7dc104 100644
--- a/gnu/services/herd.scm
+++ b/gnu/services/herd.scm
@@ -25,6 +25,7 @@
#:use-module (srfi srfi-35)
#:use-module (ice-9 match)
#:export (%shepherd-socket-file
+ shepherd-message-port
shepherd-error?
service-not-found-error?
@@ -140,8 +141,12 @@ does not denote an error."
(#f ;not an error
#t)))
+(define shepherd-message-port
+ ;; Port where messages coming from shepherd are printed.
+ (make-parameter (current-error-port)))
+
(define (display-message message)
- (format (current-error-port) "shepherd: ~a~%" message))
+ (format (shepherd-message-port) "shepherd: ~a~%" message))
(define* (invoke-action service action arguments cont)
"Invoke ACTION on SERVICE with ARGUMENTS. On success, call CONT with the
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index dd63009116..93d9b6a15e 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -51,6 +51,7 @@
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (guix modules)
+ #:use-module (guix packages)
#:use-module (guix deprecation)
#:use-module (rnrs enums)
#:use-module (srfi srfi-1)
@@ -110,6 +111,7 @@
network-manager-configuration
network-manager-configuration?
network-manager-configuration-dns
+ network-manager-configuration-vpn-plugins
network-manager-service-type
connman-configuration
@@ -986,7 +988,7 @@ and @command{wicd-curses} user interfaces."
(default network-manager))
(dns network-manager-configuration-dns
(default "default"))
- (vpn-plugins network-manager-vpn-plugins ;list of <package>
+ (vpn-plugins network-manager-configuration-vpn-plugins ;list of <package>
(default '())))
(define network-manager-activation
@@ -1005,6 +1007,33 @@ and @command{wicd-curses} user interfaces."
"Return a directory containing PLUGINS, the NM VPN plugins."
(directory-union "network-manager-vpn-plugins" plugins))
+(define (network-manager-accounts config)
+ "Return the list of <user-account> and <user-group> for CONFIG."
+ (define nologin
+ (file-append shadow "/sbin/nologin"))
+
+ (define accounts
+ (append-map (lambda (package)
+ (map (lambda (name)
+ (user-account (system? #t)
+ (name name)
+ (group "network-manager")
+ (comment "NetworkManager helper")
+ (home-directory "/var/empty")
+ (create-home-directory? #f)
+ (shell nologin)))
+ (or (assoc-ref (package-properties package)
+ 'user-accounts)
+ '())))
+ (network-manager-configuration-vpn-plugins config)))
+
+ (match accounts
+ (()
+ '())
+ (_
+ (cons (user-group (name "network-manager") (system? #t))
+ accounts))))
+
(define network-manager-environment
(match-lambda
(($ <network-manager-configuration> network-manager dns vpn-plugins)
@@ -1054,6 +1083,8 @@ and @command{wicd-curses} user interfaces."
(compose
list
network-manager-configuration-network-manager))
+ (service-extension account-service-type
+ network-manager-accounts)
(service-extension activation-service-type
network-manager-activation)
(service-extension session-environment-service-type