-
Notifications
You must be signed in to change notification settings - Fork 0
/
gh-form-options.nix
121 lines (106 loc) · 4.89 KB
/
gh-form-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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{ lib, ... }:
let
docs-url = "https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms";
field-docs-url = "https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#about-githubs-form-schema";
optsLib = import ../options-lib.nix { inherit lib; };
name.default = null;
name.example = "Bug report";
name.type = optsLib.nullOrNonEmptyString;
name.description = ''
A name for the issue form template
see [github documentations](${docs-url}#top-level-syntax)
'';
description.example = "File a bug report";
description.type = lib.types.nonEmptyStr;
description.description = ''
A description for the issue form template
see [github documentations](${docs-url}#top-level-syntax)
'';
title.default = null;
title.example = "[Bug]: ";
title.type = optsLib.nullOrNonEmptyString;
title.description = ''
Default title of issue
see [github documentations](${docs-url}#top-level-syntax)
'';
labels.default = [];
labels.example = ["bug" "critical"];
labels.type = optsLib.listOfNonEmptyStr;
labels.description = ''
Labels to this kind of issue
see [github documentations](${docs-url}#top-level-syntax)
'';
assignees.default = [];
assignees.example = ["hugosenari"];
assignees.type = optsLib.listOfNonEmptyStr;
assignees.description = ''
List of assignees to this kind of issue
see [github documentations](${docs-url}#top-level-syntax)
'';
inputs = import ./input.nix { inherit lib; };
input.default = {};
input.type = lib.types.attrsOf (optsLib.submoduleOf inputs);
input.example.frequency.description = "How many times it happens";
input.example.frequency.label = "Frequency";
input.description = ''
Github forms body input fields
gh-forms.<file-name>.input.<field-id>.label = "<label>";
gh-forms.<file-name>.input.<field-id>.description = "<description>";
See [github documentations](${field-docs-url}#input)
'';
texts = import ./text.nix { inherit lib; };
text.default = {};
text.type = lib.types.attrsOf (optsLib.submoduleOf texts);
text.example.greeting.description = "Insert your greeting message";
text.example.greeting.label = "Greeting message";
text.description = ''
Github forms body text fields
gh-forms.<file-name>.text.<field-id>.label = "<label>";
gh-forms.<file-name>.text.<field-id>.description = "<description>";
See [github documentations](${field-docs-url}#textarea)
'';
markdowns = import ./markdown.nix { inherit lib; };
markdown.default = {};
markdown.type = lib.types.attrsOf (optsLib.submoduleOf markdowns);
markdown.example.some.required = true;
markdown.example.some.value = "Some markdown text";
markdown.description = ''
Github forms body markdown fields
gh-forms.<file-name>.markdown.<field-id>.required = true;
gh-forms.<file-name>.markdown.<field-id>.value = "<value>";
See [github documentations](${field-docs-url}#input)
'';
drops = import ./dropdown.nix { inherit lib; };
dropdown.default = {};
dropdown.type = lib.types.attrsOf (optsLib.submoduleOf drops);
dropdown.example.greeting-type.description = "Types of greeting message";
dropdown.example.greeting-type.label = "Greeting type";
dropdown.description = ''
Github forms body dropdown fields
gh-forms.<file-name>.dropdown.<field-id>.label = "<label>";
gh-forms.<file-name>.dropdown.<field-id>.description = "<description>";
See [github documentations](${field-docs-url}#dropdown)
'';
checks = import ./checkboxes.nix { inherit lib; };
checkboxes.default = {};
checkboxes.type = lib.types.attrsOf (optsLib.submoduleOf checks);
checkboxes.example.agreement.description = "Check to confirm";
checkboxes.example.agreement.label = "Are you sure?";
checkboxes.description = ''
Github forms body dropdown fields
gh-forms.<file-name>.checkboxes.<field-id>.label = "<label>";
gh-forms.<file-name>.checkboxes.<field-id>.description = "<description>";
See [github documentations](${field-docs-url}#checkboxes)
'';
gh-forms = {
inherit name description title labels assignees;
inherit input markdown text dropdown checkboxes;
};
gh-form.default = {};
gh-form.example = import ../.github/form.nix;
gh-form.type = lib.types.attrsOf (optsLib.submoduleOf gh-forms);
gh-form.description = ''
Disable auto rebase (enabled by default)
see [github documentations](${docs-url}#registries)
'';
in optsLib.optionsOf { inherit gh-form; }