diff --git a/nixos/modules/system/boot/systemd-nspawn.nix b/nixos/modules/system/boot/systemd-nspawn.nix
index 2527ab35719b..f765db275e79 100644
--- a/nixos/modules/system/boot/systemd-nspawn.nix
+++ b/nixos/modules/system/boot/systemd-nspawn.nix
@@ -41,41 +41,43 @@ let
];
instanceOptions = {
+ options = {
- execConfig = mkOption {
- default = {};
- example = { Parameters = "/bin/sh"; };
- type = types.addCheck (types.attrsOf unitOption) checkExec;
- description = ''
- Each attribute in this set specifies an option in the
- [Exec] section of this unit. See
- systemd.nspawn
- 5 for details.
- '';
- };
+ execConfig = mkOption {
+ default = {};
+ example = { Parameters = "/bin/sh"; };
+ type = types.addCheck (types.attrsOf unitOption) checkExec;
+ description = ''
+ Each attribute in this set specifies an option in the
+ [Exec] section of this unit. See
+ systemd.nspawn
+ 5 for details.
+ '';
+ };
- filesConfig = mkOption {
- default = {};
- example = { Bind = [ "/home/alice" ]; };
- type = types.addCheck (types.attrsOf unitOption) checkFiles;
- description = ''
- Each attribute in this set specifies an option in the
- [Files] section of this unit. See
- systemd.nspawn
- 5 for details.
- '';
- };
+ filesConfig = mkOption {
+ default = {};
+ example = { Bind = [ "/home/alice" ]; };
+ type = types.addCheck (types.attrsOf unitOption) checkFiles;
+ description = ''
+ Each attribute in this set specifies an option in the
+ [Files] section of this unit. See
+ systemd.nspawn
+ 5 for details.
+ '';
+ };
- networkConfig = mkOption {
- default = {};
- example = { Private = false; };
- type = types.addCheck (types.attrsOf unitOption) checkNetwork;
- description = ''
- Each attribute in this set specifies an option in the
- [Network] section of this unit. See
- systemd.nspawn
- 5 for details.
- '';
+ networkConfig = mkOption {
+ default = {};
+ example = { Private = false; };
+ type = types.addCheck (types.attrsOf unitOption) checkNetwork;
+ description = ''
+ Each attribute in this set specifies an option in the
+ [Network] section of this unit. See
+ systemd.nspawn
+ 5 for details.
+ '';
+ };
};
};
@@ -99,8 +101,7 @@ in {
systemd.nspawn = mkOption {
default = {};
- type = types.attrsOf types.optionSet;
- options = [ instanceOptions ];
+ type = with types; attrsOf (submodule instanceOptions);
description = "Definition of systemd-nspawn configurations.";
};