Make a systemd mount unit instead of unfunctioning sh script in systemd stage 1

This commit is contained in:
Matthieu Morin 2024-06-09 20:18:16 +00:00
parent 0c6fe348d8
commit d97344170b
1 changed files with 10 additions and 8 deletions

View File

@ -7,11 +7,7 @@
# ===========================================================
#############################################################
{ inputs, configLib, ... }:
let
PRIMARYUSBID = "720657da-2c89-4f47-aba9-b43618778a3d";
BACKUPUSBID = "b501f1b9-7714-472c-988f-3c997f146a18";
in {
{ inputs, configLib, ... }: {
imports = [
#################### Every Host Needs This ####################
./hardware-configuration.nix
@ -94,9 +90,15 @@ in {
# sleep 2 # To make sure the usb key has been loaded
# mount -n -t vfat -o ro `findfs UUID=${PRIMARYUSBID}` /key || mount -n -t vfat -o ro `findfs UUID=${BACKUPUSBID}` /key
# '';
systemd.enable = true; # tpm2 unlock requires systemd initrd
### ----> Instead use systemd mount unit
systemd = {
enable = true; # tpm2 unlock requires systemd initrd
mounts = [{
what = "UUID=720657da-2c89-4f47-aba9-b43618778a3d";
where = "/key";
type = "btrfs";
}];
};
luks.devices."crypted" = {
bypassWorkqueues = true;
device = "/dev/nvme0n1p2";