From 20281b3c52482bef3b00cf6947c64b1b942b9249 Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Fri, 3 May 2024 02:21:38 -0700 Subject: Add some extra documentation --- doc/rescue.md | 38 ++++++++++++++++++++++++++++++++++++++ doc/wpa_supplicant.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 doc/rescue.md create mode 100644 doc/wpa_supplicant.md diff --git a/doc/rescue.md b/doc/rescue.md new file mode 100644 index 0000000..431246a --- /dev/null +++ b/doc/rescue.md @@ -0,0 +1,38 @@ +# Using NixOS Installer as Rescue Environment + +As with most Linux distributions, you will need to mount your +core file systems under `/mnt`. You don't need to worry about +the virtual file systems, just the real ones, including any boot +or ESP partitions. You can also skip swap for now. + +Once you are done with that, you can simply type `nixos-enter` to +pivot into the chroot. You will probably also want to `unset +SUDO_USER` if you used `sudo -i` or something similar, as having +it set will probably cause issues when trying to run +`nixos-rebuild`. + +Should you need to manually set up the rescue environment, beyond +the physical mounts already done above, you will also need to run +the following: + +``` +mount -o bind /dev /mnt/dev +mount -o bind /proc /mnt/proc +mount -o bind /sys /mnt/sys +chroot /mnt /nix/var/nix/profiles/system/activate +chroot /mnt /run/current-system/sw/bin/bash +``` + +Lastly, should you get the following error when trying to run +`nixos-rebuild switch` within your rescue environment, usually +caused by systemd as the bootloader: + +``` +error: System has not been booted with systemd as init system (PID 1). Can't operate. +``` + +you can instead try running `nixos-rebuild boot`. If that also +fails, you can try appending those commands with +`NIXOS_SWITCH_USE_DIRTY_ENV=1` which might work around the +problem. And should none of that work, you can try to use +`nixos-install` as a last resort. diff --git a/doc/wpa_supplicant.md b/doc/wpa_supplicant.md new file mode 100644 index 0000000..ba36f0d --- /dev/null +++ b/doc/wpa_supplicant.md @@ -0,0 +1,29 @@ +# Enabling Wireless in NixOS Installer + +Assuming you have a wireless interface directly supported by the +installer's kernel (and if not, have you tried the unstable +installer ISO yet?), you will need some extra commands beyond the +admittedly brief notes about wpa_supplicant in the installer's +shell and the man page for wpa_cli itself. + +As the brief note does say, you can get started with: + +``` +sudo systemctl start wpa_supplicant` +wpa_cli +``` + +Once inside the CLI, you then need the following: + +``` +scan +scan_results +add_network 0 +set_network 0 ssid "Some SSID" +set_network 0 psk "some password" +enable_network 0 +save_config +quit +``` + +`dhcpcd` should run automatically. -- cgit v1.2.3