Commit Graph

2534 Commits

Author SHA1 Message Date
Martin Weinelt
41eb076ed8 Merge pull request #127595 from rnhmjoj/wpa-auto
nixos/wireless: use udev to wait for interfaces
2021-08-12 00:49:33 +02:00
rnhmjoj
99e8af51b2 nixos/wireless: use udev to wait for interfaces
I may have finally found a clean solution to the issues[1][2][3] with
the automatic discovery of wireless network interfaces.

[1]: https://github.com/NixOS/nixpkgs/issues/101963
[2]: https://github.com/NixOS/nixpkgs/issues/23196
[3]: https://github.com/NixOS/nixpkgs/pull/125917#issuecomment-856000426

Currently the start script fails right away if no interface is available
by the time it's running, possibly leaving the system without network.
This happens when running a little early in the boot. A solution is to
instead wait for at least one interface to appear before scanning the
/sys/class/net/ directory. This is done here by listening for the right
udev events (from the net/wlan subsystem) using the `udevadm monitor`
command and grep to match its output.

This methods guarantees the availability of at least one interface to
wpa_supplicant, but won't add additional interfaces once it has started.
However, if the current interface is lost, say unplugged, the service is
automatically stopped and will be restarted as soon as a one (not
necessarily the same) is detected. It would be possible make this fully
dynamic by running another service that continously listen for udev
events and manages the main wpa_supplicant daemon, but this is probably
overkill.

I tested the following cases:

  - one interface, starting at boot, w/o predictable naming scheme
  - two interfaces, starting at boot (intel wireless and a usb adapter),
    w/o predictable naming scheme
  - one interface after the system booted, w/o predictable naming scheme
  - two interfaces after the system booted, w/o predictable naming scheme
  - unplugging and plugging back the current interface
2021-08-12 00:31:06 +02:00
Daniel Nagy
79a86e7ef5 treewide: Port type adaptations 2021-08-11 00:45:08 +02:00
Sandro
c9e66e9d45 Merge pull request #111442 from helsinki-systems/wakeonlan
nixos/wakeonlan: add types
2021-08-08 20:51:27 +02:00
Martin Weinelt
a5c6a0006a Merge pull request #130521 from Mic92/tinc
nixos/tinc: don't run as nogroup
2021-08-08 15:39:42 +02:00
Sandro
b739a14b37 Merge pull request #121906 from ymarkus/nixos-mullvad
nixos/mullvad-vpn: fix firewall issues & remove xfix as maintainer
2021-08-08 15:03:26 +02:00
Martin Weinelt
611bc7c23b Merge pull request #111692 from lopsided98/chrony-initstepslew-types
nixos/chrony: split the initstepslew attrset into options
2021-08-08 15:03:06 +02:00
Pascal Bach
463be7303e Merge pull request #118855 from bachp/unifi-harden
nixos/unifi: harden service
2021-08-07 14:48:25 +02:00
Poscat
6e3cecf1f7 nixos/chrony: wait for dns services to start up before starting 2021-08-06 21:03:55 +08:00
Naïm Favier
12bbb0fd7b nixos/syncthing: fix curl not retrying on network errors 2021-08-01 15:03:41 +02:00
Martin Weinelt
b3b187315b Merge pull request #131885 from mweinelt/kea 2021-07-31 02:21:19 +02:00
Martin Weinelt
3d43cf8f21 nixos/kea: fix config reload
Because the config file gets symlinked to /etc/kea to make reloads work
we need to add restart triggers for the actual symlink targets.
2021-07-30 03:25:11 +02:00
Martin Weinelt
d902365913 nixos/bird: fix bird/bird6 description 2021-07-30 03:13:50 +02:00
Peter Ferenczy
3936313b1f nixos/firewall: document log location
Motivated by not finding the firewall log messages for an annoyingly long time.
2021-07-29 18:43:50 +02:00
Lassulus
729042fae8 Merge pull request #131794 from ncfavier/syncthing-collapse-declarative
nixos/syncthing: move declarative options to the top level
2021-07-29 15:42:33 +02:00
Naïm Favier
f114215b14 nixos/syncthing: clean up option descriptions 2021-07-29 15:20:30 +02:00
github-actions[bot]
a1d3be1d42 Merge master into staging-next 2021-07-28 12:01:16 +00:00
Naïm Favier
e9b01c5c8e nixos/syncthing: move declarative options to the top level 2021-07-28 11:30:30 +02:00
Lassulus
a66d9f9b00 Merge pull request #131737 from ncfavier/syncthing-extraOptions
nixos/syncthing: add declarative.extraOptions
2021-07-28 11:12:29 +02:00
Naïm Favier
6416b3a941 nixos/syncthing: add declarative.extraOptions
Allows setting arbitrary config options through the REST API.

Also switches to the [new](https://docs.syncthing.net/rest/config.html)
config endpoints.
2021-07-28 10:56:06 +02:00
github-actions[bot]
db6a26db02 Merge master into staging-next 2021-07-27 18:01:01 +00:00
Guillaume Girol
407ef1dc6f Merge pull request #121530 from symphorien/wifireg
nixos: add option to load wireless regulatory database as firmware
2021-07-27 16:43:57 +00:00
github-actions[bot]
2692c2e427 Merge master into staging-next 2021-07-27 12:01:20 +00:00
Ben Siraphob
b63a54f81c Merge pull request #110742 from siraben/deprecate-fold 2021-07-27 15:13:31 +07:00
github-actions[bot]
6a5e4f2c3d Merge master into staging-next 2021-07-25 06:01:27 +00:00
fortuneteller2k
6ea6734f71 nixos/iwd: add settings option 2021-07-23 23:06:15 +08:00
github-actions[bot]
efbc139f5d Merge staging-next into staging 2021-07-23 06:01:46 +00:00
Florian Klink
013e089000 Merge pull request #130503 from flokli/nss-fix-ordering
nixos/systemd: fix NSS database ordering
2021-07-23 02:28:32 +02:00
github-actions[bot]
0b0a8c7c9a Merge staging-next into staging 2021-07-22 18:01:39 +00:00
Martin Weinelt
70774da509 Merge pull request #130853 from mweinelt/pppd 2021-07-22 20:00:00 +02:00
github-actions[bot]
9f3ace4591 Merge staging-next into staging 2021-07-22 00:02:07 +00:00
Pavol Rusnak
f4860dc785 Merge pull request #130945 from mdlayher/mdl-corerad-docs
nixos/corerad: update link to reference configuration file
2021-07-21 23:12:47 +02:00
Andreas Rammhold
ef9be9288b Merge pull request #124799 from rissson/nixos-unbound-fix-124780
nixos/unbound: fix define-tag option
2021-07-21 22:08:44 +02:00
Martin Weinelt
78b21f405c Merge pull request #127461 from maxeaubrey/NetworkManager-1.32.0 2021-07-21 20:03:32 +02:00
Maxine Aubrey
ea125a5fd9 nixos/nftables: set nm's firewallBackend when on
when enabled, switch networkmanager's firewallBackend option to nftables
2021-07-21 19:27:30 +02:00
Martin Weinelt
ee26807e35 nixos/pppd: allow AF_NETLINK
The pppd daemon starting with version 2.4.9 uses rtnetlink to configure
the ipv6 peer address on the ppp interface. It therefore requires
allowing AF_NETLINK sockets.
2021-07-21 16:38:51 +02:00
Matt Layher
5c17e35a31 nixos/corerad: update link to reference configuration file
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2021-07-21 10:35:48 -04:00
Martin Weinelt
8abcc6ba09 nixos/pppd: replace CAP_SYS_ADMIN with CAP_BPF
The kernel before version 5.7 required CAP_SYS_ADMIN to conduct BPF
operations. After that a separate capability CAP_BPF was created, which
should be sufficient in this scenario and will further tighten the
sandbox around our pppd service.

Tested on my personal DSL line.
2021-07-21 15:20:47 +02:00
Maxine Aubrey
aa7608d7de nixos/networkmanager: add firewallBackend option 2021-07-21 00:16:34 +02:00
Jörg Thalheim
f3dfc11468 nixos/tinc: don't run as nogroup 2021-07-18 08:57:14 +02:00
Jörg Thalheim
0839cf1d45 Merge pull request #106721 from Mic92/nix-serve
nixos/nix-serve: don't run as nogroup
2021-07-18 07:53:32 +01:00
Jörg Thalheim
ac7b8724b5 nixos/nix-serve: don't run as nogroup
nogroup is insecure if shared
2021-07-18 08:51:17 +02:00
Martin Weinelt
d9a3a54b73 Merge pull request #129980 from mweinelt/nixos/kea 2021-07-18 00:26:35 +02:00
Florian Klink
c1536f5c78 nixos/systemd: fix NSS database ordering
- The order of NSS (host) modules has been brought in line with upstream
  recommendations:

  - The `myhostname` module is placed before the `resolve` (optional) and `dns`
    entries, but after `file` (to allow overriding via `/etc/hosts` /
    `networking.extraHosts`, and prevent ISPs with catchall-DNS resolvers from
    hijacking `.localhost` domains)
  - The `mymachines` module, which provides hostname resolution for local
    containers (registered with `systemd-machined`) is placed to the front, to
    make sure its mappings are preferred over other resolvers.
  - If systemd-networkd is enabled, the `resolve` module is placed before
    `files` and `myhostname`, as it provides the same logic internally, with
    caching.
  - The `mdns(_minimal)` module has been updated to the new priorities.

  If you use your own NSS host modules, make sure to update your priorities
  according to these rules:

  - NSS modules which should be queried before `resolved` DNS resolution should
    use mkBefore.
  - NSS modules which should be queried after `resolved`, `files` and
    `myhostname`, but before `dns` should use the default priority
  - NSS modules which should come after `dns` should use mkAfter.
2021-07-17 23:55:35 +02:00
Leo
bb568917b2 nixos/bind: add directory config option (#129188) 2021-07-17 08:03:20 +02:00
Martin Weinelt
caf70ceed4 nixos/kea: init 2021-07-14 01:36:04 +02:00
Sandro
70e2fceb6a Merge pull request #119713 from uonr/master 2021-07-13 22:03:12 +02:00
Tachibana Kiyomi
21f41d8b33 nixos/ddclient: add support for IPv6 2021-07-14 02:09:29 +09:00
Yannick Markus
19b1eac1b0 nixos/mullvad-vpn: fix firewall issues & remove xfix as maintainer 2021-07-13 11:14:13 +02:00
Matt Christ
0ce72580be nixos/bind: allow specifying BIND package
This allows users of the bind module to specify an alternate BIND
package. For example, by overriding the source attribute to use a
different version of BIND.

Since the default value for `services.bind.package` is `pkgs.bind`,
this change is completely backwards compatible with the current
module.
2021-07-11 08:11:33 -05:00