From 7aae967c6584f340e2e4aa4538c18fb31bc6d854 Mon Sep 17 00:00:00 2001 From: Aleix Roca Nonell Date: Wed, 10 May 2023 10:58:27 +0200 Subject: [PATCH] Improve documentation --- doc/install.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/doc/install.md b/doc/install.md index 05a6022..41e7684 100644 --- a/doc/install.md +++ b/doc/install.md @@ -12,7 +12,8 @@ Create a main partition and label it `nixos` following [the manual][1]. ``` # disk=/dev/sdX # parted $disk -- mklabel msdos -# parted $disk -- mkpart primary 1MB 100% +# parted $disk -- mkpart primary 1MB -8GB +# parted $disk -- mkpart primary linux-swap -8GB 100% # parted $disk -- set 1 boot on ``` @@ -21,6 +22,7 @@ installed. **Ensure that no other partition has the same label.** ``` # mkfs.ext4 -L nixos "${disk}1" +# mkswap -L swap "${disk}2" # mount ${disk}1 /mnt # lsblk -f $disk NAME FSTYPE LABEL UUID MOUNTPOINT @@ -55,6 +57,66 @@ And add them to the PATH: nix (Nix) 2.13.3 ``` +## Adapt owl configuration + +Clone owl repo: + +``` +$ git clone git@bscpm03.bsc.es:rarias/owl.git +$ cd owl +``` + +Edit the configuration to your needs. + +## Install from another Linux OS + +Install nixOS into the storage drive. + +``` +# nixos-install --flake --root /mnt .#xeon0X +``` + +At this point, the nixOS grub has been installed into the nixos device, which +is not the default boot device. To keep both the old Linux and NixOS grubs, add +an entry into the old Linux grub to jump into the new grub. + +``` +# echo " + +menuentry 'NixOS' { + insmod chain + search --no-floppy --label nixos --set root + configfile /boot/grub/grub.cfg +} " >> /etc/grub.d/40_custom +``` + +Rebuild grub config. + +``` +# grub2-mkconfig -o /boot/grub/grub.cfg +``` + +To boot into NixOS manually, reboot and select NixOS in the grub menu to boot +into NixOS. + +To temporarily boot into NixOS only on the next reboot run: + +``` +# grub2-reboot 'NixOS' +``` + +To permanently boot into NixOS as the default boot OS, edit `/etc/default/grub/`: + +``` +GRUB_DEFAULT='NixOS' +``` + +And update grub. + +``` +# grub2-mkconfig -o /boot/grub/grub.cfg +``` + ## Build the nixos kexec image ```