File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 52
52
description = "Metadata" ;
53
53
} ;
54
54
55
+ _createFilesystem = lib . mkOption {
56
+ internal = true ;
57
+ type = lib . types . bool ;
58
+ default = true ;
59
+ } ;
60
+
55
61
_create = diskoLib . mkCreateOption
56
62
{
57
63
inherit config options ;
77
83
in
78
84
''
79
85
if ! zfs get type ${ config . _name } >/dev/null 2>&1; then
80
- zfs create -up ${ config . _name } \
81
- ${ lib . concatStringsSep " " ( lib . mapAttrsToList ( n : v : "-o ${ n } =${ v } " ) ( createOptions ) ) }
86
+ ${ if config . _createFilesystem then ''
87
+ zfs create -up ${ config . _name } \
88
+ ${ lib . concatStringsSep " " ( lib . mapAttrsToList ( n : v : "-o ${ n } =${ v } " ) ( createOptions ) ) }
89
+ '' else ''
90
+ # don't create anything for root dataset of zpools
91
+ true
92
+ '' }
82
93
${ lib . optionalString ( updateOptions != { } ) ''
83
94
else
84
95
zfs set -u ${ lib . concatStringsSep " " ( lib . mapAttrsToList ( n : v : "${ n } =${ v } " ) updateOptions ) } ${ config . _name }
85
96
'' }
86
97
fi
87
98
'' ;
88
- } // { readOnly = false ; } ;
99
+ } ;
89
100
90
101
_mount = diskoLib . mkMountOption {
91
102
inherit config options ;
Original file line number Diff line number Diff line change 253
253
config = {
254
254
datasets . "__root" = {
255
255
_name = config . name ;
256
- _create = "" ;
256
+ _createFilesystem = false ;
257
257
type = "zfs_fs" ;
258
258
mountpoint = config . mountpoint ;
259
259
options = config . rootFsOptions ;
You can’t perform that action at this time.
0 commit comments