Remove boot partition from vultr config

This commit is contained in:
marc
2024-02-03 18:15:22 +01:00
parent 31d93b8e19
commit ccb5760edf
2 changed files with 79 additions and 5 deletions

View File

@@ -85,6 +85,85 @@
passwd marc
#+END_SRC
** Fresh system (vultr)
1. [Optional] Set the root password via the Vultr Console, so you can ssh to the instance
2. Open a nix-shell with git (if not installed):
#+BEGIN_SRC bash
nix-shell -p git
#+END_SRC
3. Clone the flake
#+BEGIN_SRC bash
git clone https://git.samfelag.xyz/marc/samfelag.git
#+END_SRC
4. Partition the disk
We'll partition the disk in the follwing way:
* 512MB at the beginning for the boot partition
* 8GB at the end for swap
* The rest (at the middle) for the filesystem (/)
* Locate the disk
#+BEGIN_SRC bash
lsblk
#+END_SRC
* Create a MBR partition table
#+BEGIN_SRC bash
sudo parted /dev/vda -- mklabel msdos
#+END_SRC
* Create the root partition
#+BEGIN_SRC bash
sudo parted /dev/vda -- mkpart primary 1MiB -8GiB
#+END_SRC
* Create the swap partition
#+BEGIN_SRC bash
sudo parted /dev/vda -- mkpart primary linux-swap -8GiB 100%
#+END_SRC
* Create the boot partition
#+BEGIN_SRC bash
sudo parted /dev/vda -- mkpart ESP fat32 1MB 512MB
sudo parted /dev/vda -- set 3 esp on
#+END_SRC
5. Format the partitions
1. Root partition
#+BEGIN_SRC bash
sudo mkfs.ext4 -L nixos /dev/vda1
#+END_SRC
2. Swap partition
#+BEGIN_SRC bash
sudo mkswap -L swap /dev/vda2
#+END_SRC
6. Mount the filesystems
1. Root partition
#+BEGIN_SRC bash
sudo mount /dev/disk/by-label/nixos /mnt
#+END_SRC
2. Swap partition (if needed)
#+BEGIN_SRC bash
sudo swapon /dev/disk/by-label/swap
#+END_SRC
7. Create the host nix configuration
If the host is not present under system/hosts, create a new folder for the host.
Generate the hardware configuration file, you can use nixos-generate-config as a base:
#+BEGIN_SRC bash
nixos-generate-config --dir <<host directory>> --no-filesystems
#+END_SRC
8. Install nixos!
#+BEGIN_SRC bash
sudo nixos-install --impure --root /mnt --flake '.#vultr-test'
#+END_SRC
9. Set up the user
You'll set the root password during the installation. You can then reboot and use the installed OS. First thing you'll have to do is log in as root and set the password for your user:
#+BEGIN_SRC bash
passwd marc
#+END_SRC
* Rebuilding
#+BEGIN_SRC bash
sudo nixos-rebuild switch --impure --flake '.#reykjavik'

View File

@@ -17,11 +17,6 @@
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
};
swapDevices = [