@@ -41,41 +41,43 @@ let
4141 ];
4242
4343 instanceOptions = {
44+ options = {
45+
46+ execConfig = mkOption {
47+ default = {};
48+ example = { Parameters = "/bin/sh"; };
49+ type = types.addCheck (types.attrsOf unitOption) checkExec;
50+ description = ''
51+ Each attribute in this set specifies an option in the
52+ <literal>[Exec]</literal> section of this unit. See
53+ <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
54+ <manvolnum>5</manvolnum></citerefentry> for details.
55+ '';
56+ };
4457
45− execConfig = mkOption {
46− default = {};
47− example = { Parameters = "/bin/sh"; };
48− type = types.addCheck (types.attrsOf unitOption) checkExec;
49− description = ''
50− Each attribute in this set specifies an option in the
51− <literal>[Exec]</literal> section of this unit. See
52− <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
53− <manvolnum>5</manvolnum></citerefentry> for details.
54− '';
55− };
56−
57− filesConfig = mkOption {
58− default = {};
59− example = { Bind = [ "/home/alice" ]; };
60− type = types.addCheck (types.attrsOf unitOption) checkFiles;
61− description = ''
62− Each attribute in this set specifies an option in the
63− <literal>[Files]</literal> section of this unit. See
64− <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
65− <manvolnum>5</manvolnum></citerefentry> for details.
66− '';
67− };
58+ filesConfig = mkOption {
59+ default = {};
60+ example = { Bind = [ "/home/alice" ]; };
61+ type = types.addCheck (types.attrsOf unitOption) checkFiles;
62+ description = ''
63+ Each attribute in this set specifies an option in the
64+ <literal>[Files]</literal> section of this unit. See
65+ <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
66+ <manvolnum>5</manvolnum></citerefentry> for details.
67+ '';
68+ };
6869
69− networkConfig = mkOption {
70− default = {};
71− example = { Private = false; };
72− type = types.addCheck (types.attrsOf unitOption) checkNetwork;
73− description = ''
74− Each attribute in this set specifies an option in the
75− <literal>[Network]</literal> section of this unit. See
76− <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
77− <manvolnum>5</manvolnum></citerefentry> for details.
78− '';
70+ networkConfig = mkOption {
71+ default = {};
72+ example = { Private = false; };
73+ type = types.addCheck (types.attrsOf unitOption) checkNetwork;
74+ description = ''
75+ Each attribute in this set specifies an option in the
76+ <literal>[Network]</literal> section of this unit. See
77+ <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
78+ <manvolnum>5</manvolnum></citerefentry> for details.
79+ '';
80+ };
7981 };
8082
8183 };
@@ -99,8 +101,7 @@ in {
99101
100102 systemd.nspawn = mkOption {
101103 default = {};
102− type = types.attrsOf types.optionSet;
103− options = [ instanceOptions ];
104+ type = with types; attrsOf (submodule instanceOptions);
104105 description = "Definition of systemd-nspawn configurations.";
105106 };
106107