decryption function
This commit is contained in:
parent
cd5a381451
commit
f3eb45a361
7 changed files with 38 additions and 43 deletions
15
lib/decrypt.nix
Normal file
15
lib/decrypt.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
keydevice,
|
||||
keypartname,
|
||||
}: ''
|
||||
mkdir -m 0755 -p /key
|
||||
|
||||
dev=${keydevice}
|
||||
sleep 1
|
||||
until cryptsetup luksOpen "$dev" usbkey
|
||||
do
|
||||
echo "Insert key and press enter..."
|
||||
read res
|
||||
done
|
||||
mount -n -t vfat -o ro /dev/mapper/${keypartname} /key
|
||||
''
|
||||
Loading…
Add table
Add a link
Reference in a new issue