fix: failed to boot - replace device name by uuid

This commit is contained in:
Ryan Yin
2024-01-28 09:56:40 +08:00
parent 63d686ad3a
commit 0504d0503b
2 changed files with 3 additions and 4 deletions

View File

@@ -9,10 +9,9 @@
fsType = "cifs";
options = [
# https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html
"nofail,_netdev,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"
"nofail,_netdev"
"uid=1000,gid=100,dir_mode=0755,file_mode=0755"
"vers=3.0,credentials=${config.age.secrets.smb-credentials.path}"
];
depends = ["/persistent" "/boot" "/swap/swapfile"];
};
}

View File

@@ -46,7 +46,7 @@
boot.initrd = {
# unlocked luks devices via a keyfile or prompt a passphrase.
luks.devices."crypted-nixos" = {
# NOTE: DO NOT use device name here(like /dev/sda, /dev/nvme0n1p2, etc), use the UUID instead.
# NOTE: DO NOT use device name here(like /dev/sda, /dev/nvme0n1p2, etc), use UUID instead.
# https://github.com/ryan4yin/nix-config/issues/43
device = "/dev/disk/by-uuid/a21ca82a-9ee6-4e5c-9d3f-a93e84e4e0f4";
# the keyfile(or device partition) that should be used as the decryption key for the encrypted device.
@@ -119,7 +119,7 @@
};
fileSystems."/boot" = {
device = "/dev/nvme0n1p1";
device = "/dev/disk/by-uuid/90FB-9F88";
fsType = "vfat";
};