nixos/installer: ship the minimal ISO with networkmanager

With networkmanager we can provide a much more welcoming network setup
experience in the installer and it costs us less than 10 MB with this
configuration on the minimal ISO.

By default, for new profiles it will enable DHCP and RA and allow
interactive reconfiguration through `nmtui` or `nmcli`. Especially the
TUI interface is very easy to pick up and removes the need for typing in
manual commands when setting up the WLAN connection.

Changed files
+10 -59
nixos
doc
manual
configuration
installation
modules
+2 -2
nixos/doc/manual/configuration/profiles/installation-device.section.md
···
Autologin is enabled as `nixos` user, while passwordless
login as both `root` and `nixos` is possible.
Passwordless `sudo` is enabled too.
-
[wpa_supplicant](#opt-networking.wireless.enable) is
-
enabled, but configured to not autostart.
+
[NetworkManager](#opt-networking.networkmanager.enable) is
+
enabled and can be configured interactively with `nmtui`.
It is explained how to login, start the ssh server, and if available,
how to start the display manager.
+4 -45
nixos/doc/manual/installation/installing.chapter.md
···
a`). Networking is necessary for the installer, since it will
download lots of stuff (such as source tarballs or Nixpkgs channel
binaries). It's best if you have a DHCP server on your network.
-
Otherwise configure networking manually using `ifconfig`.
+
Otherwise configure networking manually using `ip`.
-
On the graphical installer, you can configure the network, wifi
-
included, through NetworkManager. Using the `nmtui` program, you can do
-
so even in a non-graphical session. If you prefer to configure the
-
network manually, disable NetworkManager with
+
You can configure the network, Wi-Fi included, through NetworkManager.
+
Using the `nmtui` program, you can do so even in a non-graphical session.
+
If you prefer to configure the network manually, disable NetworkManager with
`systemctl stop NetworkManager`.
-
-
On the minimal installer, NetworkManager is not available, so
-
configuration must be performed manually. To configure the wifi, first
-
start wpa_supplicant with `sudo systemctl start wpa_supplicant`, then
-
run `wpa_cli`. For most home networks, you need to type in the following
-
commands:
-
-
```plain
-
> add_network
-
0
-
> set_network 0 ssid "myhomenetwork"
-
OK
-
> set_network 0 psk "mypassword"
-
OK
-
> enable_network 0
-
OK
-
```
-
-
For enterprise networks, for example *eduroam*, instead do:
-
-
```plain
-
> add_network
-
0
-
> set_network 0 ssid "eduroam"
-
OK
-
> set_network 0 identity "myname@example.com"
-
OK
-
> set_network 0 password "mypassword"
-
OK
-
> enable_network 0
-
OK
-
```
-
-
When successfully connected, you should see a line such as this one
-
-
```plain
-
<3>CTRL-EVENT-CONNECTED - Connection to 32:85:ab:ef:24:5c completed [id=0 id_str=]
-
```
-
-
you can now leave `wpa_cli` by typing `quit`.
If you would like to continue the installation from a different machine
you can use activated SSH daemon. You need to copy your ssh key to
-4
nixos/modules/installer/cd-dvd/installation-cd-graphical-base.nix
···
services.xserver.enable = true;
-
# Provide networkmanager for easy wireless configuration.
-
networking.networkmanager.enable = true;
-
networking.wireless.enable = lib.mkImageMediaOverride false;
-
# KDE complains if power management is disabled (to be precise, if
# there is no power management backend such as upower).
powerManagement.enable = true;
+1 -1
nixos/modules/installer/netboot/netboot-minimal.nix
···
documentation.man.enable = lib.mkOverride 500 true;
hardware.enableRedistributableFirmware = lib.mkOverride 70 false;
system.extraDependencies = lib.mkOverride 70 [ ];
-
networking.wireless.enable = lib.mkOverride 500 false;
+
networking.networkmanager.enable = lib.mkOverride 500 false;
}
+3 -7
nixos/modules/profiles/installation-device.nix
···
with `passwd` (prefix with `sudo` for "root"), or add your public key to
/home/nixos/.ssh/authorized_keys or /root/.ssh/authorized_keys.
-
If you need a wireless connection, type
-
`sudo systemctl start wpa_supplicant` and configure a
-
network using `wpa_cli`. See the NixOS manual for details.
+
To set up a wireless connection, run `nmtui`.
''
+ optionalString config.services.xserver.enable ''
···
settings.PermitRootLogin = mkDefault "yes";
};
-
# Enable wpa_supplicant, but don't start it by default.
-
networking.wireless.enable = mkDefault true;
-
networking.wireless.userControlled.enable = true;
-
systemd.services.wpa_supplicant.wantedBy = mkOverride 50 [ ];
+
# Provide networkmanager for easy network configuration.
+
networking.networkmanager.enable = true;
# Tell the Nix evaluator to garbage collect more aggressively.
# This is desirable in memory-constrained environments that don't