[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/36: DRAFT services: Add hurd-ttys-service-type.
From: |
guix-commits |
Subject: |
03/36: DRAFT services: Add hurd-ttys-service-type. |
Date: |
Fri, 1 May 2020 11:53:55 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 7f2212b42033bad6a930c126e812a3b373ff4838
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Mon Apr 13 10:36:56 2020 +0200
DRAFT services: Add hurd-ttys-service-type.
XXX remove hurd-service->shepherd-service
TODO: Add entry in the manual.
* gnu/services/hurd.scm (<hurd-ttys-configuration>): New variable.
(hurd-ttys-shepherd-service, hurd-ttys-service-type): New function.
(hurd-service->shepherd-service): Add entry.
---
gnu/services/hurd.scm | 43 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/gnu/services/hurd.scm b/gnu/services/hurd.scm
index be4bab0..4f32cce 100644
--- a/gnu/services/hurd.scm
+++ b/gnu/services/hurd.scm
@@ -26,8 +26,11 @@
#:use-module (guix records)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
- #:export (hurd-console-service-type
- hurd-service->shepherd-service))
+ #:export (hurd-console-configuration
+ hurd-console-service-type
+ hurd-service->shepherd-service
+ hurd-ttys-configuration
+ hurd-ttys-service-type))
;;; Commentary:
;;;
@@ -40,6 +43,7 @@
(let ((config (service-value service)))
(match config
(($ <hurd-console-configuration>) (hurd-console-shepherd-service config))
+ (($ <hurd-ttys-configuration>) (hurd-ttys-shepherd-service config))
(_ '()))))
(define (first-of-two first second)
@@ -83,4 +87,39 @@
hurd-console-shepherd-service)))
(default-value (hurd-console-configuration))))
+
+;;;
+;;; Simple wrapper for <hurd>/libexec/runttys.
+;;;
+
+(define-record-type* <hurd-ttys-configuration>
+ hurd-ttys-configuration make-hurd-ttys-configuration
+ hurd-ttys-configuration?
+ (hurd hurd-ttys-configuration-hurd ;package
+ (default hurd)))
+
+(define (hurd-ttys-shepherd-service config)
+ "Return a <shepherd-service> for the Hurd ttys with CONFIG."
+
+ (define runttys-command
+ #~(list
+ (string-append #$(hurd-ttys-configuration-hurd config)
"/libexec/runttys")))
+
+ (list (shepherd-service
+ (documentation "Run the Hurd's runttys daemon.")
+ (provision '(ttys))
+ (requirement '(console))
+ (start #~(make-forkexec-constructor #$runttys-command))
+ (stop #~(make-kill-destructor)))))
+
+(define hurd-ttys-service-type
+ (service-type
+ (name 'tty)
+ (description
+ "Run the Hurd runttys daemon.")
+ (extensions
+ (list (service-extension shepherd-root-service-type
+ hurd-ttys-shepherd-service)))
+ (default-value (hurd-ttys-configuration))))
+
;;; hurd.scm ends here
- branch wip-hurd-vm created (now 3c8947d), guix-commits, 2020/05/01
- 02/36: DRAFT services: Add hurd-console-service-type., guix-commits, 2020/05/01
- 04/36: HACK services: Add user-processes-service as a Hurd service., guix-commits, 2020/05/01
- 03/36: DRAFT services: Add hurd-ttys-service-type.,
guix-commits <=
- 09/36: Revert "squash! Use static-networking for loopback", guix-commits, 2020/05/01
- 10/36: HACK services: Add openssh-service as a Hurd service., guix-commits, 2020/05/01
- 12/36: system: gnu: Populate "/etc" from "/boot/activation"., guix-commits, 2020/05/01
- 14/36: DRAFT: hurd: use static-networking instead of dummy loopback hack., guix-commits, 2020/05/01
- 01/36: services: Add hurd., guix-commits, 2020/05/01
- 13/36: system: hurd: Add openssh service., guix-commits, 2020/05/01
- 15/36: Revert "DRAFT: hurd: use static-networking instead of dummy loopback hack.", guix-commits, 2020/05/01
- 05/36: HACK services: Add guix-daemon-service as a Hurd service., guix-commits, 2020/05/01
- 07/36: HACK services: hurd: Add dummy loopback., guix-commits, 2020/05/01
- 16/36: system: hurd: Create system profile for guix development., guix-commits, 2020/05/01