···24712471 hosts.
24722472 </para>
24732473 </listitem>
24742474+ <listitem>
24752475+ <para>
24762476+ The option
24772477+ <link xlink:href="options.html#opt-networking.useDHCP">networking.useDHCP</link>
24782478+ isn’t deprecated anymore. When using
24792479+ <link xlink:href="options.html#opt-networking.useNetworkd"><literal>systemd-networkd</literal></link>,
24802480+ a generic <literal>.network</literal>-unit is added which
24812481+ enables DHCP for each interface matching
24822482+ <literal>en*</literal>, <literal>eth*</literal> or
24832483+ <literal>wl*</literal> with priority 99 (which means that it
24842484+ doesn’t have any effect if such an interface is matched by a
24852485+ <literal>.network-</literal>unit with a lower priority). In
24862486+ case of scripted networking, no behavior was changed.
24872487+ </para>
24882488+ </listitem>
24742489 </itemizedlist>
24752490 </section>
24762491</section>
+7
nixos/doc/manual/release-notes/rl-2205.section.md
···877877 `true` starting with NixOS 22.11. Enable it explicitly if you need to control
878878 Snapserver remotely or connect streamig clients from other hosts.
879879880880+- The option [networking.useDHCP](options.html#opt-networking.useDHCP) isn't deprecated anymore.
881881+ When using [`systemd-networkd`](options.html#opt-networking.useNetworkd), a generic
882882+ `.network`-unit is added which enables DHCP for each interface matching `en*`, `eth*`
883883+ or `wl*` with priority 99 (which means that it doesn't have any effect if such an interface is matched
884884+ by a `.network-`unit with a lower priority). In case of scripted networking, no behavior
885885+ was changed.
886886+880887<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
···581581EOF
582582583583sub generateNetworkingDhcpConfig {
584584+ # FIXME disable networking.useDHCP by default when switching to networkd.
584585 my $config = <<EOF;
585585- # The global useDHCP flag is deprecated, therefore explicitly set to false here.
586586- # Per-interface useDHCP will be mandatory in the future, so this generated config
587587- # replicates the default behaviour.
588588- networking.useDHCP = lib.mkDefault false;
586586+ # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
587587+ # (the default) this is the recommended approach. When using systemd-networkd it's
588588+ # still possible to use this option, but it's recommended to use it in conjunction
589589+ # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
590590+ networking.useDHCP = lib.mkDefault true;
589591EOF
590592591593 foreach my $path (glob "/sys/class/net/*") {
592594 my $dev = basename($path);
593595 if ($dev ne "lo") {
594594- $config .= " networking.interfaces.$dev.useDHCP = lib.mkDefault true;\n";
596596+ $config .= " # networking.interfaces.$dev.useDHCP = lib.mkDefault true;\n";
595597 }
596598 }
597599
+14-1
nixos/modules/services/games/factorio.nix
···8787 a new map with default settings will be generated before starting the service.
8888 '';
8989 };
9090+ loadLatestSave = mkOption {
9191+ type = types.bool;
9292+ default = false;
9393+ description = ''
9494+ Load the latest savegame on startup. This overrides saveName, in that the latest
9595+ save will always be used even if a saved game of the given name exists. It still
9696+ controls the 'canonical' name of the savegame.
9797+9898+ Set this to true to have the server automatically reload a recent autosave after
9999+ a crash or desync.
100100+ '';
101101+ };
90102 # TODO Add more individual settings as nixos-options?
91103 # TODO XXX The server tries to copy a newly created config file over the old one
92104 # on shutdown, but fails, because it's in the nix store. When is this needed?
···250262 "--config=${cfg.configFile}"
251263 "--port=${toString cfg.port}"
252264 "--bind=${cfg.bind}"
253253- "--start-server=${mkSavePath cfg.saveName}"
265265+ (optionalString (!cfg.loadLatestSave) "--start-server=${mkSavePath cfg.saveName}")
254266 "--server-settings=${serverSettingsFile}"
267267+ (optionalString cfg.loadLatestSave "--start-server-load-latest")
255268 (optionalString (cfg.mods != []) "--mod-directory=${modDir}")
256269 (optionalString (cfg.admins != []) "--server-adminlist=${serverAdminsFile}")
257270 ];
···4343 } {
4444 assertion = cfg.defaultGateway6 == null || cfg.defaultGateway6.interface == null;
4545 message = "networking.defaultGateway6.interface is not supported by networkd.";
4646- } {
4747- assertion = cfg.useDHCP == false;
4848- message = ''
4949- networking.useDHCP is not supported by networkd.
5050- Please use per interface configuration and set the global option to false.
5151- '';
5246 } ] ++ flip mapAttrsToList cfg.bridges (n: { rstp, ... }: {
5347 assertion = !rstp;
5448 message = "networking.bridges.${n}.rstp is not supported by networkd.";
···8074 in mkMerge [ {
8175 enable = true;
8276 }
7777+ (mkIf cfg.useDHCP {
7878+ networks."99-ethernet-default-dhcp" = lib.mkIf cfg.useDHCP {
7979+ # We want to match physical ethernet interfaces as commonly
8080+ # found on laptops, desktops and servers, to provide an
8181+ # "out-of-the-box" setup that works for common cases. This
8282+ # heuristic isn't perfect (it could match interfaces with
8383+ # custom names that _happen_ to start with en or eth), but
8484+ # should be good enough to make the common case easy and can
8585+ # be overridden on a case-by-case basis using
8686+ # higher-priority networks or by disabling useDHCP.
8787+8888+ # Type=ether matches veth interfaces as well, and this is
8989+ # more likely to result in interfaces being configured to
9090+ # use DHCP when they shouldn't.
9191+9292+ # We set RequiredForOnline to false, because it's fairly
9393+ # common for such devices to have multiple interfaces and
9494+ # only one of them to be connected (e.g. a laptop with
9595+ # ethernet and WiFi interfaces). Maybe one day networkd will
9696+ # support "any"-style RequiredForOnline...
9797+ matchConfig.Name = ["en*" "eth*"];
9898+ DHCP = "yes";
9999+ linkConfig.RequiredForOnline = lib.mkDefault false;
100100+ };
101101+ networks."99-wireless-client-dhcp" = lib.mkIf cfg.useDHCP {
102102+ # Like above, but this is much more likely to be correct.
103103+ matchConfig.WLANInterfaceType = "station";
104104+ DHCP = "yes";
105105+ linkConfig.RequiredForOnline = lib.mkDefault false;
106106+ # We also set the route metric to one more than the default
107107+ # of 1024, so that Ethernet is preferred if both are
108108+ # available.
109109+ dhcpV4Config.RouteMetric = 1025;
110110+ ipv6AcceptRAConfig.RouteMetric = 1025;
111111+ };
112112+ })
83113 (mkMerge (forEach interfaces (i: {
84114 netdevs = mkIf i.virtual ({
85115 "40-${i.name}" = {
-5
nixos/modules/tasks/network-interfaces.nix
···12541254 Whether to use DHCP to obtain an IP address and other
12551255 configuration for all network interfaces that are not manually
12561256 configured.
12571257-12581258- Using this option is highly discouraged and also incompatible with
12591259- <option>networking.useNetworkd</option>. Please use
12601260- <option>networking.interfaces.<name>.useDHCP</option> instead
12611261- and set this to false.
12621257 '';
12631258 };
12641259
+11
nixos/modules/virtualisation/proxmox-lxc.nix
···2020 configuration from proxmox.
2121 '';
2222 };
2323+ manageHostName = mkOption {
2424+ type = types.bool;
2525+ default = false;
2626+ description = ''
2727+ Whether to manage hostname through nix options
2828+ When false, the hostname is picked up from /etc/hostname
2929+ populated by proxmox.
3030+ '';
3131+ };
2332 };
24332534 config =
···5059 useDHCP = false;
5160 useHostResolvConf = false;
5261 useNetworkd = true;
6262+ # pick up hostname from /etc/hostname generated by proxmox
6363+ hostName = mkIf (!cfg.manageHostName) (mkForce "");
5364 };
54655566 services.openssh = {