unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Florian Pelz <pelzflorian@pelzflorian.de>
To: 36294@debbugs.gnu.org
Subject: [bug#36294] [PATCH 2/3] Have NetworkManager create '/var/lib/misc' directory required by dnsmasq.
Date: Wed, 19 Jun 2019 18:09:01 +0200	[thread overview]
Message-ID: <20190619160900.tduqs73f7jkz3lkn@pelzflorian.localdomain> (raw)
In-Reply-To: <20190619160557.hkxkioufw2ybpgml@pelzflorian.localdomain>

* gnu/services/networking.scm (%network-manager-activation): Rename to...
(network-manager-activation): ... this and make it a procedure.  Make it
create '/var/lib/misc' when using dnsmasq.
(network-manager-service-type): Use it.
---
 gnu/services/networking.scm | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 73acb3b17f..13cffd9feb 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -895,11 +895,17 @@ and @command{wicd-curses} user interfaces."
   (vpn-plugins network-manager-vpn-plugins        ;list of <package>
                (default '())))
 
-(define %network-manager-activation
-  ;; Activation gexp for NetworkManager.
-  #~(begin
-      (use-modules (guix build utils))
-      (mkdir-p "/etc/NetworkManager/system-connections")))
+(define network-manager-activation
+  ;; Activation gexp for NetworkManager
+  (match-lambda
+    (($ <network-manager-configuration> network-manager dns vpn-plugins)
+     #~(begin
+         (use-modules (guix build utils))
+         (mkdir-p "/etc/NetworkManager/system-connections")
+         #$@(if (equal? dns "dnsmasq")
+                ;; create directory to store dnsmasq lease file
+                '((mkdir-p "/var/lib/misc"))
+                '())))))
 
 (define (vpn-plugin-directory plugins)
   "Return a directory containing PLUGINS, the NM VPN plugins."
@@ -949,7 +955,7 @@ and @command{wicd-curses} user interfaces."
             (service-extension dbus-root-service-type config->package)
             (service-extension polkit-service-type config->package)
             (service-extension activation-service-type
-                               (const %network-manager-activation))
+                               network-manager-activation)
             (service-extension session-environment-service-type
                                network-manager-environment)
             ;; Add network-manager to the system profile.
-- 
2.22.0

  parent reply	other threads:[~2019-06-19 16:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 16:05 [bug#36294] [PATCH 0/3] Fix and document NetworkManager + dnsmasq pelzflorian (Florian Pelz)
2019-06-19 16:08 ` [bug#36294] [PATCH 1/3] Use new upstream nomenclature in documentation of NetworkManager’s dnsmasq Florian Pelz
2019-06-19 16:09 ` Florian Pelz [this message]
2019-06-19 16:09 ` [bug#36294] [PATCH 3/3] Document use cases for NetworkManager with dnsmasq Florian Pelz
2019-06-24 21:26   ` bug#36294: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190619160900.tduqs73f7jkz3lkn@pelzflorian.localdomain \
    --to=pelzflorian@pelzflorian.de \
    --cc=36294@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).