diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2017-12-31 14:10:25 +0200 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2017-12-31 14:10:25 +0200 |
commit | 23de2e1d5f8f7548e6f73085de23d9964774edbf (patch) | |
tree | fab69d4bb55f275f14012a724b7cb14bd307b57f /gnu/services/networking.scm | |
parent | ec6ba5c1fe9308cbc18f06c99adcfe0d13396a18 (diff) | |
parent | 1c27f72fc2770d68243dd95b7c05adc3b2b02ea4 (diff) | |
download | guix-patches-23de2e1d5f8f7548e6f73085de23d9964774edbf.tar guix-patches-23de2e1d5f8f7548e6f73085de23d9964774edbf.tar.gz |
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'gnu/services/networking.scm')
-rw-r--r-- | gnu/services/networking.scm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index b0c23aafc7..c3ba0787c0 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2016 John Darrington <jmd@gnu.org> ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be> +;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -51,6 +52,7 @@ static-networking-ip static-networking-netmask static-networking-gateway + static-networking-requirement static-networking-service static-networking-service-type @@ -145,22 +147,21 @@ fe80::1%lo0 apps.facebook.com\n") (default #f)) (provision static-networking-provision (default #f)) + (requirement static-networking-requirement + (default '())) (name-servers static-networking-name-servers ;FIXME: doesn't belong here (default '()))) (define static-networking-shepherd-service (match-lambda (($ <static-networking> interface ip netmask gateway provision - name-servers) + requirement name-servers) (let ((loopback? (and provision (memq 'loopback provision)))) (shepherd-service - ;; Unless we're providing the loopback interface, wait for udev to be up - ;; and running so that INTERFACE is actually usable. - (requirement (if loopback? '() '(udev))) - (documentation "Bring up the networking interface using a static IP address.") + (requirement requirement) (provision (or provision (list (symbol-append 'networking- (string->symbol interface))))) @@ -263,6 +264,8 @@ network interface."))) (define* (static-networking-service interface ip #:key netmask gateway provision + ;; Most interfaces require udev to be usable. + (requirement '(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, @@ -277,6 +280,7 @@ to handle." (list (static-networking (interface interface) (ip ip) (netmask netmask) (gateway gateway) (provision provision) + (requirement requirement) (name-servers name-servers))))) (define dhcp-client-service-type |