Skip to content

Commit b2d803c

Browse files
infinisildasJ
andcommitted
nixos/treewide: Add last missing option types
Co-Authored-By: Janne Heß <janne@hess.ooo>
1 parent f5645dd commit b2d803c

6 files changed

Lines changed: 30 additions & 14 deletions

File tree

nixos/modules/services/networking/nsd.nix

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,19 +194,8 @@ let
194194
zone.children
195195
);
196196

197-
# fighting infinite recursion
198-
zoneOptions = zoneOptionsRaw // childConfig zoneOptions1 true;
199-
zoneOptions1 = zoneOptionsRaw // childConfig zoneOptions2 false;
200-
zoneOptions2 = zoneOptionsRaw // childConfig zoneOptions3 false;
201-
zoneOptions3 = zoneOptionsRaw // childConfig zoneOptions4 false;
202-
zoneOptions4 = zoneOptionsRaw // childConfig zoneOptions5 false;
203-
zoneOptions5 = zoneOptionsRaw // childConfig zoneOptions6 false;
204-
zoneOptions6 = zoneOptionsRaw // childConfig null false;
205-
206-
childConfig = x: v: { options.children = { type = types.attrsOf x; visible = v; }; };
207-
208197
# options are ordered alphanumerically
209-
zoneOptionsRaw = types.submodule {
198+
zoneOptions = types.submodule {
210199
options = {
211200

212201
allowAXFRFallback = mkOption {
@@ -246,6 +235,13 @@ let
246235
};
247236

248237
children = mkOption {
238+
# TODO: This relies on the fact that `types.anything` doesn't set any
239+
# values of its own to any defaults, because in the above zoneConfigs',
240+
# values from children override ones from parents, but only if the
241+
# attributes are defined. Because of this, we can't replace the element
242+
# type here with `zoneConfigs`, since that would set all the attributes
243+
# to default values, breaking the parent inheriting function.
244+
type = types.attrsOf types.anything;
249245
default = {};
250246
description = ''
251247
Children zones inherit all options of their parents. Attributes

nixos/modules/services/networking/unbound.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ in {
6262
};
6363

6464
stateDir = mkOption {
65+
type = types.path;
6566
default = "/var/lib/unbound";
6667
description = "Directory holding all state for unbound to run.";
6768
};

nixos/modules/services/networking/vsftpd.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ in
153153

154154
userlist = mkOption {
155155
default = [];
156+
type = types.listOf types.str;
156157
description = "See <option>userlistFile</option>.";
157158
};
158159

nixos/modules/services/x11/display-managers/default.nix

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,24 @@ in
219219

220220
session = mkOption {
221221
default = [];
222+
type = with types; listOf (submodule ({ ... }: {
223+
options = {
224+
manage = mkOption {
225+
description = "Whether this is a desktop or a window manager";
226+
type = enum [ "desktop" "window" ];
227+
};
228+
229+
name = mkOption {
230+
description = "Name of this session";
231+
type = str;
232+
};
233+
234+
start = mkOption {
235+
description = "Commands to run to start this session";
236+
type = lines;
237+
};
238+
};
239+
}));
222240
example = literalExpression
223241
''
224242
[ { manage = "desktop";

nixos/modules/system/boot/kernel.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ in
3636

3737
boot.kernelPackages = mkOption {
3838
default = pkgs.linuxPackages;
39-
type = types.unspecified // { merge = mergeEqualOption; };
39+
type = types.raw;
4040
apply = kernelPackages: kernelPackages.extend (self: super: {
4141
kernel = super.kernel.override (originalArgs: {
4242
inherit randstructSeed;

nixos/modules/system/boot/stage-1.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ in
581581
else "gzip"
582582
);
583583
defaultText = literalDocBook "<literal>zstd</literal> if the kernel supports it (5.9+), <literal>gzip</literal> if not";
584-
type = types.unspecified; # We don't have a function type...
584+
type = types.either types.str (types.functionTo types.str);
585585
description = ''
586586
The compressor to use on the initrd image. May be any of:
587587

0 commit comments

Comments
 (0)