systemd module: optionSet -> submodule

This commit is contained in:
Eric Sagnes 2016-09-13 12:56:36 +09:00
parent 78858f2f8d
commit 79f72966e6

View File

@ -389,13 +389,13 @@ in
systemd.units = mkOption { systemd.units = mkOption {
description = "Definition of systemd units."; description = "Definition of systemd units.";
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule (
options = { name, config, ... }: { name, config, ... }:
{ options = concreteUnitOptions; { options = concreteUnitOptions;
config = { config = {
unit = mkDefault (makeUnit name config); unit = mkDefault (makeUnit name config);
}; };
}; }));
}; };
systemd.packages = mkOption { systemd.packages = mkOption {
@ -406,43 +406,37 @@ in
systemd.targets = mkOption { systemd.targets = mkOption {
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule [ { options = targetOptions; } unitConfig] );
options = [ targetOptions unitConfig ];
description = "Definition of systemd target units."; description = "Definition of systemd target units.";
}; };
systemd.services = mkOption { systemd.services = mkOption {
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule [ { options = serviceOptions; } unitConfig serviceConfig ]);
options = [ serviceOptions unitConfig serviceConfig ];
description = "Definition of systemd service units."; description = "Definition of systemd service units.";
}; };
systemd.sockets = mkOption { systemd.sockets = mkOption {
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule [ { options = socketOptions; } unitConfig ]);
options = [ socketOptions unitConfig ];
description = "Definition of systemd socket units."; description = "Definition of systemd socket units.";
}; };
systemd.timers = mkOption { systemd.timers = mkOption {
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule [ { options = timerOptions; } unitConfig ]);
options = [ timerOptions unitConfig ];
description = "Definition of systemd timer units."; description = "Definition of systemd timer units.";
}; };
systemd.paths = mkOption { systemd.paths = mkOption {
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule [ { options = pathOptions; } unitConfig ]);
options = [ pathOptions unitConfig ];
description = "Definition of systemd path units."; description = "Definition of systemd path units.";
}; };
systemd.mounts = mkOption { systemd.mounts = mkOption {
default = []; default = [];
type = types.listOf types.optionSet; type = with types; listOf (submodule [ { options = mountOptions; } unitConfig mountConfig ]);
options = [ mountOptions unitConfig mountConfig ];
description = '' description = ''
Definition of systemd mount units. Definition of systemd mount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from This is a list instead of an attrSet, because systemd mandates the names to be derived from
@ -452,8 +446,7 @@ in
systemd.automounts = mkOption { systemd.automounts = mkOption {
default = []; default = [];
type = types.listOf types.optionSet; type = with types; listOf (submodule [ { options = automountOptions; } unitConfig automountConfig ]);
options = [ automountOptions unitConfig automountConfig ];
description = '' description = ''
Definition of systemd automount units. Definition of systemd automount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from This is a list instead of an attrSet, because systemd mandates the names to be derived from
@ -590,33 +583,30 @@ in
systemd.user.units = mkOption { systemd.user.units = mkOption {
description = "Definition of systemd per-user units."; description = "Definition of systemd per-user units.";
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule (
options = { name, config, ... }: { name, config, ... }:
{ options = concreteUnitOptions; { options = concreteUnitOptions;
config = { config = {
unit = mkDefault (makeUnit name config); unit = mkDefault (makeUnit name config);
}; };
}; }));
}; };
systemd.user.services = mkOption { systemd.user.services = mkOption {
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule [ { options = serviceOptions; } unitConfig serviceConfig ] );
options = [ serviceOptions unitConfig serviceConfig ];
description = "Definition of systemd per-user service units."; description = "Definition of systemd per-user service units.";
}; };
systemd.user.timers = mkOption { systemd.user.timers = mkOption {
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule [ { options = timerOptions; } unitConfig ] );
options = [ timerOptions unitConfig ];
description = "Definition of systemd per-user timer units."; description = "Definition of systemd per-user timer units.";
}; };
systemd.user.sockets = mkOption { systemd.user.sockets = mkOption {
default = {}; default = {};
type = types.attrsOf types.optionSet; type = with types; attrsOf (submodule [ { options = socketOptions; } unitConfig ] );
options = [ socketOptions unitConfig ];
description = "Definition of systemd per-user socket units."; description = "Definition of systemd per-user socket units.";
}; };