From 87318e9820d918dde9fb84cff1127c275f9dd790 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Fri, 21 Oct 2016 01:31:54 +0900 Subject: [PATCH] nspawn module: optionSet -> submodule --- nixos/modules/system/boot/systemd-nspawn.nix | 69 ++++++++++---------- 1 file changed, 35 insertions(+), 34 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 - [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."; };