aboutsummaryrefslogtreecommitdiff
path: root/gnu/system.scm
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2024-01-22 20:50:24 +0100
committerW. Kosior <koszko@koszko.org>2024-05-03 14:46:53 +0200
commit8018438b714e7dbc2504d1e00aa4e295649b4001 (patch)
tree94b10a19c455a2f43b2ac3fe5e60577948e6bd2a /gnu/system.scm
parent22c3292865eea276546f46dee8c9bb2e07f30980 (diff)
downloadguix-8018438b714e7dbc2504d1e00aa4e295649b4001.tar.gz
guix-8018438b714e7dbc2504d1e00aa4e295649b4001.zip
system: Allow adding elsewhere-defined system users to extra groups.
* gnu/system.scm (define-module): Export `operating-system-extra-groups`. (<operating-system>)[extra-groups]: New field. (operating-system-default-essential-services): Also pass extra groups to account-service. (hurd-default-essential-services): Same here. * gnu/system/accounts.scm (define-module): Use (ice-9 vlist), (srfi srfi-8) and (srfi srfi-26). Export `user-extra-groups`* and `merge-extra-groups-data`. (<user-extra-groups>): New record type. (user-account-extend): New procedure. (merge-extra-groups-data): New procedure. * gnu/system/shadow.scm (define-module): Re-export `user-extra-groups`*. (account-service-type)[extend]: Handle <user-extra-groups> records, move field intializer upward to be able to use `compose`. Change-Id: I3f489ac794d342267b7627db1d28315ea4b69db2
Diffstat (limited to 'gnu/system.scm')
-rw-r--r--gnu/system.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index cb6e719ca6..5334fffc17 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -111,6 +111,7 @@
operating-system-initrd
operating-system-users
operating-system-groups
+ operating-system-extra-groups
operating-system-issue
operating-system-timezone
operating-system-locale
@@ -270,6 +271,8 @@ VERSION is the target version of the boot-parameters record."
(default %base-user-accounts))
(groups operating-system-groups ; list of user groups
(default %base-groups))
+ (extra-groups operating-system-extra-groups ; list of extra membership
+ (default '()))
(skeletons operating-system-skeletons ; list of name/file-like value
(default (default-skeletons)))
@@ -799,7 +802,8 @@ bookkeeping."
(pam-root-service (operating-system-pam-services os))
(account-service (append (operating-system-accounts os)
- (operating-system-groups os))
+ (operating-system-groups os)
+ (operating-system-extra-groups os))
(operating-system-skeletons os))
(operating-system-etc-service os)
;; XXX: hosts-file is deprecated
@@ -839,7 +843,8 @@ bookkeeping."
(service user-processes-service-type)
(account-service (append (operating-system-accounts os)
- (operating-system-groups os))
+ (operating-system-groups os)
+ (operating-system-extra-groups os))
(operating-system-skeletons os))
(root-file-system-service)
(service file-system-service-type '())