From f063f0efebe484a0f4cb1aed6e49053860fdd822 Mon Sep 17 00:00:00 2001 From: Björn Höfling Date: Fri, 14 Jun 2019 17:00:50 +0200 Subject: doc: Fix typo. * doc/guix.texi: Switch URI and description in @uref for hpcguix-web. --- doc/guix.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 9dc1d2a9ca..052be47bdb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19833,7 +19833,7 @@ A simple setup for cat-avatar-generator can look like this: @subsubheading Hpcguix-web @cindex hpcguix-web -The @uref{hpcguix-web, https://github.com/UMCUGenetics/hpcguix-web/} +The @uref{https://github.com/UMCUGenetics/hpcguix-web/, hpcguix-web} program is a customizable web interface to browse Guix packages, initially designed for users of high-performance computing (HPC) clusters. -- cgit v1.2.3 From f5be51040c5535f9aefefb6c6a582279b5c44e16 Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Thu, 13 Jun 2019 19:17:05 +0200 Subject: services: Add usb-modeswitch-service-type. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/networking.scm (usb-modeswitch-service-type): New variable. (usb-modeswitch-configuration): New variable. (usb-modeswitch-sh): New procedure. (usb-modeswitch-configuration->udev-rules): New procedure. * doc/guix.texi (Networking Services): Document it. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 35 +++++++++++++++ gnu/services/networking.scm | 104 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 052be47bdb..bd535f82db 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12668,6 +12668,41 @@ The ModemManager package to use. @end table @end deftp +@cindex USB_ModeSwitch +@cindex Modeswitching + +@defvr {Scheme Variable} usb-modeswitch-service-type +This is the service type for the +@uref{http://www.draisberghof.de/usb_modeswitch/, USB_ModeSwitch} service. The +value for this service type is a @code{usb-modeswitch-configuration} record. + +When plugged in, some USB modems (and other USB devices) initially present +themselves as a read-only storage medium and not as a modem. They need to be +@dfn{modeswitched} before they are usable. The USB_ModeSwitch service type +installs udev rules to automatically modeswitch these devices when they are +plugged in. +@end defvr + +@deftp {Data Type} usb-modeswitch-configuration +Data type representing the configuration of USB_ModeSwitch. + +@table @asis +@item @code{usb-modeswitch} (default: @code{usb-modeswitch}) +The USB_ModeSwitch package providing the binaries for modeswitching. + +@item @code{usb-modeswitch-data} (default: @code{usb-modeswitch-data}) +The package providing the device data and udev rules file used by +USB_ModeSwitch. + +@item @code{config-file} (default: @code{#~(string-append #$usb-modeswitch:dispatcher "/etc/usb_modeswitch.conf")}) +Which config file to use for the USB_ModeSwitch dispatcher. By default the +config file shipped with USB_ModeSwitch is used which disables logging to +@file{/var/log} among other default settings. If set to @code{#f}, no config +file is used. + +@end table +@end deftp + @cindex NetworkManager @defvr {Scheme Variable} network-manager-service-type diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 082a85f63d..73acb3b17f 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018 Chris Marusich ;;; Copyright © 2018 Arun Isaac +;;; Copyright © 2019 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,10 +34,13 @@ #:use-module (gnu system shadow) #:use-module (gnu system pam) #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages connman) #:use-module (gnu packages freedesktop) #:use-module (gnu packages linux) #:use-module (gnu packages tor) + #:use-module (gnu packages usb-modeswitch) #:use-module (gnu packages messaging) #:use-module (gnu packages networking) #:use-module (gnu packages ntp) @@ -104,6 +108,12 @@ modem-manager-configuration? modem-manager-service-type + usb-modeswitch-configuration + usb-modeswitch-configuration? + usb-modeswitch-configuration-usb-modeswitch + usb-modeswitch-configuration-usb-modeswitch-data + usb-modeswitch-service-type + wpa-supplicant-configuration wpa-supplicant-configuration? @@ -1041,6 +1051,100 @@ a network connection manager.")))) ModemManager}, a modem management daemon that aims to simplify dialup networking.")))) + +;;; +;;; USB_ModeSwitch +;;; + +(define-record-type* + usb-modeswitch-configuration make-usb-modeswitch-configuration + usb-modeswitch-configuration? + (usb-modeswitch usb-modeswitch-configuration-usb-modeswitch + (default usb-modeswitch)) + (usb-modeswitch-data usb-modeswitch-configuration-usb-modeswitch-data + (default usb-modeswitch-data)) + (config-file usb-modeswitch-configuration-config-file + (default #~(string-append #$usb-modeswitch:dispatcher + "/etc/usb_modeswitch.conf")))) + +(define (usb-modeswitch-sh usb-modeswitch config-file) + "Build a copy of usb_modeswitch.sh located in package USB-MODESWITCH, +modified to pass the CONFIG-FILE in its calls to usb_modeswitch_dispatcher, +and wrap it to actually find the dispatcher in USB-MODESWITCH. The script +will be run by USB_ModeSwitch’s udev rules file when a modeswitchable USB +device is detected." + (computed-file + "usb_modeswitch-sh" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (let ((cfg-param + #$(if config-file + #~(string-append " --config-file=" #$config-file) + ""))) + (mkdir #$output) + (install-file (string-append #$usb-modeswitch:dispatcher + "/lib/udev/usb_modeswitch") + #$output) + + ;; insert CFG-PARAM into usb_modeswitch_dispatcher command-lines + (substitute* (string-append #$output "/usb_modeswitch") + (("(exec usb_modeswitch_dispatcher .*)( 2>>)" _ left right) + (string-append left cfg-param right)) + (("(exec usb_modeswitch_dispatcher .*)( &)" _ left right) + (string-append left cfg-param right))) + + ;; wrap-program needs bash in PATH: + (putenv (string-append "PATH=" #$bash "/bin")) + (wrap-program (string-append #$output "/usb_modeswitch") + `("PATH" ":" = (,(string-append #$coreutils "/bin") + ,(string-append + #$usb-modeswitch:dispatcher + "/bin"))))))))) + +(define (usb-modeswitch-configuration->udev-rules config) + "Build a rules file for extending udev-service-type from the rules in the +usb-modeswitch package specified in CONFIG. The rules file will invoke +usb_modeswitch.sh from the usb-modeswitch package, modified to pass the right +config file." + (match config + (($ usb-modeswitch data config-file) + (computed-file + "usb_modeswitch.rules" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (let ((in (string-append #$data "/udev/40-usb_modeswitch.rules")) + (out (string-append #$output "/lib/udev/rules.d")) + (script #$(usb-modeswitch-sh usb-modeswitch config-file))) + (mkdir-p out) + (chdir out) + (install-file in out) + (substitute* "40-usb_modeswitch.rules" + (("PROGRAM=\"usb_modeswitch") + (string-append "PROGRAM=\"" script "/usb_modeswitch")) + (("RUN\\+=\"usb_modeswitch") + (string-append "RUN+=\"" script "/usb_modeswitch")))))))))) + +(define usb-modeswitch-service-type + (service-type + (name 'usb-modeswitch) + (extensions + (list + (service-extension + udev-service-type + (lambda (config) + (let ((rules (usb-modeswitch-configuration->udev-rules config))) + (list rules)))))) + (default-value (usb-modeswitch-configuration)) + (description "Run @uref{http://www.draisberghof.de/usb_modeswitch/, +USB_ModeSwitch}, a mode switching tool for controlling USB devices with +multiple @dfn{modes}. When plugged in for the first time many USB +devices (primarily high-speed WAN modems) act like a flash storage containing +installers for Windows drivers. USB_ModeSwitch replays the sequence the +Windows drivers would send to switch their mode from storage to modem (or +whatever the thing is supposed to do)."))) + ;;; ;;; WPA supplicant -- cgit v1.2.3 From 7dbeb5a791fe6b8cb66ceb4e9261aa77f04e2fbc Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Wed, 12 Jun 2019 11:16:57 +0200 Subject: services: Include USB_ModeSwitch in %desktop-services. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . * gnu/services/desktop.scm (%desktop-services): Add usb-modeswitch-service-type. * doc/guix.texi (Networking Services): Document it. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 3 +++ gnu/services/desktop.scm | 1 + 2 files changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index bd535f82db..033ad9ea8e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12681,6 +12681,9 @@ themselves as a read-only storage medium and not as a modem. They need to be @dfn{modeswitched} before they are usable. The USB_ModeSwitch service type installs udev rules to automatically modeswitch these devices when they are plugged in. + +This service is part of @code{%desktop-services} (@pxref{Desktop +Services}). @end defvr @deftp {Data Type} usb-modeswitch-configuration diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 652f7b1b02..343d507c14 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -1067,6 +1067,7 @@ dispatches events from it."))) profile-service-type (list network-manager-applet)) (service modem-manager-service-type) + (service usb-modeswitch-service-type) ;; The D-Bus clique. (service avahi-service-type) -- cgit v1.2.3 From 1539156231205004993c9d9592039daa61021c50 Mon Sep 17 00:00:00 2001 From: Gábor Boskovits Date: Mon, 17 Jun 2019 23:20:44 +0200 Subject: doc: Fix typo. * doc/guix.texi (Base Services)[guix-publish-service-type]: "guix-publish-configuration" instead of "guix-configuration". --- doc/guix.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 033ad9ea8e..03f890c71d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -58,7 +58,7 @@ Copyright @copyright{} 2018 Rutger Helling@* Copyright @copyright{} 2018 Oleg Pykhalov@* Copyright @copyright{} 2018 Mike Gerwitz@* Copyright @copyright{} 2018 Pierre-Antoine Rouby@* -Copyright @copyright{} 2018 Gábor Boskovits@* +Copyright @copyright{} 2018, 2019 Gábor Boskovits@* Copyright @copyright{} 2018, 2019 Florian Pelz@* Copyright @copyright{} 2018 Laura Lazzati@* Copyright @copyright{} 2018 Alex Vong@* @@ -12245,7 +12245,7 @@ The GPM package to use. @anchor{guix-publish-service-type} @deffn {Scheme Variable} guix-publish-service-type This is the service type for @command{guix publish} (@pxref{Invoking -guix publish}). Its value must be a @code{guix-configuration} +guix publish}). Its value must be a @code{guix-publish-configuration} object, as described below. This assumes that @file{/etc/guix} already contains a signing key pair as -- cgit v1.2.3 From b95ccbaf61eb4108b00986f5d6996185e8887112 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 18 Jun 2019 12:27:46 +0200 Subject: doc: Replace invalid uses of @var with @code. * doc/guix.texi: Replace @var with @code in cases where we refer to a Scheme variable and not to a metasyntactic variable. --- doc/guix.texi | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 03f890c71d..65c3b8a7f1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6445,7 +6445,7 @@ Connect to the daemon over the Unix-domain socket at @var{uri} (a string). When extra space on the file system so that the garbage collector can still operate should the disk become full. Return a server object. -@var{file} defaults to @var{%default-socket-path}, which is the normal +@var{file} defaults to @code{%default-socket-path}, which is the normal location given the options that were passed to @command{configure}. @end deffn @@ -10357,7 +10357,7 @@ configuration options. The @code{packages} field lists packages that will be globally visible on the system, for all user accounts---i.e., in every user's @code{PATH} environment variable---in addition to the per-user profiles -(@pxref{Invoking guix package}). The @var{%base-packages} variable +(@pxref{Invoking guix package}). The @code{%base-packages} variable provides all the tools one would expect for basic user and administrator tasks---including the GNU Core Utilities, the GNU Networking Utilities, the GNU Zile lightweight text editor, @command{find}, @command{grep}, @@ -10418,7 +10418,7 @@ customize them. To do this, use @code{modify-services} (@pxref{Service Reference, @code{modify-services}}) to modify the list. For example, suppose you want to modify @code{guix-daemon} and Mingetty -(the console log-in) in the @var{%base-services} list (@pxref{Base +(the console log-in) in the @code{%base-services} list (@pxref{Base Services, @code{%base-services}}). To do that, you can write the following in your operating system declaration: @@ -10442,7 +10442,7 @@ following in your operating system declaration: This changes the configuration---i.e., the service parameters---of the @code{guix-service-type} instance, and that of all the -@code{mingetty-service-type} instances in the @var{%base-services} list. +@code{mingetty-service-type} instances in the @code{%base-services} list. Observe how this is accomplished: first, we arrange for the original configuration to be bound to the identifier @code{config} in the @var{body}, and then we write the @var{body} so that it evaluates to the @@ -10473,15 +10473,15 @@ This example refers to the @file{/boot/efi} file system by its UUID, as returned by the @command{blkid} command. @xref{Desktop Services}, for the exact list of services provided by -@var{%desktop-services}. @xref{X.509 Certificates}, for background +@code{%desktop-services}. @xref{X.509 Certificates}, for background information about the @code{nss-certs} package that is used here. -Again, @var{%desktop-services} is just a list of service objects. If +Again, @code{%desktop-services} is just a list of service objects. If you want to remove services from there, you can do so using the procedures for list filtering (@pxref{SRFI-1 Filtering and Partitioning,,, guile, GNU Guile Reference Manual}). For instance, the following expression returns a list that contains all the services in -@var{%desktop-services} minus the Avahi service: +@code{%desktop-services} minus the Avahi service: @example (remove (lambda (service) @@ -10600,7 +10600,7 @@ A procedure that returns an initial RAM disk for the Linux kernel. This field is provided to support low-level customization and should rarely be needed for casual use. @xref{Initial RAM Disk}. -@item @code{firmware} (default: @var{%base-firmware}) +@item @code{firmware} (default: @code{%base-firmware}) @cindex firmware List of firmware packages loadable by the operating system kernel. @@ -10635,7 +10635,7 @@ device, provided that the necessary device mapping and file system are also specified. @xref{Mapped Devices} and @ref{File Systems}. @item @code{users} (default: @code{%base-user-accounts}) -@itemx @code{groups} (default: @var{%base-groups}) +@itemx @code{groups} (default: @code{%base-groups}) List of user accounts and groups. @xref{User Accounts}. If the @code{users} list lacks a user account with UID@tie{}0, a @@ -10655,11 +10655,11 @@ For instance, a valid value may look like this: (activate-readline)"))) @end example -@item @code{issue} (default: @var{%default-issue}) +@item @code{issue} (default: @code{%default-issue}) A string denoting the contents of the @file{/etc/issue} file, which is displayed when users log in on a text console. -@item @code{packages} (default: @var{%base-packages}) +@item @code{packages} (default: @code{%base-packages}) The set of packages installed in the global profile, which is accessible at @file{/run/current-system/profile}. @@ -10678,7 +10678,7 @@ causes @command{guix system} to fail. The name of the default locale (@pxref{Locale Names,,, libc, The GNU C Library Reference Manual}). @xref{Locales}, for more information. -@item @code{locale-definitions} (default: @var{%default-locale-definitions}) +@item @code{locale-definitions} (default: @code{%default-locale-definitions}) The list of locale definitions to be compiled and that may be used at run time. @xref{Locales}. @@ -10687,12 +10687,12 @@ The list of GNU@tie{}libc packages whose locale data and tools are used to build the locale definitions. @xref{Locales}, for compatibility considerations that justify this option. -@item @code{name-service-switch} (default: @var{%default-nss}) +@item @code{name-service-switch} (default: @code{%default-nss}) Configuration of the libc name service switch (NSS)---a @code{} object. @xref{Name Service Switch}, for details. -@item @code{services} (default: @var{%base-services}) +@item @code{services} (default: @code{%base-services}) A list of service objects denoting system services. @xref{Services}. @cindex essential services @@ -11557,7 +11557,7 @@ more. This is the default value of the @code{services} field of @code{operating-system} declarations. Usually, when customizing a -system, you will want to append services to @var{%base-services}, like +system, you will want to append services to @code{%base-services}, like this: @example @@ -12054,7 +12054,7 @@ Whether to authorize the substitute keys listed in (@pxref{Substitutes}). @vindex %default-authorized-guix-keys -@item @code{authorized-keys} (default: @var{%default-authorized-guix-keys}) +@item @code{authorized-keys} (default: @code{%default-authorized-guix-keys}) The list of authorized key files for archive imports, as a list of string-valued gexps (@pxref{Invoking guix archive}). By default, it contains that of @code{@value{SUBSTITUTE-SERVER}} (@pxref{Substitutes}). @@ -12062,7 +12062,7 @@ contains that of @code{@value{SUBSTITUTE-SERVER}} (@pxref{Substitutes}). @item @code{use-substitutes?} (default: @code{#t}) Whether to use substitutes. -@item @code{substitute-urls} (default: @var{%default-substitute-urls}) +@item @code{substitute-urls} (default: @code{%default-substitute-urls}) The list of URLs where to look for substitutes by default. @item @code{max-silent-time} (default: @code{0}) @@ -12223,7 +12223,7 @@ allows users to use the mouse in the console, notably to select, copy, and paste text. The value for services of this type must be a @code{gpm-configuration} -(see below). This service is not part of @var{%base-services}. +(see below). This service is not part of @code{%base-services}. @end defvr @deftp {Data Type} gpm-configuration @@ -14732,7 +14732,7 @@ services that users typically expect on a machine with a graphical environment and networking: @defvr {Scheme Variable} %desktop-services -This is a list of services that builds upon @var{%base-services} and +This is a list of services that builds upon @code{%base-services} and adds or adjusts services for a typical ``desktop'' setup. In particular, it adds a graphical login manager (@pxref{X Window, @@ -14747,7 +14747,7 @@ name service switch service configured to be able to use @code{nss-mdns} (@pxref{Name Service Switch, mDNS}). @end defvr -The @var{%desktop-services} variable can be used as the @code{services} +The @code{%desktop-services} variable can be used as the @code{services} field of an @code{operating-system} declaration (@pxref{operating-system Reference, @code{services}}). @@ -16756,7 +16756,7 @@ Data type representing the configuration of opensmtpd. @item @code{package} (default: @var{opensmtpd}) Package object of the OpenSMTPD SMTP server. -@item @code{config-file} (default: @var{%default-opensmtpd-file}) +@item @code{config-file} (default: @code{%default-opensmtpd-file}) File-like object of the OpenSMTPD configuration file to use. By default it listens on the loopback network interface, and allows for mail from users and daemons on the local machine, as well as permitting email to @@ -24363,7 +24363,7 @@ to the @code{packages} field of the @code{operating-system} declaration @code{nss-certs}, which is a set of CA certificates provided as part of Mozilla's Network Security Services. -Note that it is @emph{not} part of @var{%base-packages}, so you need to +Note that it is @emph{not} part of @code{%base-packages}, so you need to explicitly add it. The @file{/etc/ssl/certs} directory, which is where most applications and libraries look for certificates by default, points to the certificates installed globally. @@ -24457,7 +24457,7 @@ want is to have @code{.local} host lookup working. Note that, in this case, in addition to setting the @code{name-service-switch} of the @code{operating-system} declaration, you also need to use @code{avahi-service-type} (@pxref{Networking Services, -@code{avahi-service-type}}), or @var{%desktop-services}, which includes it +@code{avahi-service-type}}), or @code{%desktop-services}, which includes it (@pxref{Desktop Services}). Doing this makes @code{nss-mdns} accessible to the name service cache daemon (@pxref{Base Services, @code{nscd-service}}). -- cgit v1.2.3