diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-05-04 22:48:28 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2016-05-04 23:35:55 +0200 |
| commit | b2fef041fcfbb63d7901c25647373aeda56b026e (patch) | |
| tree | 1487f5a848cfc0fa039e21be8d7a0f926b075cb2 /gnu | |
| parent | b13cf17fcfb62e82efd7477c0da7a56b11ff4288 (diff) | |
system: Add procedures to access user accounts and service names.
* gnu/system.scm (operating-system-user-accounts)
(operating-system-shepherd-service-names): New procedures.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/system.scm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gnu/system.scm b/gnu/system.scm index 768ca9cab21..96ea153cd06 100644 --- a/gnu/system.scm +++ b/gnu/system.scm | |||
| @@ -82,6 +82,8 @@ | |||
| 82 | operating-system-file-systems | 82 | operating-system-file-systems |
| 83 | operating-system-store-file-system | 83 | operating-system-store-file-system |
| 84 | operating-system-activation-script | 84 | operating-system-activation-script |
| 85 | operating-system-user-accounts | ||
| 86 | operating-system-shepherd-service-names | ||
| 85 | 87 | ||
| 86 | operating-system-derivation | 88 | operating-system-derivation |
| 87 | operating-system-profile | 89 | operating-system-profile |
| @@ -578,6 +580,22 @@ hardware-related operations as necessary when booting a Linux container." | |||
| 578 | ;; BOOT is the script as a monadic value. | 580 | ;; BOOT is the script as a monadic value. |
| 579 | (service-parameters boot))) | 581 | (service-parameters boot))) |
| 580 | 582 | ||
| 583 | (define (operating-system-user-accounts os) | ||
| 584 | "Return the list of user accounts of OS." | ||
| 585 | (let* ((services (operating-system-services os)) | ||
| 586 | (account (fold-services services | ||
| 587 | #:target-type account-service-type))) | ||
| 588 | (filter user-account? | ||
| 589 | (service-parameters account)))) | ||
| 590 | |||
| 591 | (define (operating-system-shepherd-service-names os) | ||
| 592 | "Return the list of Shepherd service names for OS." | ||
| 593 | (append-map shepherd-service-provision | ||
| 594 | (service-parameters | ||
| 595 | (fold-services (operating-system-services os) | ||
| 596 | #:target-type | ||
| 597 | shepherd-root-service-type)))) | ||
| 598 | |||
| 581 | (define* (operating-system-derivation os #:key container?) | 599 | (define* (operating-system-derivation os #:key container?) |
| 582 | "Return a derivation that builds OS." | 600 | "Return a derivation that builds OS." |
| 583 | (let* ((services (operating-system-services os #:container? container?)) | 601 | (let* ((services (operating-system-services os #:container? container?)) |
