Hey Guys,
I’m new to nixOS an try to install it on my virtual machine.
To do this I downloaded a live-image an boot from it.
I followed the instructions on NixOS Manual.
My partitions are as followed:
vda1 - ESP - fat32 - 1 GiB - Flags: boot, esp → /boot
vda2 - cryptedlvm (LUKS encrypted LVM)
- root - 10 GiB - btrfs → /
- home - 10 GiB - btrfs → /home
- swap - 1GiB - swap → swap
For this setup I used the following commands on the terminal:
sudo parted /dev/vda
(parted) mktable gpt
(parted) mkpart ESP fat32 1MiB 1001MiB
(parted) set 1 esp on
(parted) mkpart primary 1001MiB 100%
sudo cryptsetup luksFormat /dev/vda2
sudo cryptsetup open /dev/vda2 cryptlvm
sudo pvcreate /dev/mapper/cryptlvm
sudo vgcreate nix-vg /dev/mapper/cryptlvm
sudo lvcreate -L 10G -n root nix-vg
sudo lvcreate -L 100G -n home nix-vg
sudo lvcreate -l 100%FREE -n swap nix-vg
sudo mkswap /dev/nix-vg/swap
sudo mkfs.btrfs /dev/nix-vg/root
sudo mkfs.btrfs /dev/nix-vg/home
sudo mount /dev/nix-vg/root /mnt
sudo mkdir /mnt/home
sudo mount /dev/nix-vg/home /mnt/home
sudo swapon /dev/nix-vg/swap
sudo mkfs.vfat -F 32 /dev/vda1
sudo mkdir /mnt/boot
sudo mount /dev/vda1 /mnt/boot
After this steps I started the graphical installer an Install it on my machnie.
The installation was successfully, now I reboot.
At this time the error appears. The machine starts booting and then it should wait for the password input to decrypt the partition, but it don’t find any partition with the / - directory.
In the documentation below the partition section, there is a article for usage with LUKS.
{
boot.initrd.luks.devices.crypted.device = "/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d";
fileSystems."/".device = "/dev/mapper/crypted";
}
But where should I enter this now? Or where is this directory located after installing the operating system?
When I restart, I cannot access configuration.nix because / is not found or is encrypted.
Thanks for help