Change:
let cfg = config.networking.networkmanager; <del> stateDirs = "/var/lib/NetworkManager /var/lib/dhclient"; </del> <ins> # /var/lib/misc is for dnsmasq.leases. stateDirs = "/var/lib/NetworkManager /var/lib/dhclient /var/lib/misc"; </ins> configFile = writeText "NetworkManager.conf" '' [main]

Discussion:
It seems that I cannot share a connection through NetworkManager due to the following error: start_sharing(): (enp0s10/enp0s10): failed to start dnsmasq: Could not find dnsmasq binary. I have tried to make an overrideDerivation for pkgs.networkmanager, adding to configureFlags, after the original flags, the following one: "--with-dnsmasq=${dnsmasq}/bin/dnsmasq" but I still get the same message & result. What can I do to make NetworkManager find the required binary ? Thanks.
Can you make it work from the command line? You have to figure out why nm isn't finding dnsmasq. Try running it with strace, looking at fstat or open() calls. On Tue, Apr 28, 2015, 1:54 AM Stroe Dan Ștefan wrote:
I have attached to NetworkManager pid, and here is the path it looks for dnsmasq binary: 1347 open("/var/run/nm-dnsmasq-", ORDONLY|OLARGEFILE) = -1 ENOENT (No such file or directory) 1347 access("/usr/local/sbin/dnsmasq", FOK) = -1 ENOENT (No such file or directory) 1347 access("/usr/sbin/dnsmasq", FOK) = -1 ENOENT (No such file or directory) 1347 access("/sbin/dnsmasq", F_OK) = -1 ENOENT (No such file or directory) but dnmasq can be found at: /run/current-system/sw/bin/dnsmasq I'll try with: "--with-dnsmasq=/run/current-system/sw/bin/dnsmasq" and post results. Regards.

Theese were the results ... I was allready with a config like: ( pkgs.networkmanager (attrs: { configureFlags = [ "--with-distro=exherbo" "--with-dhclient=${dhcp}/sbin/dhclient" # Upstream prefers dhclient, so don't add dhcpcd to the closure #"--with-dhcpcd=${dhcpcd}/sbin/dhcpcd" "--with-dhcpcd=no" "--with-iptables=${iptables}/sbin/iptables" "--with-udev-dir=${out}/lib/udev" "--with-resolvconf=${openresolv}/sbin/resolvconf" "--sysconfdir=/etc" "--localstatedir=/var" "--with-dbus-sys-dir=${out}/etc/dbus-1/system.d" "--with-crypto=gnutls" "--disable-more-warnings" "--with-systemdsystemunitdir=$(out)/etc/systemd/system" "--with-kernel-firmware-dir=/run/current-system/firmware" "--with-session-tracking=systemd" "--with-modem-manager-1" "--with-dnsmasq=/run/current-system/sw/bin/dnsmasq" ]; })) I should try something like individually building the networkmanager package. I should read more about it atm ... Regards
I'm confused, does it work now? It's obviously not looking for dnsmasq where it should. It should use a path in the nix store.

More tests with new version 0.9.8.10 and configuration: ( pkgs.networkmanager (attrs: { configureFlags = [ "--with-distro=exherbo" "--with-dhclient=${dhcp}/sbin/dhclient" # Upstream prefers dhclient, so don't add dhcpcd to the closure #"--with-dhcpcd=${dhcpcd}/sbin/dhcpcd" "--with-dhcpcd=no" "--with-iptables=${iptables}/sbin/iptables" "--with-udev-dir=${out}/lib/udev" "--with-resolvconf=${openresolv}/sbin/resolvconf" "--sysconfdir=/etc" "--localstatedir=/var" "--with-dbus-sys-dir=${out}/etc/dbus-1/system.d" "--with-crypto=gnutls" "--disable-more-warnings" "--with-systemdsystemunitdir=$(out)/etc/systemd/system" "--with-kernel-firmware-dir=/run/current-system/firmware" "--with-session-tracking=systemd" "--with-modem-manager-1" "--with-dnsmasq=/run/current-system/sw/bin/dnsmasq" ]; })) with same result: 1351 open("/var/run/nm-dnsmasq-", ORDONLY|OLARGEFILE) = -1 ENOENT (No such file or directory) 1351 access("/usr/local/sbin/dnsmasq", FOK) = -1 ENOENT (No such file or directory) 1351 access("/usr/sbin/dnsmasq", FOK) = -1 ENOENT (No such file or directory) 1351 access("/sbin/dnsmasq", F_OK) = -1 ENOENT (No such file or directory) I need to do a debug build with a sepparate environment for test only. I am trying to read about how will I exactly do that.
If you look at your /nix/var/nix/log folder there are the build logs for everything. See if you can find the one you built and search for dnsmasq to see if it's actually trying to configure it. Could be a bug in NM... On Sat, May 2, 2015, 11:38 AM Stroe Dan Ștefan wrote: