Make a systemd mount unit instead of unfunctioning sh script in systemd stage 1
This commit is contained in:
parent
0c6fe348d8
commit
d97344170b
|
@ -7,11 +7,7 @@
|
||||||
# ===========================================================
|
# ===========================================================
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
{ inputs, configLib, ... }:
|
{ inputs, configLib, ... }: {
|
||||||
let
|
|
||||||
PRIMARYUSBID = "720657da-2c89-4f47-aba9-b43618778a3d";
|
|
||||||
BACKUPUSBID = "b501f1b9-7714-472c-988f-3c997f146a18";
|
|
||||||
in {
|
|
||||||
imports = [
|
imports = [
|
||||||
#################### Every Host Needs This ####################
|
#################### Every Host Needs This ####################
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
@ -94,9 +90,15 @@ in {
|
||||||
# sleep 2 # To make sure the usb key has been loaded
|
# 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
|
# mount -n -t vfat -o ro `findfs UUID=${PRIMARYUSBID}` /key || mount -n -t vfat -o ro `findfs UUID=${BACKUPUSBID}` /key
|
||||||
# '';
|
# '';
|
||||||
|
### ----> Instead use systemd mount unit
|
||||||
systemd.enable = true; # tpm2 unlock requires systemd initrd
|
systemd = {
|
||||||
|
enable = true; # tpm2 unlock requires systemd initrd
|
||||||
|
mounts = [{
|
||||||
|
what = "UUID=720657da-2c89-4f47-aba9-b43618778a3d";
|
||||||
|
where = "/key";
|
||||||
|
type = "btrfs";
|
||||||
|
}];
|
||||||
|
};
|
||||||
luks.devices."crypted" = {
|
luks.devices."crypted" = {
|
||||||
bypassWorkqueues = true;
|
bypassWorkqueues = true;
|
||||||
device = "/dev/nvme0n1p2";
|
device = "/dev/nvme0n1p2";
|
||||||
|
|
Loading…
Reference in New Issue