support zvol with disko

this is useful for quick testing.
This commit is contained in:
Jörg Thalheim 2023-02-02 14:11:49 +01:00
parent 9f58230409
commit 78ea07107a

View File

@ -55,12 +55,14 @@ rec {
deviceNumbering = dev: index:
if match "/dev/[vs]d.+" dev != null then
dev + toString index # /dev/{s,v}da style
else if match "/dev/disk/.+" dev != null then
"${dev}-part${toString index}" # /dev/disk/by-id/xxx style
else if match "/dev/(disk|zvol)/.+" dev != null then
"${dev}-part${toString index}" # /dev/disk/by-id/xxx style, also used by zfs's zvolumes
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";
abort ''
${dev} seems not to be a supported disk format. Please add this to disko in https://github.com/nix-community/disko/blob/master/types/default.nix
'';
/* A nix option type representing a json datastructure, vendored from nixpkgs to avoid dependency on pkgs */
jsonType =