From d0fd785c93e69adbf28c271cfce1e6a36eae9ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 15 Nov 2022 19:30:09 +0100 Subject: [PATCH] make device matching regexes a bit stricter --- types.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types.nix b/types.nix index c26cf0b..fe04e9c 100644 --- a/types.nix +++ b/types.nix @@ -51,11 +51,11 @@ rec { => "/dev/disk/by-id/xxx-part2" */ deviceNumbering = dev: index: - if match "/dev/[vs]d.*" dev != null then + if match "/dev/[vs]d.+" dev != null then dev + toString index # /dev/{s,v}da style - else if match "/dev/disk/.*" dev != null then + else if match "/dev/disk/.+" dev != null then "${dev}-part${toString index}" # /dev/disk/by-id/xxx style - else if match "/dev/(nvme|md/|mmcblk).*" dev != null then + else if match "/dev/(nvme|md/|mmcblk).+" dev != null then "${dev}p${toString index}" # /dev/nvme0n1p1 style else abort "${dev} seems not to be a supported disk format";