File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 57
57
or a fully specified GUID (see https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs).
58
58
'' ;
59
59
} ;
60
+ attributes = lib . mkOption {
61
+ type = lib . types . listOf lib . types . int ;
62
+ default = [ ] ;
63
+ description = ''
64
+ GPT partition entry attributes, according to UEFI specification
65
+ 2.10 (see https://uefi.org/specs/UEFI/2.10_A/05_GUID_Partition_Table_Format.html#defined-gpt-partition-entry-attributes)
66
+ and `sgdisk`s man page:
67
+
68
+ - 0: Required Partition (`sgdisk`: system partition)
69
+ - 1: No Block IO Protocol (`sgdisk`: hide from EFI)
70
+ - 2: Legacy BIOS Bootable
71
+ - 3-47: Undefined and must be zero, reserved for future use
72
+ - 48-63: Reserved for GUID specific use. The use of these bits
73
+ will vary depending on the partition type
74
+
75
+ `sgdisk` describes some of the GUID-specific bits this way:
76
+ - 60: read only
77
+ - 62: hidden
78
+ - 63: do not automount
79
+ '' ;
80
+ } ;
60
81
device = lib . mkOption {
61
82
type = lib . types . str ;
62
83
default =
268
289
} " \
269
290
--change-name="${ toString partition . _index } :${ partition . label } " \
270
291
--typecode=${ toString partition . _index } :${ partition . type } \
292
+ --attributes=${ toString partition . _index } :=:0 \
293
+ ${
294
+ lib . concatStringsSep " \\ \n " (
295
+ builtins . map (
296
+ bitNumber : "--attributes=${ toString partition . _index } :set:${ toString bitNumber } "
297
+ ) partition . attributes
298
+ )
299
+ } \
271
300
"${ config . device } " \
272
301
'' ;
273
302
createArgs = ''
You can’t perform that action at this time.
0 commit comments