[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/09: system: Add procedures to access user accounts and service names.
From: |
Ludovic Courtès |
Subject: |
07/09: system: Add procedures to access user accounts and service names. |
Date: |
Wed, 04 May 2016 21:37:21 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit b2fef041fcfbb63d7901c25647373aeda56b026e
Author: Ludovic Courtès <address@hidden>
Date: Wed May 4 22:48:28 2016 +0200
system: Add procedures to access user accounts and service names.
* gnu/system.scm (operating-system-user-accounts)
(operating-system-shepherd-service-names): New procedures.
---
gnu/system.scm | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gnu/system.scm b/gnu/system.scm
index 768ca9c..96ea153 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -82,6 +82,8 @@
operating-system-file-systems
operating-system-store-file-system
operating-system-activation-script
+ operating-system-user-accounts
+ operating-system-shepherd-service-names
operating-system-derivation
operating-system-profile
@@ -578,6 +580,22 @@ hardware-related operations as necessary when booting a
Linux container."
;; BOOT is the script as a monadic value.
(service-parameters boot)))
+(define (operating-system-user-accounts os)
+ "Return the list of user accounts of OS."
+ (let* ((services (operating-system-services os))
+ (account (fold-services services
+ #:target-type account-service-type)))
+ (filter user-account?
+ (service-parameters account))))
+
+(define (operating-system-shepherd-service-names os)
+ "Return the list of Shepherd service names for OS."
+ (append-map shepherd-service-provision
+ (service-parameters
+ (fold-services (operating-system-services os)
+ #:target-type
+ shepherd-root-service-type))))
+
(define* (operating-system-derivation os #:key container?)
"Return a derivation that builds OS."
(let* ((services (operating-system-services os #:container? container?))
- branch master updated (af5640d -> e9f693d), Ludovic Courtès, 2016/05/04
- 06/09: gnu: java-qdox: Escape "@" in description., Ludovic Courtès, 2016/05/04
- 02/09: environment: Use 'break' instead of 'split'., Ludovic Courtès, 2016/05/04
- 03/09: utils: Remove 'split'., Ludovic Courtès, 2016/05/04
- 05/09: build: Preserve stderr for shell tests., Ludovic Courtès, 2016/05/04
- 01/09: services: herd: Move UI handling to 'guix system'., Ludovic Courtès, 2016/05/04
- 07/09: system: Add procedures to access user accounts and service names.,
Ludovic Courtès <=
- 08/09: Add (gnu tests) and (gnu build marionette)., Ludovic Courtès, 2016/05/04
- 09/09: tests: Add whole-system test., Ludovic Courtès, 2016/05/04
- 04/09: utils: Move combinators to (guix combinators)., Ludovic Courtès, 2016/05/04