diff options
| author | Yelninei <yelninei@tutamail.com> | 2026-08-13 17:44:47 +0000 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2026-08-26 16:03:45 +0900 |
| commit | 3ee8ffb3ddf6b0ba17cdd5ad2be3510cc525dbc9 (patch) | |
| tree | 25394c3b008cfea16fe9a5d20c73074e78184549 /gnu/services | |
| parent | 5687b11d5f99c464919409696654762ef2f74558 (diff) | |
services: Add hurd-login-service-type.
* gnu/services/hurd.scm (<hurd-login-accounts>): New record.
(hurd-login-accounts): New procedure.
(hurd-login-service-type): Add accounts-service-type extension.
Merges: https://codeberg.org/guix/guix/pulls/10548
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
Diffstat (limited to 'gnu/services')
| -rw-r--r-- | gnu/services/hurd.scm | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gnu/services/hurd.scm b/gnu/services/hurd.scm index 5cf37adeaf5..1ee38e8cd01 100644 --- a/gnu/services/hurd.scm +++ b/gnu/services/hurd.scm | |||
| @@ -22,12 +22,16 @@ | |||
| 22 | #:use-module (gnu services) | 22 | #:use-module (gnu services) |
| 23 | #:use-module (gnu services shepherd) | 23 | #:use-module (gnu services shepherd) |
| 24 | #:use-module (gnu system) | 24 | #:use-module (gnu system) |
| 25 | #:use-module (gnu system shadow) | ||
| 25 | #:use-module (guix gexp) | 26 | #:use-module (guix gexp) |
| 26 | #:use-module (guix records) | 27 | #:use-module (guix records) |
| 27 | #:export (hurd-console-configuration | 28 | #:export (hurd-console-configuration |
| 28 | hurd-console-service-type | 29 | hurd-console-service-type |
| 29 | hurd-getty-configuration | 30 | hurd-getty-configuration |
| 30 | hurd-getty-service-type)) | 31 | hurd-getty-service-type |
| 32 | |||
| 33 | hurd-login-configuration | ||
| 34 | hurd-login-service-type)) | ||
| 31 | 35 | ||
| 32 | ;;; Commentary: | 36 | ;;; Commentary: |
| 33 | ;;; | 37 | ;;; |
| @@ -115,4 +119,36 @@ | |||
| 115 | (description | 119 | (description |
| 116 | "Provide console login using the Hurd @command{getty} program."))) | 120 | "Provide console login using the Hurd @command{getty} program."))) |
| 117 | 121 | ||
| 122 | ;;; | ||
| 123 | ;;; Hurd login service | ||
| 124 | ;;; | ||
| 125 | |||
| 126 | (define-record-type* <hurd-login-configuration> | ||
| 127 | hurd-login-configuration make-hurd-login-configuration | ||
| 128 | hurd-login-configuration? | ||
| 129 | (hurd hurd-login-configuration-hurd ;file-like | ||
| 130 | (default hurd))) | ||
| 131 | |||
| 132 | (define (hurd-login-accounts config) | ||
| 133 | (let ((hurd (hurd-login-configuration-hurd config))) | ||
| 134 | (list (user-group | ||
| 135 | (name "login") | ||
| 136 | (system? #t)) | ||
| 137 | (user-account | ||
| 138 | (name "login") | ||
| 139 | (group "login") | ||
| 140 | (system? #t) | ||
| 141 | (comment "login user") | ||
| 142 | (home-directory "/etc/login") | ||
| 143 | (shell (file-append hurd "/bin/loginpr")))))) | ||
| 144 | |||
| 145 | (define hurd-login-service-type | ||
| 146 | (service-type | ||
| 147 | (name 'login) | ||
| 148 | (extensions (list (service-extension account-service-type | ||
| 149 | hurd-login-accounts))) | ||
| 150 | (description | ||
| 151 | "Provide the login user for use by the Hurd @command{login} command.") | ||
| 152 | (default-value (hurd-login-configuration)))) | ||
| 153 | |||
| 118 | ;;; hurd.scm ends here | 154 | ;;; hurd.scm ends here |
