Skip to content

Commit e30aa99

Browse files
committed
refactor(treewide): use wlib.types.structuredValueWith
1 parent 26f46b7 commit e30aa99

23 files changed

Lines changed: 123 additions & 126 deletions

File tree

wrapperModules/a/alacritty/module.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
pkgs,
66
...
77
}:
8-
let
9-
tomlFmt = pkgs.formats.toml { };
10-
in
118
{
129
imports = [ wlib.modules.default ];
1310
options = {
1411
settings = lib.mkOption {
15-
type = tomlFmt.type;
12+
type = wlib.types.structuredValueWith {
13+
nullable = false;
14+
typeName = "TOML";
15+
};
1616
default = { };
1717
description = ''
1818
Configuration of alacritty.

wrapperModules/a/atuin/module.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@
66
...
77
}:
88
let
9-
tomlFmt = pkgs.formats.toml { };
9+
tomlFmtType = wlib.types.structuredValueWith {
10+
nullable = false;
11+
typeName = "TOML";
12+
};
1013
in
1114
{
1215
imports = [ wlib.modules.default ];
1316

1417
options = {
1518
settings = lib.mkOption {
16-
type = tomlFmt.type;
19+
type = tomlFmtType;
1720
default = { };
1821
description = ''
1922
Atuin configuration options.
2023
'';
2124
};
2225
server-settings = lib.mkOption {
23-
type = tomlFmt.type;
26+
type = tomlFmtType;
2427
default = { };
2528
description = ''
2629
Atuin server configuration options.

wrapperModules/b/bottom/module.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
pkgs,
66
...
77
}:
8-
let
9-
tomlFmt = pkgs.formats.toml { };
10-
in
118
{
129
imports = [ wlib.modules.default ];
1310
options = {
1411
settings = lib.mkOption {
15-
type = tomlFmt.type;
12+
type = wlib.types.structuredValueWith {
13+
nullable = false;
14+
typeName = "TOML";
15+
};
1616
default = { };
1717
description = ''
1818
Configuration passed to `btm` using `--config_location` flag.

wrapperModules/c/claude-code/module.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
...
77
}:
88
let
9-
jsonFmt = pkgs.formats.json { };
9+
jsonFmtType = wlib.types.structuredValueWith { typeName = "JSON"; };
1010
in
1111
{
1212
imports = [ wlib.modules.default ];
1313

1414
options = {
1515

1616
agents = lib.mkOption {
17-
type = jsonFmt.type;
17+
type = jsonFmtType;
1818
default = { };
1919
description = ''
2020
Custom agents to add to Claude Code.
@@ -37,7 +37,7 @@ in
3737
};
3838

3939
mcpConfig = lib.mkOption {
40-
type = jsonFmt.type;
40+
type = jsonFmtType;
4141
default = { };
4242
description = ''
4343
MCP Server configuration
@@ -71,7 +71,7 @@ in
7171
};
7272

7373
settings = lib.mkOption {
74-
type = jsonFmt.type;
74+
type = jsonFmtType;
7575
default = { };
7676
description = ''
7777
Claude Code settings

wrapperModules/f/fastfetch/module.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
imports = [ wlib.modules.default ];
1010
options = {
1111
settings = lib.mkOption {
12-
type = lib.types.json or (pkgs.formats.json { }).type;
12+
type = wlib.types.structuredValueWith { typeName = "JSON"; };
1313
default = { };
1414
description = ''
1515
Configuration passed to fastfetch using `--config` flag

wrapperModules/g/glance/module.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
imports = [ wlib.modules.default ];
1010
options = {
1111
settings = lib.mkOption {
12-
inherit (pkgs.formats.yaml { }) type;
12+
type = wlib.types.structuredValueWith { typeName = "YAML 1.1"; };
1313
default = { };
1414
description = ''
1515
Configuration for glance.

wrapperModules/h/halloy/module.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
...
77
}:
88
let
9-
tomlFmt = pkgs.formats.toml { };
9+
tomlFmtType = wlib.types.structuredValueWith {
10+
nullable = false;
11+
typeName = "TOML";
12+
};
1013
in
1114
{
1215
imports = [ wlib.modules.default ];
1316
options = {
1417
settings = lib.mkOption {
15-
inherit (tomlFmt) type;
18+
type = tomlFmtType;
1619
default = { };
1720
description = ''
1821
Configuration settings for halloy. All available options can be
@@ -31,7 +34,7 @@ in
3134
themes = lib.mkOption {
3235
type = lib.types.attrsOf (
3336
lib.types.oneOf [
34-
tomlFmt.type
37+
tomlFmtType
3538
lib.types.lines
3639
lib.types.path
3740
]

wrapperModules/h/helix/module.nix

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
...
77
}:
88
let
9-
tomlFmt = pkgs.formats.toml { };
9+
tomlFmtType = wlib.types.structuredValueWith {
10+
nullable = false;
11+
typeName = "TOML";
12+
};
1013
hasConfig =
1114
config.settings != { }
1215
|| config.extraSettings != ""
@@ -18,7 +21,7 @@ in
1821
imports = [ wlib.modules.default ];
1922
options = {
2023
settings = lib.mkOption {
21-
type = tomlFmt.type;
24+
type = tomlFmtType;
2225
description = ''
2326
General settings
2427
See <https://docs.helix-editor.com/configuration.html>
@@ -33,7 +36,7 @@ in
3336
'';
3437
};
3538
languages = lib.mkOption {
36-
type = tomlFmt.type;
39+
type = tomlFmtType;
3740
description = ''
3841
Language specific settings
3942
See <https://docs.helix-editor.com/languages.html>
@@ -43,7 +46,7 @@ in
4346
themes = lib.mkOption {
4447
type = lib.types.attrsOf (
4548
lib.types.oneOf [
46-
tomlFmt.type
49+
tomlFmtType
4750
lib.types.lines
4851
]
4952
);

wrapperModules/h/himalaya/module.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
lib,
66
...
77
}:
8-
let
9-
tomlFmt = pkgs.formats.toml { };
10-
in
118
{
129
imports = [ wlib.modules.default ];
1310

1411
options = {
1512
settings = lib.mkOption {
16-
type = tomlFmt.type;
13+
type = wlib.types.structuredValueWith {
14+
nullable = false;
15+
typeName = "TOML";
16+
};
1717
default = { };
1818
description = ''
1919
Configuration for himalaya mail client CLI

wrapperModules/h/hyfetch/module.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
pkgs,
66
...
77
}:
8-
let
9-
jsonFormat = pkgs.formats.json { };
10-
in
118
{
129
imports = [ wlib.modules.default ];
1310
options = {
1411
settings = lib.mkOption {
15-
type = jsonFormat.type;
12+
type = wlib.types.structuredValueWith { typeName = "JSON"; };
1613
default = { };
1714
description = "JSON config for HyFetch";
1815
example = lib.literalExpression ''

0 commit comments

Comments
 (0)