# Install NixOS with Btrfs, LVM, on LUKS using TPM2 to start up, with support for suspend to disk

**URL:** https://discourse.nixos.org/t/install-nixos-with-btrfs-lvm-on-luks-using-tpm2-to-start-up-with-support-for-suspend-to-disk/59735
**Category:** Help
**Created:** [February 3, 2025, 5:39am UTC](https://discourse.nixos.org/t/install-nixos-with-btrfs-lvm-on-luks-using-tpm2-to-start-up-with-support-for-suspend-to-disk/59735 "2025-02-03T05:39:28Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![wildwestrom](https://discourse.nixos.org/user_avatar/discourse.nixos.org/wildwestrom/32/16154_2.png) [@wildwestrom](https://discourse.nixos.org/u/wildwestrom)
#### Post date: [February 3, 2025, 6:32am UTC](https://discourse.nixos.org/t/install-nixos-with-btrfs-lvm-on-luks-using-tpm2-to-start-up-with-support-for-suspend-to-disk/59735/3 "2025-02-03T06:32:12Z")

</div>

I made the changes you suggested to the initrd.

Leaving this for others, I made a mistake when making the boot partition.

```auto
File system "/dev/nvme0n1p1" has wrong type for an EFI System Partition (ESP).

```

To attempt to fix:

```sh
umount /mnt/boot
cfdisk /dev/nvme0n1 # change to ESP partition, I just had fat32.
mkfs.fat -F 32 /dev/nvme0n1p1
mount /dev/nvme0n1p1 /mnt/boot

```

Make sure you change the UUID of the boot partition!

Running `nixos-install` now yields:

```console
[root@nixos:/mnt]# nixos-install
copying channel...
building the configuration in /mnt/etc/nixos/configuration.nix...
/nix/store/ndlg17m34nawicnrny2kchra1mzygvww-nixos-system-nixos-24.11.713895.666e1b3f09c2
installing the boot loader...
setting up /etc...
Created "/boot/EFI".
Created "/boot/EFI/systemd".
Created "/boot/EFI/BOOT".
Created "/boot/loader".
Created "/boot/loader/entries".
Created "/boot/EFI/Linux".
Copied "/nix/store/xv7q10lk4lxfax7naj3b63aj2pyjv9gb-systemd-256.10/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/systemd/systemd-bootx64.efi".
Copied "/nix/store/xv7q10lk4lxfax7naj3b63aj2pyjv9gb-systemd-256.10/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/BOOT/BOOTX64.EFI".
⚠️ Mount point '/boot' which backs the random seed file is world accessible, which is a security hole! ⚠️
⚠️ Random seed file '/boot/loader/.#bootctlrandom-seed29b32b775ec3aec8' is world accessible, which is a security hole! ⚠️
Random seed file /boot/loader/random-seed successfully written (32 bytes).
Created EFI boot entry "Linux Boot Manager".
setting up /etc...
setting up /etc...
setting root password...
New password: 
Password change has been aborted.
passwd: Permission denied
passwd: password unchanged
Setting a root password failed with the above printed error.
You can set the root password manually by executing `nixos-enter --root '/mnt'` and then running `passwd` in the shell of the new system.

```

I figured I couldn’t ignore these warnings, so what to do now?

According to here ([Nixos-install with custom flake results in /boot being world accessible - #6 by NovaViper](https://discourse.nixos.org/t/nixos-install-with-custom-flake-results-in-boot-being-world-accessible/34555/6)), I need to set permissions differently.

```diff
  fileSystems."/boot" = {
      device = "${bootPart}";
      fsType = "vfat";
- options = ["fmask=0022" "dmask=0022"];
+ options = ["umask=0077"]";
    };

```

This however didn’t make the warning go away. Reading further it says I can just ignore the warning.

Looks like booting up worked without any issue. I just had to log in and add a password to my user account.

* * *

One problem I’m having is that vesktop screen sharing doesn’t work. It seems like it’s falling back to X11-based screensharing because I can capture any xwayland window.

---

_[View the full topic](https://discourse.nixos.org/t/install-nixos-with-btrfs-lvm-on-luks-using-tpm2-to-start-up-with-support-for-suspend-to-disk/59735)._
