[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/36: DRAFT services: Add hurd-console-service-type.
From: |
guix-commits |
Subject: |
02/36: DRAFT services: Add hurd-console-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 ced003b44631d12ecb8210af12ecb5926edc4211
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Mon Apr 13 10:13:05 2020 +0200
DRAFT services: Add hurd-console-service-type.
XXX: drop hurd-service->shepherd-service
TODO: Document this new service in the manual.
* gnu/services/hurd.scm (<hurd-console-configuration>): New variable.
(hurd-console-shepherd-service, hurd-console-service-type): New function.
(hurd-service->shepherd-service): Add entry.
---
gnu/services/hurd.scm | 42 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/gnu/services/hurd.scm b/gnu/services/hurd.scm
index 15eff3b..be4bab0 100644
--- a/gnu/services/hurd.scm
+++ b/gnu/services/hurd.scm
@@ -26,7 +26,8 @@
#:use-module (guix records)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
- #:export (hurd-service->shepherd-service))
+ #:export (hurd-console-service-type
+ hurd-service->shepherd-service))
;;; Commentary:
;;;
@@ -38,9 +39,48 @@
(define (hurd-service->shepherd-service service)
(let ((config (service-value service)))
(match config
+ (($ <hurd-console-configuration>) (hurd-console-shepherd-service config))
(_ '()))))
(define (first-of-two first second)
first)
+
+;;;
+;;; Simple wrapper for <hurd>/bin/console.
+;;;
+
+(define-record-type* <hurd-console-configuration>
+ hurd-console-configuration make-hurd-console-configuration
+ hurd-console-configuration?
+ (hurd hurd-console-configuration-hurd ;package
+ (default hurd)))
+
+(define (hurd-console-shepherd-service config)
+ "Return a <shepherd-service> for a Hurd VGA console with CONFIG."
+
+ (define console-command
+ #~(list
+ (string-append #$(hurd-console-configuration-hurd config)
"/bin/console")
+ "-c" "/dev/vcs"
+ "-d" "vga"
+ "-d" "pc_kbd"
+ "-d" "generic_speaker"))
+
+ (list (shepherd-service
+ (documentation "Run the Hurd’s VGA console client.")
+ (provision '(console))
+ (requirement '())
+ (start #~(make-forkexec-constructor #$console-command))
+ (stop #~(make-kill-destructor)))))
+
+(define hurd-console-service-type
+ (service-type
+ (name 'console)
+ (description "Run the Hurd console client.")
+ (extensions
+ (list (service-extension shepherd-root-service-type
+ hurd-console-shepherd-service)))
+ (default-value (hurd-console-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 <=
- 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, 2020/05/01
- 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