diff --git a/extras/mk-enc-usb.nix b/extras/mk-enc-usb.nix index 6d50ca3..dfee09d 100644 --- a/extras/mk-enc-usb.nix +++ b/extras/mk-enc-usb.nix @@ -21,12 +21,6 @@ in (writeShellApplication { # e.g /dev/sdb USB_DEVICE=$1 - if echo "$USB_DEVICE" | grep -q "[0-9]$"; then - PARTITION_SEPARATOR="p" - else - PARTITION_SEPARATOR="" - fi - if [ "$EUID" -ne 0 ]; then echo "Please run as root" exit @@ -39,10 +33,10 @@ in (writeShellApplication { parted "$USB_DEVICE" -- mkpart primary 0% 100% echo "Creating Encrypted Partition" - cryptsetup luksFormat "''${USB_DEVICE}''${PARTITION_SEPARATOR}1" + cryptsetup luksFormat "$USB_DEVICE" echo "Opening Encrypted Partition" - cryptsetup open "''${USB_DEVICE}''${PARTITION_SEPARATOR}1" "mk_enc_usb" + cryptsetup open "$USB_DEVICE" "mk_enc_usb" echo "Making Encrypted Filesystem" mkfs.ext4 -L "${encryptedUSBData.unencryptedLabel}" /dev/mapper/mk_enc_usb