0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-12 05:16:25 +03:00

nixos/treewide: Add last missing option types

Co-Authored-By: Janne Heß <janne@hess.ooo>
This commit is contained in:
Silvan Mosberger 2022-02-28 22:18:28 +01:00
parent f5645dd73b
commit b2d803ca57
6 changed files with 30 additions and 14 deletions

View file

@ -194,19 +194,8 @@ let
zone.children zone.children
); );
# fighting infinite recursion
zoneOptions = zoneOptionsRaw // childConfig zoneOptions1 true;
zoneOptions1 = zoneOptionsRaw // childConfig zoneOptions2 false;
zoneOptions2 = zoneOptionsRaw // childConfig zoneOptions3 false;
zoneOptions3 = zoneOptionsRaw // childConfig zoneOptions4 false;
zoneOptions4 = zoneOptionsRaw // childConfig zoneOptions5 false;
zoneOptions5 = zoneOptionsRaw // childConfig zoneOptions6 false;
zoneOptions6 = zoneOptionsRaw // childConfig null false;
childConfig = x: v: { options.children = { type = types.attrsOf x; visible = v; }; };
# options are ordered alphanumerically # options are ordered alphanumerically
zoneOptionsRaw = types.submodule { zoneOptions = types.submodule {
options = { options = {
allowAXFRFallback = mkOption { allowAXFRFallback = mkOption {
@ -246,6 +235,13 @@ let
}; };
children = mkOption { children = mkOption {
# TODO: This relies on the fact that `types.anything` doesn't set any
# values of its own to any defaults, because in the above zoneConfigs',
# values from children override ones from parents, but only if the
# attributes are defined. Because of this, we can't replace the element
# type here with `zoneConfigs`, since that would set all the attributes
# to default values, breaking the parent inheriting function.
type = types.attrsOf types.anything;
default = {}; default = {};
description = '' description = ''
Children zones inherit all options of their parents. Attributes Children zones inherit all options of their parents. Attributes

View file

@ -62,6 +62,7 @@ in {
}; };
stateDir = mkOption { stateDir = mkOption {
type = types.path;
default = "/var/lib/unbound"; default = "/var/lib/unbound";
description = "Directory holding all state for unbound to run."; description = "Directory holding all state for unbound to run.";
}; };

View file

@ -153,6 +153,7 @@ in
userlist = mkOption { userlist = mkOption {
default = []; default = [];
type = types.listOf types.str;
description = "See <option>userlistFile</option>."; description = "See <option>userlistFile</option>.";
}; };

View file

@ -219,6 +219,24 @@ in
session = mkOption { session = mkOption {
default = []; default = [];
type = with types; listOf (submodule ({ ... }: {
options = {
manage = mkOption {
description = "Whether this is a desktop or a window manager";
type = enum [ "desktop" "window" ];
};
name = mkOption {
description = "Name of this session";
type = str;
};
start = mkOption {
description = "Commands to run to start this session";
type = lines;
};
};
}));
example = literalExpression example = literalExpression
'' ''
[ { manage = "desktop"; [ { manage = "desktop";

View file

@ -36,7 +36,7 @@ in
boot.kernelPackages = mkOption { boot.kernelPackages = mkOption {
default = pkgs.linuxPackages; default = pkgs.linuxPackages;
type = types.unspecified // { merge = mergeEqualOption; }; type = types.raw;
apply = kernelPackages: kernelPackages.extend (self: super: { apply = kernelPackages: kernelPackages.extend (self: super: {
kernel = super.kernel.override (originalArgs: { kernel = super.kernel.override (originalArgs: {
inherit randstructSeed; inherit randstructSeed;

View file

@ -581,7 +581,7 @@ in
else "gzip" else "gzip"
); );
defaultText = literalDocBook "<literal>zstd</literal> if the kernel supports it (5.9+), <literal>gzip</literal> if not"; defaultText = literalDocBook "<literal>zstd</literal> if the kernel supports it (5.9+), <literal>gzip</literal> if not";
type = types.unspecified; # We don't have a function type... type = types.either types.str (types.functionTo types.str);
description = '' description = ''
The compressor to use on the initrd image. May be any of: The compressor to use on the initrd image. May be any of: