summary refs log tree commit diff
path: root/nixos/modules/system/boot
diff options
context:
space:
mode:
authorEric Sagnes <eric.sagnes@gmail.com>2016-10-21 01:31:54 +0900
committerEric Sagnes <eric.sagnes@gmail.com>2016-10-21 01:31:54 +0900
commit87318e9820d918dde9fb84cff1127c275f9dd790 (patch)
tree4abed90e9b28c8bd15c82ca28485b1354d4c0b2b /nixos/modules/system/boot
parent6adde2a5d931ace61ee06fd3d5789eab040143ff (diff)
downloadnixlib-87318e9820d918dde9fb84cff1127c275f9dd790.tar
nixlib-87318e9820d918dde9fb84cff1127c275f9dd790.tar.gz
nixlib-87318e9820d918dde9fb84cff1127c275f9dd790.tar.bz2
nixlib-87318e9820d918dde9fb84cff1127c275f9dd790.tar.lz
nixlib-87318e9820d918dde9fb84cff1127c275f9dd790.tar.xz
nixlib-87318e9820d918dde9fb84cff1127c275f9dd790.tar.zst
nixlib-87318e9820d918dde9fb84cff1127c275f9dd790.zip
nspawn module: optionSet -> submodule
Diffstat (limited to 'nixos/modules/system/boot')
-rw-r--r--nixos/modules/system/boot/systemd-nspawn.nix71
1 files changed, 36 insertions, 35 deletions
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
+          <literal>[Exec]</literal> section of this unit. See
+          <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
+          <manvolnum>5</manvolnum></citerefentry> 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
-        <literal>[Exec]</literal> section of this unit. See
-        <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
-        <manvolnum>5</manvolnum></citerefentry> 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
-        <literal>[Files]</literal> section of this unit. See
-        <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
-        <manvolnum>5</manvolnum></citerefentry> 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
+          <literal>[Files]</literal> section of this unit. See
+          <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
+          <manvolnum>5</manvolnum></citerefentry> 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
-        <literal>[Network]</literal> section of this unit. See
-        <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
-        <manvolnum>5</manvolnum></citerefentry> 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
+          <literal>[Network]</literal> section of this unit. See
+          <citerefentry><refentrytitle>systemd.nspawn</refentrytitle>
+          <manvolnum>5</manvolnum></citerefentry> 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.";
     };