Commit Graph

224 Commits

Author SHA1 Message Date
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Niko
9e2cd6f872
nixos/network-interfaces: remove network-interfaces.target
Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
2024-01-12 17:29:03 +01:00
nikstur
c9569af3e0
Merge pull request #271326 from philiptaron/shutdown.target
treewide: depend on `shutdown.target` if `DefaultDependencies=no` in almost every case
2023-12-27 08:33:26 +01:00
rnhmjoj
cdc24ab409
nixos/networking-interfaces: fix rootless ping
In 759ec111 the ping setuid wrapper was removed in favour of giving
permissions to perform ICMP echo requests to all users.
The problem is that the systemd file that was supposed to change the
`net.ipv4.ping_group_range` sysctl is not always installed, specifically
only if systemd.coredump.enable.
In that case the range is "0 1", which is effectively restricts ping to
only root.

This change explicitely sets the range to "0 2^31-1", as systemd does.
2023-12-11 13:22:26 +01:00
Philip Taron
54064109fb
nixos/network-interfaces: ensure correct ordering w.r.t. shutdown.target
Also, mark this service as `oneshot`, since it is.
2023-11-30 15:39:01 -08:00
Gaurav Juvekar
5ab4ce5d33 nixos/network-interfaces: fix typo in networking.fqdn 2023-11-12 08:47:01 -08:00
Joseph Stahl
137a3c1303
systemd domainname service - fix missing domainname binary
needs nettools in path
2023-10-28 22:30:14 -04:00
nikstur
d300940637 nixos/network-interfaces: replace hostname and domain activationScript
The hostname is already set by systemd
https://www.freedesktop.org/software/systemd/man/latest/hostname.html#Hostname%20semantics

Create a separate service that registers the domainname.
2023-10-26 01:51:08 +02:00
Martin Weinelt
d042a29613
Merge pull request #253764 from linj-fork/fix-ping-wrapper
nixos/network-interfaces: stop wrapping ping with cap_net_raw
2023-10-20 00:57:55 +02:00
Maximilian Bosch
632cfff257
Merge pull request #259619 from Majiir/fix-networkd-dhcp
nixos/network-interfaces-systemd: fix DHCP setting
2023-10-14 20:47:36 +02:00
Majiir Paktu
c4228b6c8f nixos/network-interfaces-systemd: fix DHCP setting
The networkd backend logic for setting DHCP= on an interface is bugged
and inconsistent with the scripted logic. Consider this simple NixOS
configuration:

    {
      networking.useNetworkd = true;
      networking.interfaces.eth0.wakeOnLan.enable = true;
    }

The default value of networking.useDHCP is true, so we expect our eth0
interface to have DHCP enabled. With the scripted backend, this works.
But the networkd backend generates the following 40-eth0.network file:

    [Match]
    Name=eth0

    [Network]
    DHCP=no
    IPv6PrivacyExtensions=kernel

This is happening because the wakeOnLan configuration creates a key in
networking.interfaces, and the networkd backend erroneously checks that
instead of for explicitly configured IP addresses as in the scripted
backend. The documentation is also inconsistent across various options.

This change aligns the networkd backend and option documentation to the
actual behavior of the scripted backend, and updates a test to account
for this behavior for both backends.
2023-10-14 13:57:32 -04:00
Maximilian Bosch
6998695f5d
Merge pull request #259658 from Majiir/fix-networkd-wakeonlan
nixos/network-interfaces-systemd: fix WakeOnLan
2023-10-14 14:48:22 +02:00
Maximilian Bosch
d664571660
Merge pull request #256598 from adamcstephens/net/warn-multiple-net
nixos/networking: warn when both networkd and dhcpcd can collide
2023-10-14 12:24:24 +02:00
Majiir Paktu
f5f1751b1f refactor: combine scripted and networkd WakeOnLan config 2023-10-07 21:02:46 -04:00
ign0tus
27d0a8a0cd network.interfaces: Add option to configure WakeOnLan policy
Adds an option to configure a custom WakeOnLan policy instead of the
hard-coded "magic" policy. To ensure compatibility with current
behavior, "magic" is kept as default.
2023-09-28 20:14:02 +02:00
Adam Stephens
b4e162a109
nixos/networking: warn when both networkd and dhcpcd can collide 2023-09-21 20:05:25 -04:00
Lin Jian
759ec1113d
nixos/network-interfaces: stop wrapping ping with cap_net_raw
From systemd 243 release note[1]:

This release enables unprivileged programs (i.e. requiring neither
setuid nor file capabilities) to send ICMP Echo (i.e. ping) requests
by turning on the "net.ipv4.ping_group_range" sysctl of the Linux
kernel for the whole UNIX group range, i.e. all processes.

So this wrapper is not needed any more.

See also [2] and [3].

This patch also removes:
- apparmor profiles in NixOS for ping itself and the wrapped one
- other references for the wrapped ping

[1]: 8e2d9d40b3/NEWS (L6457-L6464)
[2]: https://github.com/systemd/systemd/pull/13141
[3]: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange
2023-09-21 16:52:16 +08:00
Robert Obryk
44fde723be nixos/security/wrappers: generate a separate and more complete apparmor policy fragment for each wrapper
This change includes some stuff (e.g. reading of the `.real` file,
execution of the wrapper's target) that belongs to the apparmor policy
of the wrapper. This necessitates making them distinct for each wrapper.
The main reason for this change is as a preparation for making each
wrapper be a distinct binary.
2023-08-27 14:10:07 +02:00
Molly Miller
3e96fd980d nixos/network-interfaces: restrict IPv6 privacy address overrides to interface
Only trigger the privacy address override for a given interface when
that interface is added. Without restricting the rule to the
interface, this command would be run when any interface is added.
2023-06-27 16:15:02 +02:00
Victor Fuentes
d3528cdc3d
nixos/version: add config.system.nixos.distroName and config.system.nixos.distroId 2023-01-14 16:19:06 -05:00
Artturin
05a2dfd674 lib.replaceChars: warn about being a deprecated alias
replaceStrings has been in nix since 2015(nix 1.10)

so it is safe to remove the fallback

d6d5885c15
2022-12-15 22:25:51 +02:00
Ryan Lahfa
bc7c15825b
Merge pull request #117371 from grahamc/sysctl-hostname
network-interfaces: set hostname from sysctl if defined
2022-12-01 16:03:04 +01:00
Robert Hensing
93a905ec4f
Merge pull request #194759 from hercules-ci/fqdn-or-hostname
nixos: Add `networking.fqdnOrHostName`
2022-11-09 13:53:57 +01:00
Naïm Favier
8f571534c9
Merge pull request #194766 from ncfavier/proxy-arp 2022-10-31 09:59:56 +01:00
Robert Hensing
18e3f431e1 networking.fqdnOrHostName: Elaborate and format the descriptions 2022-10-15 11:57:58 +02:00
Naïm Favier
52c58c8bbe
nixos/network-interfaces: reflect negative settings of proxyARP
Currently, setting `proxyARP` to true enables `proxy_arp`, but setting
it to false doesn't disable it. This is surprising and stateful.
2022-10-06 16:46:17 +02:00
Robert Hensing
f43716f28e nixos: Add networking.fqdnOrHostName option, readOnly 2022-10-06 16:21:09 +02:00
digital
12d64e041b nixos/networking: add a suggestion to use networkd options 2022-09-15 18:07:24 +02:00
pennae
9217509ece nixos/network-interfaces: convert option descriptions to MD 2022-08-27 19:18:29 +02:00
pennae
7e7d68a250 nixos/*: mark pre-existing markdown descriptions as mdDoc 2022-08-19 22:40:58 +02:00
pennae
087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02:00
pennae
423545fe48 nixos/*: normalize manpage references to single-line form
now nix-doc-munge will not introduce whitespace changes when it replaces
manpage references with the MD equivalent.

no change to the manpage, changes to the HTML manual are whitespace only.
2022-08-05 18:34:50 +02:00
pennae
3aebb4a2be nixos/*: normalize link format
make (almost) all links appear on only a single line, with no
unnecessary whitespace, using double quotes for attributes. this lets us
automatically convert them to markdown easily.

the few remaining links are extremely long link in a gnome module, we'll
come back to those at a later date.
2022-08-03 21:57:46 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Alexandru Scvortov
3a09010b9d nixos/network-interfaces: add networking.interfaces.<name>.ipv[46].routes.type 2022-06-02 19:16:25 +01:00
Maximilian Bosch
196c877c85
nixos/network-interfaces: remove outdated deprecation information 2022-04-30 12:40:10 +02:00
Janne Heß
3396c96e4b
nixos/stage-1-init: Set host id for ZFS 2022-04-16 21:32:18 +01:00
Linus Heckemann
3631db714c
Merge pull request #158176 from lheckemann/fix-tempaddr
network-interfaces: use altered interface name for setting use_tempaddr
2022-03-29 10:39:46 +02:00
jpathy
19bb72c070 networking.greTunnels: Add ttl option 2022-03-23 00:24:44 +05:30
jpathy
0a62de4cd5 networking.greTunnels: support ip6gre* 2022-03-17 17:59:36 +05:30
Alyssa Ross
1176525f87 treewide: remove obsolete kernel version checks
We don't support Linux kernels older than 4.4 in Nixpkgs.
2022-02-19 21:09:19 +00:00
Linus Heckemann
c74d784771 network-interfaces: use altered interface name for setting use_tempaddr
Fixes #86764
2022-02-05 00:13:03 +01:00
Jade
fe636b4805
nixos/networking: Typo fix 2022-02-04 13:55:56 -05:00
Luflosi
ca58bd0a50
nixos/networkd: Add routes from interfaces to [Route] section of .network file
Closes https://github.com/NixOS/nixpkgs/pull/93635.
2022-01-20 20:14:55 +01:00
Guillaume Girol
fdc3784828
Merge pull request #148637 from hexagonal-sun/network/gre-tap-tun
nixos/network: add gre virtual interfaces
2022-01-01 17:04:29 +00:00
pennae
ed673a69db treewide: add defaultText for options with simple cfg.* expression defaults
adds defaultText for options with defaults that use only literals, full config.*
paths, and the cfg shortcut binding.
2021-12-09 01:14:16 +01:00
Matthew Leach
5ce7061945 nixos/networking: add options for configuring a GRE tunnel
Add `networking.greTunnels` option that allows a GRE tunnel to be
configured in NixOS.
2021-12-07 15:44:00 +00:00
Artturi
a0d4895e9d
Merge pull request #146709 from Artturin/underscorename 2021-11-21 03:12:31 +02:00
Artturin
2077956e78 nixos/network-interfaces: add a warning for underscores in hostname
until the issues in https://github.com/NixOS/nixpkgs/pull/138978
have been resolved
2021-11-21 01:39:39 +02:00
Artturin
31759dc4b7 nixos/networkmanager: remove redundant ipv6.ip6-privacy
this setting was added in 2016 in commit
bcdd81d9e1

the posibility to preferTempAddress was added to
nixos/network-interface in 2018 in commit
1fec496f38

preferTempAddress was renamed to tempAddress
in 2020 in commit 2485e6399e

therefore this setting is redundant since nm will use the sysctl option

nixos/network-interfaces: add default to sysctl so that the value for it
is set

networkmanager falls back to it
https://man.archlinux.org/man/NetworkManager.conf.5
2021-11-19 01:12:25 +02:00