decryption function
This commit is contained in:
parent
cd5a381451
commit
f3eb45a361
7 changed files with 38 additions and 43 deletions
|
|
@ -6,6 +6,7 @@
|
|||
...
|
||||
}: let
|
||||
user = config.user;
|
||||
decrypt = import ../lib/decrypt.nix;
|
||||
in {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
|
|
@ -22,19 +23,10 @@ in {
|
|||
options = ["subvol=@" "compress=zstd" "autodefrag"];
|
||||
};
|
||||
|
||||
boot.initrd.postDeviceCommands = pkgs.lib.mkBefore ''
|
||||
mkdir -m 0755 -p /key
|
||||
|
||||
until cryptsetup luksOpen /dev/disk/by-id/usb-Generic_Flash_Disk_BCC97785-0:0 usbkey
|
||||
do
|
||||
echo "Failed to unlock usbkey!"
|
||||
echo "Found block devices:"
|
||||
ls /dev/disk/by-id/
|
||||
sleep 2
|
||||
done
|
||||
|
||||
mount -n -t vfat -o ro /dev/mapper/usbkey /key
|
||||
'';
|
||||
boot.initrd.postDeviceCommands = pkgs.lib.mkBefore (decrypt {
|
||||
keydevice = "/dev/disk/by-id/usb-Generic_Flash_Disk_BCC97785-0:0";
|
||||
keypartname = "usbkey";
|
||||
});
|
||||
|
||||
boot.initrd.luks.devices."cryptroot" = {
|
||||
device = "/dev/disk/by-uuid/570cc51f-bd5c-4bee-a18f-f6aabaf60881";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue