File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 77 ...
88} :
99let
10- # TODO: Consider expanding to handle `file` and `draid` mode options .
10+ # TODO: Consider expanding to handle `file` mode option .
1111 modeOptions = [
1212 ""
1313 "mirror"
1616 "raidz2"
1717 "raidz3"
1818 ] ;
19+ zpoolModeType = lib . types . mkOptionType {
20+ name = "zpoolMode" ;
21+ description = "valid modes for a zpool" ;
22+ descriptionClass = "noun" ;
23+ check = ( x : lib . isString x && ( builtins . elem x modeOptions || lib . strings . hasPrefix "draid" x ) ) ;
24+ } ;
1925in
2026{
2127 options = {
7278 } ;
7379 type = (
7480 lib . types . oneOf [
75- ( lib . types . enum modeOptions )
81+ ( zpoolModeType )
7682 ( lib . types . attrsOf (
7783 diskoLib . subType {
7884 types = {
8389 {
8490 options = {
8591 mode = lib . mkOption {
86- type = lib . types . enum modeOptions ;
92+ type = zpoolModeType ;
8793 default = "" ;
8894 description = "Mode of the zfs vdev" ;
8995 } ;
You can’t perform that action at this time.
0 commit comments