From patchwork Sat May 24 13:01:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 42895 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id EDA5727BC4C; Sat, 24 May 2025 14:02:29 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 10FD327BC49 for ; Sat, 24 May 2025 14:02:29 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uIoVt-0005cd-KZ; Sat, 24 May 2025 09:02:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uIoVp-0005bv-M1 for guix-patches@gnu.org; Sat, 24 May 2025 09:02:06 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIoVo-00054e-8V; Sat, 24 May 2025 09:02:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=/FUhEb1HZezF8hBwg+pRqSL0E8XViIkse9u+LWbvHJI=; b=p+YwIpm4vSCfRVObp20hZcad5NP9fkNrsEFYgrIrtuBwAquuwHj6wDrT9V29EFMjt26REsQ5wFRiYhwRWWQq+OyeZdM/5jPPtuEBOo7R/084ssGJ8H6GS1f+hXLcDc8r/ui4Pk64g6NTb6PuTpaTvwIVYQYXV8Yp9kAfBNH9KfaqiN3J6tWkQKJ7o+4M0C8xyMcAy+ik7+NnKxu7RWz1+5yirxO/aKEBdtCMLArV8TcIt46b2viABTHc0uzvP1n0wqVMI6JRSJUIhJFv5n8EO1jOg2o5oSaZmD3GT6kIwz85BA0LCy6gzsEJCBm+/X9a09c+7RsrFYMpaFMV+t8fCQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uIoVn-0004mU-33; Sat, 24 May 2025 09:02:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78546] [PATCH v2 1/5] services: configuration: Add define-enumerated-field-type helper. References: In-Reply-To: Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: sarg@sarg.org.ru, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Sat, 24 May 2025 13:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78546 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78546@debbugs.gnu.org Cc: Sergey Trofimov , Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 78546-submit@debbugs.gnu.org id=B78546.174809171418318 (code B ref 78546); Sat, 24 May 2025 13:02:03 +0000 Received: (at 78546) by debbugs.gnu.org; 24 May 2025 13:01:54 +0000 Received: from localhost ([127.0.0.1]:58874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIoVd-0004lF-QX for submit@debbugs.gnu.org; Sat, 24 May 2025 09:01:54 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:52406) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uIoVZ-0004kq-UO for 78546@debbugs.gnu.org; Sat, 24 May 2025 09:01:51 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-601aa0cb92eso915769a12.0 for <78546@debbugs.gnu.org>; Sat, 24 May 2025 06:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1748091703; x=1748696503; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/FUhEb1HZezF8hBwg+pRqSL0E8XViIkse9u+LWbvHJI=; b=j3YZ5FXLqaLBG/0ZM7bEG60jA6m/cnra1Nf/GODDzfHx5Pg6Wwx4uNH2DD+ndnuEyK yGvzI7204DXeP23WFxqxrHQ762VKwI6XaRuKQfjlrOMMGSC5faiKUYMTDMtSHHULip53 8LvFc4quzXrHokaRhskS+F81dMn4L5yjU72nxreHsvBeigNY5aL5QcqL7TllJvYCXApL +ynZ8OdMRoVrrnVfo4Ra8S2KOeCa67HQ+UsldNm9g8e0ASwdDzMqYsRhqTCCOgQ0sSkw PfRUux92S1zda0N7p+HiRe/QZPUMzqMel7c5rHx0uLOiKtVAcZ8jFjiBuubsPFaRoQwY r+bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748091703; x=1748696503; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/FUhEb1HZezF8hBwg+pRqSL0E8XViIkse9u+LWbvHJI=; b=mPjELkz6EDLrHXAV0i2AExLHQ1ZfKOSBfIduJEnoLd3uSUOsJmxupo4ou4IL64UCu/ RrM72qe4A4ZVyM3Tdm7jKgg7VL/SUA4JOIeCElFSRHKCUpa5/kLf6d1/I8hBMsO9QWD+ wb6l1LUGMOQp9gOLKPFBg7mR7qQRooqkZDUBdjeeCwNF3EVcCti4BfgEsc9u1HhNz1rm qMtTsL/H2VCjxHJ0ipIxj5yHgo3wXelVkGeL8xB2mOU+KiVYFVYDz6fIIs9HQKJSyUQK 1L7rGHSKLAFclwqEoOmsv94jfVpgUeEXKTojaarm3IHyJ0AxbGGrFBDZju8YImGecqyJ 0Iqg== X-Gm-Message-State: AOJu0YwB1HzpR274VJl/SXILXBNEEcJaZoHU8CRI/P3/H0YBHti8F88C Bn7JqqgrFjm+WbmJd4R1EF+FHRO3V4Qeq1x/ih6urSOGOFKmvUoFEfI7GNrNYsWz3e/9ZkGNZpr IsIEX7fIy9A== X-Gm-Gg: ASbGncv7P4YHfzs3sN07aED7cK6zdxsdbzWB8LrrWJLMhEJZAl/ye8mut8ae4QxstYF 2hh115fJwa7jPR+3/PDZU7yoTvxZ8c9M8QWp4mH3CXqlh67tLJr9OL0cuhL+pvHKZ0rYlB1D3tm vsdchnIq54Jw9UQUbJ1cTzTcocWDqhqHB0nqYiYCNu3TiN2UMHVhRppi/h0VPDwl5cf+aROdELM E5+Ti0VPTuxd7frq8k6SToyx/FRYfpw7wUVmT5hkYXpW83yo/2O32vP48aKe8XnEpXStAbcwVpx SmNMippgVv7OE0aEQW1eDXRSMz7kAnEVVst/djwXZ+Lza4Z+ X-Google-Smtp-Source: AGHT+IEqHasP+bsU0q2v+6SPaWI/eHDspMXz9eaZsQoekipwZHZKokxEl5oqQgW1lzCYiqYNCDfIUA== X-Received: by 2002:a17:906:7945:b0:ad5:430b:9013 with SMTP id a640c23a62f3a-ad85b2d6f1fmr240865466b.42.1748091702769; Sat, 24 May 2025 06:01:42 -0700 (PDT) Received: from localhost ([2a02:2454:a095:5600:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad52d4383f8sm1383860166b.113.2025.05.24.06.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 May 2025 06:01:42 -0700 (PDT) From: Sergey Trofimov Date: Sat, 24 May 2025 15:01:28 +0200 Message-ID: <99f9547c43312c49e557b5e67a356a76cc6b2ad7.1748091536.git.sarg@sarg.org.ru> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/cups.scm (define-enumerated-field-type): Move... * gnu/services/configuration.scm (define-enumerated-field-type): ...here. * gnu/services/vpn.scm (define-enumerated-field-type): Remove. * gnu/services/power.scm (define-enum): Replace with define-enumerated-field-type. Change-Id: I89ec40f479e3f800268e714f1f88d638be017c7e --- gnu/services/configuration.scm | 14 +++++++++++ gnu/services/cups.scm | 12 --------- gnu/services/power.scm | 45 +++++++++++----------------------- gnu/services/vpn.scm | 12 --------- 4 files changed, 28 insertions(+), 55 deletions(-) base-commit: 0c799ea004129c487a0aa8573d2e3e0839c84b2f diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index 15eddd7665..6d9fd1feae 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -75,6 +75,7 @@ (define-module (gnu services configuration) configuration->documentation empty-serializer serialize-package + define-enumerated-field-type filter-configuration-fields @@ -508,6 +509,19 @@ (define* (interpose ls #:optional (delimiter "\n") (grammar 'infix)) (cons delimiter acc)))) '() ls)) +(define-syntax define-enumerated-field-type + (lambda (x) + (syntax-case x (prefix) + ((_ name (option ...) (prefix serializer-prefix)) + #`(begin + (define (#,(id #'name #'name #'?) x) + (memq x '(option ...))) + (define (#,(id #'name #'serializer-prefix #'serialize- #'name) field-name val) + (#,(id #'name #'serializer-prefix #'serialize-field) field-name val)))) + + ((_ name (option ...)) + #`(define-enumerated-field-type name (option ...) (prefix #{}#)))))) + ;;; ;;; Commonly used predicates diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm index 738bb7f5cc..27aac7a16a 100644 --- a/gnu/services/cups.scm +++ b/gnu/services/cups.scm @@ -137,18 +137,6 @@ (define (non-negative-integer? val) (define (serialize-non-negative-integer field-name val) (serialize-field field-name val)) -(define-syntax define-enumerated-field-type - (lambda (x) - (define (id-append ctx . parts) - (datum->syntax ctx (apply symbol-append (map syntax->datum parts)))) - (syntax-case x () - ((_ name (option ...)) - #`(begin - (define (#,(id-append #'name #'name #'?) x) - (memq x '(option ...))) - (define (#,(id-append #'name #'serialize- #'name) field-name val) - (serialize-field field-name val))))))) - (define-enumerated-field-type access-log-level (config actions all)) (define-enumerated-field-type browse-local-protocols diff --git a/gnu/services/power.scm b/gnu/services/power.scm index ec8ae555d4..ad386549cd 100644 --- a/gnu/services/power.scm +++ b/gnu/services/power.scm @@ -204,23 +204,6 @@ (define-configuration/no-serialization apcupsd-event-handlers #~(#t)) "The handler for the battattach event.")) -(define-syntax define-enum - (lambda (x) - (syntax-case x () - ((_ name values) - (let* ((datum/name (syntax->datum #'name)) - (datum/predicate (string->symbol - (format #f "enum-~a?" datum/name))) - (datum/serialize (string->symbol - (format #f "serialize-enum-~a" datum/name)))) - (with-syntax - ((predicate (datum->syntax x datum/predicate)) - (serialize (datum->syntax x datum/serialize))) - #'(begin - (define (predicate value) - (memq value values)) - (define serialize serialize-symbol)))))))) - (define mangle-field-name (match-lambda ('name "UPSNAME") @@ -252,25 +235,25 @@ (define mangle-field-name ('data-time "DATATIME") ('facility "FACILITY"))) -(define (serialize-string field-name value) +(define (serialize-field field-name value) #~(format #f "~a ~a\n" #$(mangle-field-name field-name) '#$value)) -(define serialize-symbol serialize-string) -(define serialize-integer serialize-string) +(define serialize-string serialize-field) +(define serialize-symbol serialize-field) +(define serialize-integer serialize-field) (define (serialize-boolean field-name value) - #~(format #f "~a ~a\n" - #$(mangle-field-name field-name) - #$(if value "on" "off"))) + (serialize-field field-name (if value "on" "off"))) (define-maybe string) -(define-enum cable '( simple smart ether usb - 940-0119A 940-0127A 940-0128A 940-0020B 940-0020C - 940-0023A 940-0024B 940-0024C 940-1524C 940-0024G - 940-0095A 940-0095B 940-0095C 940-0625A MAM-04-02-2000)) -(define-enum type '(apcsmart usb net snmp netsnmp dumb pcnet modbus test)) -(define-enum no-logon '(disable timeout percent minutes always)) -(define-enum class '(standalone shareslave sharemaster)) -(define-enum mode '(disable share)) +(define-enumerated-field-type enum-cable + ( simple smart ether usb + 940-0119A 940-0127A 940-0128A 940-0020B 940-0020C + 940-0023A 940-0024B 940-0024C 940-1524C 940-0024G + 940-0095A 940-0095B 940-0095C 940-0625A MAM-04-02-2000)) +(define-enumerated-field-type enum-type (apcsmart usb net snmp netsnmp dumb pcnet modbus test)) +(define-enumerated-field-type enum-no-logon (disable timeout percent minutes always)) +(define-enumerated-field-type enum-class (standalone shareslave sharemaster)) +(define-enumerated-field-type enum-mode (disable share)) (define-configuration apcupsd-configuration (apcupsd (package apcupsd) "The @code{apcupsd} package to use.") diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index f97cbac7bb..56022ac27a 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -141,18 +141,6 @@ (define (ip-mask? val) #f))) (define serialize-ip-mask serialize-string) -(define-syntax define-enumerated-field-type - (lambda (x) - (define (id-append ctx . parts) - (datum->syntax ctx (apply symbol-append (map syntax->datum parts)))) - (syntax-case x () - ((_ name (option ...)) - #`(begin - (define (#,(id-append #'name #'name #'?) x) - (memq x '(option ...))) - (define (#,(id-append #'name #'serialize- #'name) field-name val) - (serialize-field field-name val))))))) - (define-enumerated-field-type proto (udp tcp udp6 tcp6)) (define-enumerated-field-type dev From patchwork Sat May 24 13:01:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 42896 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BC8D227BC4C; Sat, 24 May 2025 14:02:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1CE0B27BC49 for ; Sat, 24 May 2025 14:02:33 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uIoVv-0005ci-4z; Sat, 24 May 2025 09:02:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uIoVr-0005cL-3h for guix-patches@gnu.org; Sat, 24 May 2025 09:02:09 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIoVq-00055N-LJ; Sat, 24 May 2025 09:02:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=723MHo23hm4gTpbk9/KTk+L2vHplj/qdoWmMDcOgy/s=; b=XI68+P1aabuArtaCqhxuTL+sz/X4ylbR6nPhvzBgkB86EZ1h2KvBfKSVL7p+mjuNfS59f1/fNeaI7tsm1nU09zGZGEu64Wh4wKTFpUrRaFSjRo6evG9sHeLYN094sNkCtHgPvkA3w3YAtuOuZ/DH1B6LLyQrvaDFe1XrlGZ5bDoufNteRnQ35DDsvf+IlQ31ns14TfkCW7cX8Wb2aSIFfVawLnPpCtJsKwSCuMiOV3sHVYe74tDtQPVWgvqzuZvnPdwCSo2LL+LcITemsvnvRBO09Xb0Fy520EBibrq6Am8hhjj5xROFLbHcWJJSZn0DaX+hPsTnhfC4yEdmYQC+Yw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uIoVn-0004mb-KO; Sat, 24 May 2025 09:02:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78546] [PATCH v2 2/5] services: networking: Add shepherd-requirement for dhcpcd. Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: sarg@sarg.org.ru, ludo@gnu.org, gabriel@erlikon.ch, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 24 May 2025 13:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78546 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78546@debbugs.gnu.org Cc: Sergey Trofimov , Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Gabriel Wicki , Maxim Cournoyer X-Debbugs-Original-Xcc: Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Gabriel Wicki , Maxim Cournoyer Received: via spool by 78546-submit@debbugs.gnu.org id=B78546.174809172018352 (code B ref 78546); Sat, 24 May 2025 13:02:03 +0000 Received: (at 78546) by debbugs.gnu.org; 24 May 2025 13:02:00 +0000 Received: from localhost ([127.0.0.1]:58877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIoVi-0004lo-Rw for submit@debbugs.gnu.org; Sat, 24 May 2025 09:01:59 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:55447) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uIoVf-0004l2-WA for 78546@debbugs.gnu.org; Sat, 24 May 2025 09:01:56 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-ad5394be625so139606366b.2 for <78546@debbugs.gnu.org>; Sat, 24 May 2025 06:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1748091709; x=1748696509; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=723MHo23hm4gTpbk9/KTk+L2vHplj/qdoWmMDcOgy/s=; b=pcB8WoYK6S1R54DQ5yDWx9ApxgukPFTAIAX70c4WKOnrMqcvdnSnK1AgOSH5crHWtW cy1KY5Y2gEBSaglrxRxWUFIa4UNF48XUjpGRJtg70ZZFMVJS1MGVLN0Pkth++tu1ZTy/ eV3HimUnV8h3Bt69iUg7zsu3eSao/uqSiK8O/bW0sqqDc+28GvNJmF3bzU4MrgsKCBqn /ydt3vtt+UMnslYEcsZettOGLyhSFkbB02EUTptXm9VN6nigspVtKhbSF+Nuqh9gqJ0t 8egA4AsI7FK2u2U9eAck636ToLq9hfxP1EfjXL+0Ba9MJjB4/Qc/gqF1mhUkEnH4WUjw /B2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748091709; x=1748696509; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=723MHo23hm4gTpbk9/KTk+L2vHplj/qdoWmMDcOgy/s=; b=NCntnw7r3g2rFJMD4neMqhF89NLlpxiML2DyKSOC35viYIRnYpz3k+IkfxCqAHbN5Q CcvHLcifZhSe7xXFcjpEyf1vqg7z9kyPndVosIdoGnX5E1uC8eeDTyysynz9v8pUmGba ay+Em2F33Lwx5NH14DcivwV8Qh/f6gGC77FCVFZqn2GyzpwmT85rnjugZqeI88GaCfoL +sidh1+oDNKCPqZacfWh/pddrutHbJLf6uAHVGUJkxCQYSsPbnIaMfZ3lB0MCGldDQCs 5p2xrbVrsmCnazq7hw4VRvxUxmvdAsl7rs32koLu0aMxGkqrORL0OVxt/AH4VoH7DZzF 5Ldg== X-Gm-Message-State: AOJu0Yzr6LgaZWid6KIPNcilcMSThv/haJ9JkmNTyrglm53TaNoikwWs GXXkgfbjTCZVMFSSLOSFHCMmBdrZfP3yuYA850GLpcb+hWrBH1F/cYwJ8hwERVhO4C+QscSB04U XJ3Jyyol8aQ== X-Gm-Gg: ASbGncsgCSM2nGIq9p8fZra6kHcMaZO+V+k/ToiZPt1O/9tcC6jPERxrs6XI+VEZjBg ur93O9zXQroCJTS4mfC1ZZlLJN4cFa1h/l70mzgHDt+nDNdXkxtcmwVX16zPWp0/WLMmFVptwI3 ypTFZ8lciCCwdKavav42cMn9+HmtbxN3Uev5n+dhuPWn5n93tiIx5UzcOw905nWIZ4xkkzjdafm /RdkHNxnHHVxKUU/et/JA9k9O7iEO/u6cDXARdHLauf9ozEFqtgOurDImwPk1kCR239YouZd1kA m6ZCvcAkQXrrgub3nFGEQ6Efx5FiA50S1ivqU/GumabHXOpl X-Google-Smtp-Source: AGHT+IFDVzb2bdgyHrXSqimsQkhKJEApfDEpeUnW0lmPgkigBtH7nnbHc0/vx12PWkUH5ERpVUeoRA== X-Received: by 2002:a17:907:868b:b0:ad2:4ed5:ca34 with SMTP id a640c23a62f3a-ad85b1d66b4mr233618766b.50.1748091709058; Sat, 24 May 2025 06:01:49 -0700 (PDT) Received: from localhost ([2a02:2454:a095:5600:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad52d278282sm1371013566b.80.2025.05.24.06.01.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 May 2025 06:01:48 -0700 (PDT) From: Sergey Trofimov Date: Sat, 24 May 2025 15:01:29 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: <99f9547c43312c49e557b5e67a356a76cc6b2ad7.1748091536.git.sarg@sarg.org.ru> References: <99f9547c43312c49e557b5e67a356a76cc6b2ad7.1748091536.git.sarg@sarg.org.ru> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/networking.scm (dhcpcd-configuration): Add shepherd-requirement field. (dhcpcd-shepherd-service): Use it. * doc/guix.texi (Networking Setup): Regenerate dhcpcd-configuration documentation. (File Systems): Fix typo. Change-Id: Id347e2bed2569237685a47be82dbf686640db25b --- doc/guix.texi | 17 +++++++++++------ gnu/services/networking.scm | 31 +++++++++++++++++++------------ 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index e4e2b853f1..502482b754 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18332,7 +18332,7 @@ File Systems might not be sufficient as @code{networking} being marked as started does @emph{not} imply the network has already been configured and in working order (for example, when using -@code{dhcpcd-client-service-type}). For such cases, adding a +@code{dhcp-client-service-type}). For such cases, adding a requirement on a custom @code{network-online} service may be necessary. A sample @code{network-online} one-shot Shepherd service implementation is provided below: @@ -21980,12 +21980,13 @@ Networking Setup @item @code{duid} (default: @code{""}) (type: maybe-string) DHCPv4 clients require a unique client identifier, this option uses the DHCPv6 Unique Identifier as a DHCPv4 client identifier as well. For -more information, refer to @uref{https://www.rfc-editor.org/rfc/rfc4361, RFC 4361} -and @code{dhcpcd.conf(5)}. +more information, refer to +@uref{https://www.rfc-editor.org/rfc/rfc4361,RFC 4361} and +@code{dhcpcd.conf(5)}. @item @code{persistent?} (default: @code{#t}) (type: boolean) -When true, automatically de-configure the interface when @command{dhcpcd} -exits. +When true, automatically de-configure the interface when +@command{dhcpcd} exits. @item @code{option} (default: @code{("rapid_commit" "domain_name_servers" "domain_name" "domain_search" "host_name" "classless_static_routes" "interface_mtu")}) (type: list-of-strings) List of options to request from the server. @@ -22019,9 +22020,13 @@ Networking Setup @item @code{extra-content} (type: maybe-string) Extra content to append to the configuration as-is. +@item @code{shepherd-requirement} (default: @code{()}) (type: list-of-symbols) +This is a list of symbols naming Shepherd services that this service +will depend on. + @end table -@end deftp +@end deftp @cindex NetworkManager diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 67653e2cbf..4cb7313808 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -126,6 +126,7 @@ (define-module (gnu services networking) dhcpcd-configuration-vendor-class-id dhcpcd-configuration-client-id dhcpcd-configuration-extra-content + dhcpcd-configuration-shepherd-requirement ntp-configuration ntp-configuration? @@ -609,6 +610,12 @@ (define-configuration dhcpcd-configuration maybe-string "Extra content to append to the configuration as-is.") + (shepherd-requirement + (list-of-symbols '()) + "This is a list of symbols naming Shepherd services that this service +will depend on." + empty-serializer) + (prefix dhcpcd-)) (define (dhcpcd-config-file config) @@ -628,19 +635,19 @@ (define dhcpcd-account-service (shell (file-append shadow "/sbin/nologin"))))) (define (dhcpcd-shepherd-service config) - (let* ((config-file (dhcpcd-config-file config)) - (command-args (dhcpcd-configuration-command-arguments config)) - (ifaces (dhcpcd-configuration-interfaces config))) - (list (shepherd-service - (documentation "dhcpcd daemon.") - (provision '(networking)) - (requirement '(user-processes udev)) - (actions (list (shepherd-configuration-action config-file))) - (start + (match-record config + (command-arguments interfaces shepherd-requirement) + (let ((config-file (dhcpcd-config-file config))) + (list (shepherd-service + (documentation "dhcpcd daemon.") + (provision '(networking)) + (requirement `(user-processes udev ,@shepherd-requirement)) + (actions (list (shepherd-configuration-action config-file))) + (start #~(make-forkexec-constructor - (list (string-append #$dhcpcd "/sbin/dhcpcd") - #$@command-args "-B" "-f" #$config-file #$@ifaces))) - (stop #~(make-kill-destructor)))))) + (list (string-append #$dhcpcd "/sbin/dhcpcd") + #$@command-arguments "-B" "-f" #$config-file #$@interfaces))) + (stop #~(make-kill-destructor))))))) (define dhcpcd-service-type (service-type (name 'dhcpcd) From patchwork Sat May 24 13:01:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 42899 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AC60427BC4C; Sat, 24 May 2025 14:03:48 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 18A9027BC49 for ; Sat, 24 May 2025 14:03:48 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uIoWq-0005pu-LI; Sat, 24 May 2025 09:03:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uIoWn-0005op-4L for guix-patches@gnu.org; Sat, 24 May 2025 09:03:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIoWm-0005FA-PS; Sat, 24 May 2025 09:03:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=DlWCtWAByAe0vqFel3WB7JLQT2uDi0/0ytsdvpc4pvs=; b=i+hKb9/mkm6cxhB5BCtZupcONxDzLdvJU9Dwu3/UHcugAZAD2pLx07g1jXRLta7Wr4hOvXqHQCLq4FkWFgU1LA1kETzNe1KFXGFmNkA2Fna60yZTTbZmEt2vQqWMPx5LdQUgnEMcYh76rsQU/dbFlikGg0hAKXEQHV9njZHGMJ7OtxmK5jUcGC/J8Mc+2hnHbNlVkHJdJbcAffHlvLXU6xYEZ8dD5WDO24BLY0ijaPWUmzNx4yecT/h6Q4hP6zw8Fhs/q/PfE1qDhuUqsOJBxcr264P+RfUiMlGQt47Kdxx4JjlOBr+IlodHrfLmHcJe7a6y6bjytYybvdiDz6QLeg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uIoWk-0004qL-Bd; Sat, 24 May 2025 09:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78546] [PATCH v2 3/5] services: wpa-supplicant: Add 'wireless-daemon' provision. Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: sarg@sarg.org.ru, ludo@gnu.org, gabriel@erlikon.ch, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 24 May 2025 13:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78546 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78546@debbugs.gnu.org Cc: Sergey Trofimov , Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Gabriel Wicki , Maxim Cournoyer X-Debbugs-Original-Xcc: Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Gabriel Wicki , Maxim Cournoyer Received: via spool by 78546-submit@debbugs.gnu.org id=B78546.174809172518425 (code B ref 78546); Sat, 24 May 2025 13:03:02 +0000 Received: (at 78546) by debbugs.gnu.org; 24 May 2025 13:02:05 +0000 Received: from localhost ([127.0.0.1]:58885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIoVp-0004n3-26 for submit@debbugs.gnu.org; Sat, 24 May 2025 09:02:05 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:54338) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uIoVj-0004lI-P5 for 78546@debbugs.gnu.org; Sat, 24 May 2025 09:02:00 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-ad55d6aeb07so125606866b.0 for <78546@debbugs.gnu.org>; Sat, 24 May 2025 06:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1748091713; x=1748696513; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DlWCtWAByAe0vqFel3WB7JLQT2uDi0/0ytsdvpc4pvs=; b=KigqPYoD7eOMQaf7D7rwlaXbfzAzxuyN3Cb/u+p1CrO8j08AWv6e0I8+XY3+rsGkhC xizCGjZDg8FRoxMBoHbVH1WRGXfFliBSCXC1Bh5XIMgVzgIAjtkswOBz3h/JOy57oVLO RDe185hYSt1UfO7l03vCpOGsVJRhji2xyHUq5x8u9O28MaqBwww9AzgdubtPjQXI5Cn3 zZfiM7ydpWInrOneEnJ5KDVsOGZwnDownr8TxwhXE4bBk2tIRjh05otGSHXEp2AFr6wr EtS7vArAAJEm9ydNZxcqUzdP9STcrA5ZH17vE8ENk+dwLo1KE/Y3cyeyRXhVUCIEn9bR zv3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748091713; x=1748696513; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DlWCtWAByAe0vqFel3WB7JLQT2uDi0/0ytsdvpc4pvs=; b=lCbGJqZznZkjzPztWSgN+8vNScY6Pvx5Bs5YHQS8zv9KpNtINJFWO5lRuizKLOc0y9 DW6UwVRI85LZt09HAJnqsOESbwPWJ+TK/WLG2yB4WEbwnMf5Ox44ZhpLJMdJBCsNyokj X1+Pq6gJAfiqmEmKo/yW0eGtR6IRLMJRD4TbAfUr6WwwrSSRXdcMk6c2EcuV26cRSxhh Q/pleqITKpauz7VGaH2xE5q47w+5770+d/4Lf+XcdWeHtMmn3jHlfBWxQYmIK9kOQzqK dBxZbVrA/8Foi9AMdPPxGXiW4Hkn6ImrElAP6xr3ZdghYm735mbNWUgWu8M1OYjlY6c/ Dm5g== X-Gm-Message-State: AOJu0YyyZ9iiKV6q9Fk/hLXTDSrFRortZqElgZdoFPdywW4Whu1n9hUn /bXrCUism66QijG93BkL2AZ1/oLTi6a2NJX1c4ZHMtEzYBf3+5ZE/O9Lf30Jml4reZBjgydWFgX BrfMZnu8GsA== X-Gm-Gg: ASbGncswt5g7A4L4MWh0Yt9+Ov43Qi3jNwd4CQVaFCuuMum4Q64J07Qax1Dp1z3bpO7 W6U/8owROsnHuFbPbaDi2FoHlJ7jWypOQblvfbHG67HArQ2sPAESr1GgCt55bL4f6QJw6Pp/loP dWvv7SBlt46c4F0pynvy6j5QuzyZ4E+Ay8YxKTokXREWxO59EzvwoyZ6b6kBDZl/UBH+myMbZ0M +jPkH/R7THne1ajaBnLBeVasmMlwe1zJxqrwGe43skxtPRCWtOLm0dZBKTCv/+QMwVmyG+FnusQ kGVICongPdS4C+9s/btEMTzGyAPr+vykzdnDixbNGIbNJXDTbbB19ODKZgc= X-Google-Smtp-Source: AGHT+IEm0LQdBFhBp39cBxi4faSV7x8tCZ4stOHtsPtLfsWiY0Yknn0yZnl5Zh6Sihsv3G0KTTWnnQ== X-Received: by 2002:a17:907:3faa:b0:ad5:d494:a22a with SMTP id a640c23a62f3a-ad85b077992mr232355566b.27.1748091711379; Sat, 24 May 2025 06:01:51 -0700 (PDT) Received: from localhost ([2a02:2454:a095:5600:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad52d04af1esm1378295066b.20.2025.05.24.06.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 May 2025 06:01:50 -0700 (PDT) From: Sergey Trofimov Date: Sat, 24 May 2025 15:01:30 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: <99f9547c43312c49e557b5e67a356a76cc6b2ad7.1748091536.git.sarg@sarg.org.ru> References: <99f9547c43312c49e557b5e67a356a76cc6b2ad7.1748091536.git.sarg@sarg.org.ru> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/networking.scm (wpa-supplicant-configuration): [requirement]: Deprecate, [shepherd-requirement]: New field, [shepherd-provision]: Extract to a field. Add 'wireless-daemon to it. * doc/guix.texi (Networking Setup): Document it. Change-Id: Icc6fdd695e6e96ef168a085524989da639f77cd3 --- doc/guix.texi | 5 +++- gnu/services/networking.scm | 52 ++++++++++++++++++++++++------------- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 502482b754..a3956172bc 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -22383,9 +22383,12 @@ Networking Setup @item @code{wpa-supplicant} (default: @code{wpa-supplicant}) The WPA Supplicant package to use. -@item @code{requirement} (default: @code{'(user-processes loopback syslogd)} +@item @code{shepherd-requirement} (default: @code{(user-processes loopback syslogd)} List of services that should be started before WPA Supplicant starts. +@item @code{shepherd-provision} (default: @code{(wpa-supplicant wireless-daemon)}) (type: list-of-symbols) +The name(s) of the service. + @item @code{dbus?} (default: @code{#t}) Whether to listen for requests on D-Bus. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 4cb7313808..582c0edd32 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -226,6 +226,8 @@ (define-module (gnu services networking) wpa-supplicant-configuration? wpa-supplicant-configuration-wpa-supplicant wpa-supplicant-configuration-requirement + wpa-supplicant-configuration-shepherd-requirement + wpa-supplicant-configuration-shepherd-provision wpa-supplicant-configuration-pid-file wpa-supplicant-configuration-dbus? wpa-supplicant-configuration-interface @@ -2022,34 +2024,48 @@ (define usb-modeswitch-service-type ;;; WPA supplicant ;;; +(define-with-syntax-properties (warn-deprecated-wpa-supplicant-requirement + (value properties)) + (unless (unspecified? value) + (warning (source-properties->location properties) + (G_ "the 'requirement' field is deprecated, please use \ +'shepherd-requirement' field instead~%"))) + value) + (define-record-type* wpa-supplicant-configuration make-wpa-supplicant-configuration wpa-supplicant-configuration? - (wpa-supplicant wpa-supplicant-configuration-wpa-supplicant ;file-like - (default wpa-supplicant)) - (requirement wpa-supplicant-configuration-requirement ;list of symbols - (default '(user-processes loopback syslogd))) - (pid-file wpa-supplicant-configuration-pid-file ;string - (default "/var/run/wpa_supplicant.pid")) - (dbus? wpa-supplicant-configuration-dbus? ;Boolean - (default #t)) - (interface wpa-supplicant-configuration-interface ;#f | string - (default #f)) - (config-file wpa-supplicant-configuration-config-file ;#f | - (default #f)) - (extra-options wpa-supplicant-configuration-extra-options ;list of strings - (default '()))) + (wpa-supplicant wpa-supplicant-configuration-wpa-supplicant ;file-like + (default wpa-supplicant)) + (requirement wpa-supplicant-configuration-requirement ;list of symbols + (sanitize warn-deprecated-wpa-supplicant-requirement) + (default *unspecified*)) + (pid-file wpa-supplicant-configuration-pid-file ;string + (default "/var/run/wpa_supplicant.pid")) + (dbus? wpa-supplicant-configuration-dbus? ;Boolean + (default #t)) + (interface wpa-supplicant-configuration-interface ;#f | string + (default #f)) + (config-file wpa-supplicant-configuration-config-file ;#f | + (default #f)) + (extra-options wpa-supplicant-configuration-extra-options ;list of strings + (default '())) + (shepherd-provision wpa-supplicant-configuration-shepherd-provision ;list of symbols + (default '(wpa-supplicant wireless-daemon))) + (shepherd-requirement wpa-supplicant-configuration-shepherd-requirement ;list of symbols + (default '(user-processes loopback syslogd)))) (define (wpa-supplicant-shepherd-service config) (match-record config (wpa-supplicant requirement pid-file dbus? + shepherd-requirement shepherd-provision interface config-file extra-options) (list (shepherd-service (documentation "Run the WPA supplicant daemon") - (provision '(wpa-supplicant)) - (requirement (if dbus? - (cons 'dbus-system requirement) - requirement)) + (provision shepherd-provision) + (requirement `(,@(if dbus? '(dbus-system) '()) + ,@(or (if (unspecified? requirement) #f requirement) + shepherd-requirement))) (start #~(make-forkexec-constructor (list (string-append #$wpa-supplicant "/sbin/wpa_supplicant") From patchwork Sat May 24 13:01:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 42898 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D310E27BC4D; Sat, 24 May 2025 14:03:32 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 70AE427BC49 for ; Sat, 24 May 2025 14:03:32 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uIoWp-0005pc-1p; Sat, 24 May 2025 09:03:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uIoWm-0005oZ-IY for guix-patches@gnu.org; Sat, 24 May 2025 09:03:04 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIoWl-0005Eu-MZ; Sat, 24 May 2025 09:03:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=mMFG6j+rZz6lJvX7uvOzNIWYz9EJ27TouhVujx5bIt0=; b=UpRFeI6mU5exwoMJUl4oui4moy5ZHNg2RvzErHPvE6AuEvi5EZ1fjotjGUNEIMZ/tHjXrhnpI1kXd4n2d1po+ZPIx/l1vBYOX/SqSM40yQNrhw465H0vg287qz2aeOUOt5QkBZR0XFO2f5C8OeR1dnuBDvAhChbcKiXuk39nhzHo3BZnTyNSV3lzAbq8b9Otpe2rM/H9SELRRLD0YlF13xtgDV17LFfjaEEqhtjkTimzcPStTmZMh/9P1+CXz8zqVRxWWx3G3+A/oL0hMhE53B1XP+xhGMrYEQ4ojpRHWMIf5l5FG1J73iyzcYZmzRy9k/3NX3QOkjdsM1H5jhlJ5w==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uIoWk-0004qT-Sc; Sat, 24 May 2025 09:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78546] [PATCH v2 4/5] services: network-manager: Require wireless-daemon. Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: sarg@sarg.org.ru, ludo@gnu.org, gabriel@erlikon.ch, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 24 May 2025 13:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78546 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78546@debbugs.gnu.org Cc: Sergey Trofimov , Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Gabriel Wicki , Maxim Cournoyer X-Debbugs-Original-Xcc: Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Gabriel Wicki , Maxim Cournoyer Received: via spool by 78546-submit@debbugs.gnu.org id=B78546.174809172618432 (code B ref 78546); Sat, 24 May 2025 13:03:02 +0000 Received: (at 78546) by debbugs.gnu.org; 24 May 2025 13:02:06 +0000 Received: from localhost ([127.0.0.1]:58889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIoVp-0004n8-Lh for submit@debbugs.gnu.org; Sat, 24 May 2025 09:02:06 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:61889) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uIoVk-0004lM-6o for 78546@debbugs.gnu.org; Sat, 24 May 2025 09:02:00 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-ad52dfe06ceso81063766b.3 for <78546@debbugs.gnu.org>; Sat, 24 May 2025 06:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1748091714; x=1748696514; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mMFG6j+rZz6lJvX7uvOzNIWYz9EJ27TouhVujx5bIt0=; b=cT5SKzC4d9RU78GmflQDfWQ0lLrTf3GU1hVDAQtYBtL6gH2Hpbn/aORTQvwQwEDZRK Pj6cHIqO1YbI8sv4TB2SzlXkNvg/p00UoewLSTG/mFW6NVhFGGbZQZVLkbrNGFN4yufH lOT1e3Uq/rnV0CGV76H0hSLAt3Ohl9XiMHge55dDN3wZmhc3f3MbjoWocKmJ9uBegAYR 3haer5ZRVZ6H0eT/BXomvgBzkVOkFIvCaIpE2qfM63at1f+ItdHq/HAS0Trd2Mkmzl9O 97fqsPMieLGixw+Gk+2DTgegvLFZaTxuxdrsg49Z95pRvQm+iP7VvU3MD82ioKVrHq5Z Z67w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748091714; x=1748696514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mMFG6j+rZz6lJvX7uvOzNIWYz9EJ27TouhVujx5bIt0=; b=GquFQ2xK2iy+5Mhx0a1MbjJIPMMBioPBo9lud3GnObZioPibmXx94wnbzxoiKODat2 sr3kWgAEIdtFxEhcx1JmElrSMQL2kzKE8RhIJEbY8P2AWi8zWPlrMpzISwFZPJkuJlm8 WjMoHjW83GAzcZhh0Jkm1X5cZIIzy3cB2OBh0laQgAOwQuu/+xa6y/gWhknnsoUMaSD1 sj0Jsk1VMgybcVhgoxybTGCbNBlz5Ft8McN0d24h3Q1abO/6OOK4EHLPXEwUNjN9P0qv KREgDGFT/IHMoroRwUncEzYrpFipW0k03njhADtji9eMcz9fxIq97SBEZyHyNT6pdJIv J4Vw== X-Gm-Message-State: AOJu0YxBDaB0co8cCyS4CEyxFI7lNDn1/MVF7WyLeFfq1tePr2uBsEzo ssHg1lz9avWo0iV50T9e4G2x/ix1ACBSrZ1idvEHU0MC338JZJ37Siz2ONuTvZqJ/bgpX+4bK0+ 47vwcy0PF6Q== X-Gm-Gg: ASbGncsRKKWfjySYJyhZ2jZlTRFJgDNtgq/5DBB1q7XkQUdM2q6eJQZAzHqhtaMGRPR xYRJFFhNvHF22j1pN48bGHASv42UmqtEJl6fWYG62p0klGLSR/0n/kHgPxyexWoDl2weySFK+xE t/GjlF2vaYHBRfqHcK/iJhSr5FNygQF159iM99rJhcmmVUG4Z3i5gRetNVj6LTdTO0UPNeJsCwQ NPSoNLUQa+BOc5LG/s9JEVMSor4xP3wpDjd2xJeQZIP6PQXIsDTwlRcVodshK8AnJ4Z0lZVQGVM +aHbLzUtpPW7vEeHvNhVnSGIbtfM5N/RpedL4T0xO8LNn0Lm X-Google-Smtp-Source: AGHT+IE36sFlxrQf0q0kKBS54R2DXi0GDAPR0dZ6Xa135HhDuIpvONoS3E5cjAfkKuAXhO6TOQqJkw== X-Received: by 2002:a17:907:8dcb:b0:ad2:5499:7599 with SMTP id a640c23a62f3a-ad85b0d2777mr221450866b.18.1748091713644; Sat, 24 May 2025 06:01:53 -0700 (PDT) Received: from localhost ([2a02:2454:a095:5600:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad52d4466e2sm1407423366b.93.2025.05.24.06.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 May 2025 06:01:53 -0700 (PDT) From: Sergey Trofimov Date: Sat, 24 May 2025 15:01:31 +0200 Message-ID: <70e373df86451559144b1399fb392ee39066048e.1748091536.git.sarg@sarg.org.ru> X-Mailer: git-send-email 2.49.0 In-Reply-To: <99f9547c43312c49e557b5e67a356a76cc6b2ad7.1748091536.git.sarg@sarg.org.ru> References: <99f9547c43312c49e557b5e67a356a76cc6b2ad7.1748091536.git.sarg@sarg.org.ru> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/networking.scm ()[shepherd-requirement]: Replace wpa-supplicant with wireless-daemon. * doc/guix.texi (Networking Setup): Adjust. Change-Id: Id1a51429ccb6ea24839fc2aacd051a3ffe91c33c --- doc/guix.texi | 11 ++++++----- gnu/services/networking.scm | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a3956172bc..a9c815c35c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -22047,11 +22047,12 @@ Networking Setup @item @code{network-manager} (default: @code{network-manager}) The NetworkManager package to use. -@item @code{shepherd-requirement} (default: @code{'(wpa-supplicant)}) -This option can be used to provide a list of symbols naming Shepherd services -that this service will depend on, such as @code{'wpa-supplicant} or -@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet -networks. +@item @code{shepherd-requirement} (default: @code{'(wireless-daemon)}) +This option can be used to provide a list of symbols naming Shepherd +services that this service will depend on. The default @code{'wireless-daemon} +is provided by @code{'wpa-supplicant-service-type} and @code{'iwd-service-type}. +Make sure you have one of these configured. Note, that @code{%desktop-services} +already include @code{wpa-supplicant-service-type}. @item @code{dns} (default: @code{"default"}) Processing mode for DNS, which affects how NetworkManager uses the diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 582c0edd32..900790ef2d 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1417,7 +1417,7 @@ (define-record-type* (network-manager network-manager-configuration-network-manager (default network-manager)) (shepherd-requirement network-manager-configuration-shepherd-requirement - (default '(wpa-supplicant))) + (default '(wireless-daemon))) (dns network-manager-configuration-dns (default "default")) (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like From patchwork Sat May 24 13:01:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 42897 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A88C627BC4C; Sat, 24 May 2025 14:03:31 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9CE6A27BC49 for ; Sat, 24 May 2025 14:03:30 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uIoWp-0005pi-Af; Sat, 24 May 2025 09:03:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uIoWn-0005oq-4P for guix-patches@gnu.org; Sat, 24 May 2025 09:03:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIoWm-0005F8-Kd; Sat, 24 May 2025 09:03:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=GC00tEGbPfC7O13DM+4b3y+0C25XfAD6Ts6iaMwEZI8=; b=YmGfxrc76KGgwiT01u8z1fCJKpS3Q8xnY0QxPC7xxvNEFdWjnYLAk47m3Kh6ZTLPVCBhqSoATNaFBPuFwoz1lmYMCKqiwv63QD4hTaBV0iiKeeLOUz7DTlQThGGm4G+3ryfq+rtrgoIhOa1DV0CE6jupCppoYCi7unAdechpedBThPwRhexpJunhFpd+X3dTfOcsXnnOqXfWsdywxFEDG0JEgWNWg0dWGyxr2zOynAjWpBaV2XbqowDCjF4pML4c5y1gRdoYB+RrL4eSvKCZlF1C1uUHxtnD1NDx/dbJQtji4weU2nCQ8y0b6ODSsLGwSWWqxFJMF1WmXaVeauPpfw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uIoWl-0004qc-Dw; Sat, 24 May 2025 09:03:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78546] [PATCH v2 5/5] services: networking: Add iwd-service-type. Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: sarg@sarg.org.ru, ludo@gnu.org, gabriel@erlikon.ch, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 24 May 2025 13:03:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78546 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78546@debbugs.gnu.org Cc: Sergey Trofimov , Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Gabriel Wicki , Maxim Cournoyer X-Debbugs-Original-Xcc: Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Gabriel Wicki , Maxim Cournoyer Received: via spool by 78546-submit@debbugs.gnu.org id=B78546.174809172718441 (code B ref 78546); Sat, 24 May 2025 13:03:03 +0000 Received: (at 78546) by debbugs.gnu.org; 24 May 2025 13:02:07 +0000 Received: from localhost ([127.0.0.1]:58891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIoVq-0004nF-36 for submit@debbugs.gnu.org; Sat, 24 May 2025 09:02:07 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:42337) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uIoVm-0004lb-Gw for 78546@debbugs.gnu.org; Sat, 24 May 2025 09:02:03 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-602c4eae8d5so1411184a12.1 for <78546@debbugs.gnu.org>; Sat, 24 May 2025 06:02:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1748091716; x=1748696516; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GC00tEGbPfC7O13DM+4b3y+0C25XfAD6Ts6iaMwEZI8=; b=q8cu5nuqH2UbZBOYH1Is+VhQsP/Y4rxVXp6+tliQGuDO+RaYXnvWA26Ml9+92994Nz /CI0gNsicpapwncN2gKapJXfZfLFP0+7e3coCqZ3JV4ZWHakdNqXcmBOulhmwjArYTJR 97TEAxGy6zZiq+qi+9puZ4BilVHIs4ELZt7rV4nNiHEtmpMLsVBTiL9Ok5T01fOy0n8r 3HA+jxzc0oDEJHHTNUDlx2yRYS+pTS6h0Uh13O+LX88BfP8jU+KM+7A7yWhub5/CrOzK /xb1OWcyOGrUTu49KMSWKKvemMoJsIusTylZEt12KVWXC71GqaU12e/6betIy/O0jBmR O0NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748091716; x=1748696516; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GC00tEGbPfC7O13DM+4b3y+0C25XfAD6Ts6iaMwEZI8=; b=OgV9xV+u9i0Hx+XSDrPVGmz4J/j/Y84OrQtxBSEATRWXXTyTzX/LdSTq7NNJaNwIai PObkfWVNZBqiHuvJfwelP+S0JBw4y8l3g61vk0xw/CDUO0F21pRS/d1B+WNlitn49TfB I8hZOg2ELE10dpupMcsBSXYAm6hoyRJKKw4+liuApBhYwEz7nPtzb2aQj4gmIOrfQ/04 M5AhZOpgPZ+51dX0USeSUkIZSnOCejR6vJUGHz1G3HYZ2Xs+GUU+Y7ANk60zLwNF2sCw oTcdxU+LTzFtHMEm2qrYzKOUjm2WGbcByyR5JRo9WmpxBogrMSPOvwGdBq9O777EQLm8 dR+w== X-Gm-Message-State: AOJu0YwLhusIcQLE8F4q4DjFwDeeYK+fXubGXKnfbfA8bdDczPHUq3u+ 4KMpsGbt35HQaI7toQfwUIkBnNTHKGJbMnk532trVGiwKBCWcOCNiMwsiehjuCpym7inEJ2Shju Kltnsgn2jYw== X-Gm-Gg: ASbGncsQLeZa+lvHLtBGU/kb88iyTUAZyju3mHrxEkej+xtGwAhWr9CmP9LIk3XbwRb g+Y5l6JkjTYT+ozIG8k7WZ/+9HLi3ITD0WMikzMmJT92tHQU74Bio6+284ZJVsfAVTA4XhmxCU8 6hzd2Qu45yV694/ag1LiCmJEjkgS7nA2y8H0pD8UM3rj8UeIBdX1SqHhoa7Rw2SSTYxzm+zSQrb hHF6wFoJTkSPW1bKe2Vmu7/rIvA6gIjkJA769ZlFF/OUFhV7vlLblwXWpu7ixcxqyKtgAVOVshB wSbwlBRR7NKOl/lwiotOtRNQEfg7BJF3JlonopHZT1p78A3q X-Google-Smtp-Source: AGHT+IHEQRObocb0ecrTqpFwc0iSakWV2+1e24XE2zQUacRF7DusUkO47nlYFV/5b+r2sd9aKweW4g== X-Received: by 2002:a05:6402:26d6:b0:601:a16e:4827 with SMTP id 4fb4d7f45d1cf-6028d6fe38bmr5654652a12.3.1748091715933; Sat, 24 May 2025 06:01:55 -0700 (PDT) Received: from localhost ([2a02:2454:a095:5600:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6005a6e746csm13683424a12.47.2025.05.24.06.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 May 2025 06:01:55 -0700 (PDT) From: Sergey Trofimov Date: Sat, 24 May 2025 15:01:32 +0200 Message-ID: <2712aa81a808916cd2ef13e22222214adf9e1322.1748091536.git.sarg@sarg.org.ru> X-Mailer: git-send-email 2.49.0 In-Reply-To: <99f9547c43312c49e557b5e67a356a76cc6b2ad7.1748091536.git.sarg@sarg.org.ru> References: <99f9547c43312c49e557b5e67a356a76cc6b2ad7.1748091536.git.sarg@sarg.org.ru> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/networking.scm (iwd-service-type): New service type. (iwd-configuration), (iwd-settings), (iwd-scan-settings), (iwd-general-settings), (iwd-network-settings): New configuration types. * doc/guix.texi (Networking setup): Document it. Change-Id: I852115b9c6768b3ec4eedb34a7f9e66438bd1429 --- doc/guix.texi | 162 +++++++++++++++++++++++ gnu/services/networking.scm | 249 ++++++++++++++++++++++++++++++++++++ 2 files changed, 411 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index a9c815c35c..4d1b6372df 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -22408,6 +22408,168 @@ Networking Setup @end table @end deftp +@cindex IWD +@defvar iwd-service-type +This is the service type to run @acronyml{IWD,Internet Wireless Daemon}, +a wireless daemon required to authenticate against encrypted WiFi +networks. +@end defvar + +@quotation Warning +By default @code{iwd} removes and re-creates interfaces it manages. It +doesn't play nicely with @code{dhcp-client-service-type} that enumerates +wireless interfaces before starting the Shepherd service. Use either +@code{dhcpcd-service-type} or the @code{iwd}'s built-in DHCP client (see +@code{enable-network-configuration} option below). +@end quotation + +@quotation Warning +@code{iwd-service-type} conflicts with @code{wpa-supplicant-service-type}. +Make sure only one is configured. +@end quotation + +@c %start of fragment + +@deftp {Data Type} iwd-configuration +Available @code{iwd-configuration} fields are: + +@table @asis +@item @code{iwd} (default: @code{iwd}) (type: file-like) +The IWD package to use. + +@item @code{interfaces} (default: @code{()}) (type: list-of-strings) +If this is set, it must specify @dfn{glob patterns} matching network +interfaces that IWD will control. + +@item @code{ignored-interfaces} (default: @code{()}) (type: list-of-strings) +If this is set, it must specify @dfn{glob patterns} matching network +interfaces that IWD will not manage. + +@item @code{phys} (default: @code{()}) (type: list-of-strings) +If this is set, it must specify @dfn{glob patterns} matching network +PHYs names that IWD will control. + +@item @code{ignored-phys} (default: @code{()}) (type: list-of-strings) +If this is set, it must specify @dfn{glob patterns} matching network +PHYs names that IWD will not manage. + +@item @code{shepherd-requirement} (default: @code{()}) (type: list-of-symbols) +Shepherd requirements the service should depend on. + +@item @code{shepherd-provision} (default: @code{(iwd wireless-daemon)}) (type: list-of-symbols) +The name(s) of the service. + +@item @code{config} (type: iwd-settings) +Configuration settings. + +@end table + +@end deftp + + +@c %end of fragment + +@c %start of fragment + +@deftp {Data Type} iwd-settings +Available @code{iwd-settings} fields are: + +@table @asis +@item @code{general} (type: iwd-general-settings) +General settings. + +@item @code{network} (type: maybe-iwd-network-settings) +Network settings. + +@item @code{scan} (type: maybe-iwd-scan-settings) +Scan settings. + +@item @code{extra-config} (default: @code{()}) (type: list-of-strings) +Extra configuration values to append to the IWD configuration file. + +@end table + +@end deftp + + +@c %end of fragment + +@c %start of fragment + +@deftp {Data Type} iwd-general-settings +Available @code{iwd-general-settings} fields are: + +@table @asis +@item @code{enable-network-configuration?} (default: @code{#f}) (type: boolean) +Setting this option to true enables @code{iwd} to configure the network +interfaces with the IP addresses. + +@item @code{extra-options} (default: @code{()}) (type: alist) +An association list of option symbols/strings to string values to be +appended to the General settings group. + +@end table + +@end deftp + + +@c %end of fragment + +@c %start of fragment + +@deftp {Data Type} iwd-network-settings +Available @code{iwd-network-settings} fields are: + +@table @asis +@item @code{enable-ipv6?} (default: @code{#t}) (type: boolean) +Sets the global default that tells @code{iwd} whether it should +configure IPv6 addresses and routes + +@item @code{name-resolving-service} (default: @code{none}) (type: resolving-service) +Configures a DNS resolution method used by the system. + +@item @code{extra-options} (default: @code{()}) (type: alist) +An association list of option symbols/strings to string values to be +appended to the Network settings group. + +@end table + +@end deftp + + +@c %end of fragment + +@c %start of fragment + +@deftp {Data Type} iwd-scan-settings +Available @code{iwd-scan-settings} fields are: + +@table @asis +@item @code{disable-periodic-scan?} (default: @code{#f}) (type: boolean) +Setting this option to @code{#t} will prevent @code{iwd} from issuing +the periodic scans for the available networks while disconnected. + +@item @code{initial-periodic-scan-interval} (default: @code{10}) (type: number) +The initial periodic scan interval upon disconnect (in seconds). + +@item @code{maximum-periodic-scan-interval} (default: @code{300}) (type: number) +The maximum periodic scan interval (in seconds). + +@item @code{disable-roaming-scan?} (default: @code{#f}) (type: boolean) +Setting this option to @code{#t} will prevent @code{iwd} from trying to +scan when roaming decisions are activated. + +@item @code{extra-options} (default: @code{()}) (type: alist) +An association list of option symbols/strings to string values to be +appended to the Scan settings group. + +@end table + +@end deftp + + +@c %end of fragment + @cindex ModemManager Some networking devices such as modems require special care, and this is what the services below focus on. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 900790ef2d..0a114d2a18 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -41,6 +41,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu services networking) + #:use-module (gnu home services utils) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services configuration) @@ -56,6 +57,7 @@ (define-module (gnu services networking) #:use-module (gnu packages bash) #:use-module (gnu packages cluster) #:use-module (gnu packages connman) + #:use-module (gnu packages dns) #:use-module (gnu packages freedesktop) #:use-module (gnu packages linux) #:use-module (gnu packages tor) @@ -80,6 +82,7 @@ (define-module (gnu services networking) #:use-module (srfi srfi-9) #:use-module (srfi srfi-26) #:use-module (srfi srfi-43) + #:use-module ((ice-9 curried-definitions) #:select (define)) #:use-module (ice-9 match) #:use-module (ice-9 string-fun) #:use-module (json) @@ -235,6 +238,21 @@ (define-module (gnu services networking) wpa-supplicant-configuration-extra-options wpa-supplicant-service-type + iwd-configuration + iwd-configuration-config + iwd-configuration-ignored-interfaces + iwd-configuration-ignored-phys + iwd-configuration-interfaces + iwd-configuration-iwd + iwd-configuration-phys + iwd-configuration-shepherd-provision + iwd-configuration-shepherd-requirement + iwd-service-type + iwd-general-settings + iwd-network-settings + iwd-scan-settings + iwd-settings + hostapd-configuration hostapd-configuration? hostapd-configuration-package @@ -2099,6 +2117,237 @@ (define wpa-supplicant-service-type implements authentication, key negotiation and more for wireless networks.") (default-value (wpa-supplicant-configuration))))) + +;;; +;;; IWD +;;; +(define (iwd-uglify-field-name name) + (object->camel-case-string name 'upper)) + +(define (iwd-serialize-base field-name val) + (format #f "~a=~a\n" field-name val)) + +(define (iwd-serialize-field field-name val) + (iwd-serialize-base (iwd-uglify-field-name field-name) val)) + +(define iwd-serialize-number iwd-serialize-field) + +(define (iwd-serialize-boolean field-name value) + (iwd-serialize-field + (string-trim-right (symbol->string field-name) #\?) + (if value "true" "false"))) + +(define (iwd-serialize-alist field-name value) + (if (null? value) + "" + #~(string-append #$@(generic-serialize-alist list + iwd-serialize-base + value)))) + +(define-enumerated-field-type resolving-service + (none systemd resolvconf) + (prefix iwd-)) + +(define-configuration iwd-general-settings + (enable-network-configuration? + (boolean #f) + "Setting this option to true enables @code{iwd} to configure the network +interfaces with the IP addresses.") + (extra-options + (alist '()) + "An association list of option symbols/strings to string values to be +appended to the General settings group.") + + (prefix iwd-)) + +(define-configuration iwd-network-settings + (enable-ipv6? + (boolean #t) + "Sets the global default that tells @code{iwd} whether it should configure +IPv6 addresses and routes") + + (name-resolving-service + (resolving-service 'none) + "Configures a DNS resolution method used by the system.") + + (extra-options + (alist '()) + "An association list of option symbols/strings to string values to be +appended to the Network settings group.") + + (prefix iwd-)) + +(define-configuration iwd-scan-settings + (disable-periodic-scan? + (boolean #f) + "Setting this option to @code{#t} will prevent @code{iwd} from issuing the +periodic scans for the available networks while disconnected.") + + (initial-periodic-scan-interval + (number 10) + "The initial periodic scan interval upon disconnect (in seconds).") + + (maximum-periodic-scan-interval + (number 300) + "The maximum periodic scan interval (in seconds).") + + (disable-roaming-scan? + (boolean #f) + "Setting this option to @code{#t} will prevent @code{iwd} from trying to scan +when roaming decisions are activated.") + + (extra-options + (alist '()) + "An association list of option symbols/strings to string values to be +appended to the Scan settings group.") + + (prefix iwd-)) + +(define-maybe iwd-network-settings) +(define-maybe iwd-scan-settings) + +(define ((iwd-serialize-config-section fields) name cfg) + #~(format #f "[~a]\n~a\n" + #$(string-upcase (object->string name) 0 1) + #$(serialize-configuration cfg fields))) + +(define serialize-iwd-network-settings + (iwd-serialize-config-section iwd-network-settings-fields)) + +(define serialize-iwd-scan-settings + (iwd-serialize-config-section iwd-scan-settings-fields)) + +(define serialize-iwd-general-settings + (iwd-serialize-config-section iwd-general-settings-fields)) + +(define-configuration iwd-settings + (general + (iwd-general-settings (iwd-general-settings)) + "General settings.") + + (network + maybe-iwd-network-settings + "Network settings.") + + (scan + maybe-iwd-scan-settings + "Scan settings.") + + (extra-config + (list-of-strings '()) + "Extra configuration values to append to the IWD configuration file." + (serializer (lambda (_ value) (string-join value "\n" 'suffix))))) + +(define-configuration/no-serialization iwd-configuration + (iwd + (file-like iwd) + "The IWD package to use.") + + (interfaces + (list-of-strings '()) + "If this is set, it must specify @dfn{glob patterns} matching network +interfaces that IWD will control.") + + (ignored-interfaces + (list-of-strings '()) + "If this is set, it must specify @dfn{glob patterns} matching network +interfaces that IWD will not manage.") + + (phys + (list-of-strings '()) + "If this is set, it must specify @dfn{glob patterns} matching network +PHYs names that IWD will control.") + + (ignored-phys + (list-of-strings '()) + "If this is set, it must specify @dfn{glob patterns} matching network +PHYs names that IWD will not manage.") + + (shepherd-requirement + (list-of-symbols '()) + "Shepherd requirements the service should depend on.") + + (shepherd-provision + (list-of-symbols '(iwd wireless-daemon)) + "The name(s) of the service.") + + (config + (iwd-settings (iwd-settings)) + "Configuration settings.")) + +(define (iwd-generate-documentation) + (configuration->documentation 'iwd-configuration) + (configuration->documentation 'iwd-settings) + (configuration->documentation 'iwd-general-settings) + (configuration->documentation 'iwd-network-settings) + (configuration->documentation 'iwd-scan-settings)) + +(define (iwd-config-file config) + "Return an IWD configuration file." + (mixed-text-file "main.conf" + (serialize-configuration + (iwd-configuration-config config) + iwd-settings-fields))) + +(define (iwd-environment config) + (let ((resolver + (and=> (iwd-settings-network (iwd-configuration-config config)) + iwd-network-settings-name-resolving-service))) + + (if (eq? resolver 'resolvconf) + #~(list (string-append "PATH=" #$openresolv "/sbin")) + '()))) + +(define (iwd-shepherd-service config) + (match-record config + (iwd interfaces ignored-interfaces + phys ignored-phys + shepherd-requirement shepherd-provision) + + (list (shepherd-service + (documentation "Run Internet Wireless Daemon") + (provision shepherd-provision) + (requirement `(user-processes dbus-system loopback ,@shepherd-requirement)) + (start #~(make-forkexec-constructor + (list (string-append #$iwd "/libexec/iwd") + "--logger=syslog" + #$@(if (null? interfaces) '() + (list (string-append "--interfaces=" + (string-join interfaces ",")))) + #$@(if (null? ignored-interfaces) '() + (list (string-append "--nointerfaces=" + (string-join ignored-interfaces ",")))) + #$@(if (null? phys) '() + (list (string-append "--phys=" + (string-join phys ",")))) + #$@(if (null? ignored-phys) '() + (list (string-append "--nophys=" + (string-join ignored-phys ","))))) + + #:environment-variables + #$(iwd-environment config))) + (stop #~(make-kill-destructor)))))) + +(define (iwd-etc-service config) + `(("iwd/main.conf" ,(iwd-config-file config)))) + +(define iwd-service-type + (let ((add-iwd-package (compose list iwd-configuration-iwd))) + (service-type (name 'iwd) + (extensions + (list (service-extension shepherd-root-service-type + iwd-shepherd-service) + (service-extension etc-service-type + iwd-etc-service) + (service-extension dbus-root-service-type + add-iwd-package) + (service-extension profile-service-type + add-iwd-package))) + (default-value (iwd-configuration)) + (description + "Run @url{https://iwd.wiki.kernel.org/,Iwd}, +a network connection manager.")))) + ;;; ;;; Hostapd.