guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/04: DRAFT gnu: services: Add %base-services/hurd for the Hurd.


From: guix-commits
Subject: 02/04: DRAFT gnu: services: Add %base-services/hurd for the Hurd.
Date: Sun, 29 Mar 2020 13:54:20 -0400 (EDT)

janneke pushed a commit to branch wip-hurd
in repository guix.

commit 9548e1de1d7f4229076c0ec8c7f95bfc2b6b3b80
Author: Jan Nieuwenhuizen <address@hidden>
AuthorDate: Fri Mar 6 13:33:38 2020 -0500

    DRAFT gnu: services: Add %base-services/hurd for the Hurd.
    
    * gnu/services/base.scm (%base-services/hurd): New exported variable.
    (file-system-shepherd-service): Remove udev dependency on the Hurd.
    (static-networking-service): Likewise.
---
 gnu/services/base.scm       | 28 ++++++++++++++++++++++++----
 gnu/services/networking.scm |  3 ++-
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 194dd3b..99b272c 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2019 Efraim Flashner <address@hidden>
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <address@hidden>
 ;;; Copyright © 2019 John Soo <address@hidden>
-;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <address@hidden>
+;;; Copyright © 2019, 2020 Jan (janneke) Nieuwenhuizen <address@hidden>
 ;;; Copyright © 2020 Florian Pelz <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -49,6 +49,7 @@
                 #:select (coreutils glibc glibc-utf8-locales))
   #:use-module (gnu packages package-management)
   #:use-module ((gnu packages gnupg) #:select (guile-gcrypt))
+  #:use-module (gnu packages hurd)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages terminals)
   #:use-module ((gnu build file-systems)
@@ -175,7 +176,8 @@
             pam-limits-service-type
             pam-limits-service
 
-            %base-services))
+            %base-services
+            %base-services/hurd))
 
 ;;; Commentary:
 ;;;
@@ -430,7 +432,8 @@ FILE-SYSTEM."
                                  '((gnu build file-systems)))
            (shepherd-service
             (provision (list (file-system->shepherd-service-name file-system)))
-            (requirement `(root-file-system udev
+            (requirement `(root-file-system
+                           ,@(if (hurd-target?) '() '(udev))
                            ,@(map dependency->shepherd-service-name 
dependencies)))
             (documentation "Check, mount, and unmount the given file system.")
             (start #~(lambda args
@@ -2387,7 +2390,7 @@ network interface.")))
                                     #:key
                                     netmask gateway provision
                                     ;; Most interfaces require udev to be 
usable.
-                                    (requirement '(udev))
+                                    (requirement (if (hurd-target?) '() 
'(udev)))
                                     (name-servers '()))
   "Return a service that starts @var{interface} with address @var{ip}.  If
 @var{netmask} is true, use it as the network mask.  If @var{gateway} is true,
@@ -2455,4 +2458,21 @@ to handle."
                  `(("/bin/sh" ,(file-append bash "/bin/sh"))
                    ("/usr/bin/env" ,(file-append coreutils "/bin/env"))))))
 
+(define %base-services/hurd
+  ;; Convenience variable holding the basic services.
+  (list (service login-service-type)
+
+        (service static-networking-service-type
+                 (list (static-networking (interface "lo")
+                                          (ip "127.0.0.1")
+                                          (requirement '())
+                                          (provision '(loopback)))))
+        (syslog-service)
+        (service guix-service-type)
+        (service nscd-service-type)
+
+        (service special-files-service-type
+                 `(("/bin/sh" ,(file-append bash "/bin/sh"))
+                   ("/usr/bin/env" ,(file-append coreutils "/bin/env"))))))
+
 ;;; base.scm ends here
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 618dd95..fa069c2 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -41,6 +41,7 @@
   #:use-module (gnu packages bash)
   #:use-module (gnu packages connman)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages hurd)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages tor)
   #:use-module (gnu packages usb-modeswitch)
@@ -218,7 +219,7 @@ fe80::1%lo0 apps.facebook.com\n")
 
      (shepherd-service
       (documentation "Set up networking via DHCP.")
-      (requirement '(user-processes udev))
+      (requirement `(user-processes ,@(if (hurd-target?) '() '(udev))))
 
       ;; XXX: Running with '-nw' ("no wait") avoids blocking for a minute when
       ;; networking is unavailable, but also means that the interface is not up



reply via email to

[Prev in Thread] Current Thread [Next in Thread]