From adbb08fd05a91580fdeb92eeb9bf356b53464243 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Mon, 22 Jan 2024 20:50:24 +0100 Subject: system: Allow adding elsewhere-defined system users to extra groups. * gnu/system.scm (define-module): Export `operating-system-extra-groups`. ()[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`. (): 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 records, move field intializer upward to be able to use `compose`. Change-Id: I3f489ac794d342267b7627db1d28315ea4b69db2 --- gnu/system.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index 44f93f91d1..fb41a2f2f4 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -112,6 +112,7 @@ operating-system-initrd operating-system-users operating-system-groups + operating-system-extra-groups operating-system-issue operating-system-timezone operating-system-locale @@ -273,6 +274,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))) @@ -810,7 +813,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 @@ -851,7 +855,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 '()) -- cgit v1.2.3