-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathoptions.nix
90 lines (82 loc) · 2.01 KB
/
options.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{ lib, ... }:
let
partitionOptions = lib.types.submodule ({ config, ... }: {
options = {
name = lib.mkOption {
default = config._module.args.name;
type = lib.types.nullOr lib.types.str;
description = ''
Name of the partition
'';
};
start = lib.mkOption {
default = null;
type = lib.types.int;
description = ''
Start of the partition in sectors (512 byte)
'';
};
size = lib.mkOption {
default = null;
type = lib.types.nullOr lib.types.int;
description = ''
Size of the partition in sectors (512 byte).
Can be larger than the source image.
'';
};
source = lib.mkOption {
default = null;
type = lib.types.path;
description = ''
Source file that will be copied to partition
'';
};
attrs = lib.mkOption {
default = null;
example = "LegacyBIOSBootable";
type = lib.types.nullOr lib.types.str;
description = ''
Additional partition to
'';
};
type = lib.mkOption {
default = "0FC63DAF-8483-4772-8E79-3D69D8477DE4";
type = lib.types.str;
description = ''
Partition type. Defaults to `Linux filesystem`
'';
};
useBootPartition = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
Additional partition to
'';
};
};
});
in {
options = {
format = lib.mkOption {
default = "gpt";
type = lib.types.enum [ "gpt" "mbr" ];
description = ''
Partition format
'';
};
firstLba = lib.mkOption {
default = 64;
type = lib.types.int;
description = ''
first logical block
'';
};
partitions = lib.mkOption {
default = [];
description = ''
Partitions to create in the image
'';
type = lib.types.attrsOf partitionOptions;
};
};
}