Skip to content

Commit 657df86

Browse files
authored
refactor(toString): remove some extra toString calls (#350)
unnecessary, those options take stringable
1 parent b20ea98 commit 657df86

4 files changed

Lines changed: 38 additions & 43 deletions

File tree

wrapperModules/h/helix/module.nix

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,23 @@ in
8282
};
8383
config.package = lib.mkDefault pkgs.helix;
8484
config.env = {
85-
XDG_CONFIG_HOME = builtins.toString (
86-
pkgs.linkFarm "helix-merged-config" (
87-
map
88-
(a: {
89-
inherit (a) path;
90-
name = "helix/" + a.name;
91-
})
92-
(
93-
let
94-
entry = name: path: { inherit name path; };
95-
in
96-
[
97-
(entry "config.toml" conf)
98-
(entry "languages.toml" langs)
99-
(entry "ignore" ignore)
100-
]
101-
++ themes
102-
)
103-
)
85+
XDG_CONFIG_HOME = pkgs.linkFarm "helix-merged-config" (
86+
map
87+
(a: {
88+
inherit (a) path;
89+
name = "helix/" + a.name;
90+
})
91+
(
92+
let
93+
entry = name: path: { inherit name path; };
94+
in
95+
[
96+
(entry "config.toml" conf)
97+
(entry "languages.toml" langs)
98+
(entry "ignore" ignore)
99+
]
100+
++ themes
101+
)
104102
);
105103
};
106104
config.meta.maintainers = [ wlib.maintainers.birdee ];

wrapperModules/n/notmuch/module.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
}:
88
let
99
iniFmt = pkgs.formats.ini { };
10-
writeNotmuchConfig = cfg: iniFmt.generate "notmuch.ini" cfg;
1110
in
1211
{
1312
imports = [ wlib.modules.default ];
@@ -36,7 +35,7 @@ in
3635
};
3736
configFile = lib.mkOption {
3837
type = wlib.types.file pkgs;
39-
default.path = toString (writeNotmuchConfig config.settings);
38+
default.path = iniFmt.generate "notmuch.ini" config.settings;
4039
description = ''
4140
Path or inline definition of the generated Notmuch configuration file.
4241

wrapperModules/w/waybar/module.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ in
5757

5858
config.package = lib.mkDefault config.pkgs.waybar;
5959
config.flags = {
60-
"--config" = toString config.configFile.path;
61-
"--style" = toString config."style.css".path;
60+
"--config" = config.configFile.path;
61+
"--style" = config."style.css".path;
6262
};
6363
config.filesToPatch = [
6464
"share/systemd/user/waybar.service"

wrapperModules/y/yazi/module.nix

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -440,26 +440,24 @@ in
440440

441441
config.package = lib.mkDefault pkgs.yazi;
442442
config.env = {
443-
YAZI_CONFIG_HOME = toString (
444-
pkgs.linkFarm "yazi-merged-config" (
445-
map
446-
(a: {
447-
inherit (a) path;
448-
name = a.name;
449-
})
450-
(
451-
let
452-
entry = name: path: { inherit name path; };
453-
in
454-
[
455-
(entry "yazi.toml" yazi)
456-
(entry "keymap.toml" keymap)
457-
(entry "theme.toml" theme)
458-
(entry "vfs.toml" vfs)
459-
(entry "package.toml" package)
460-
]
461-
)
462-
)
443+
YAZI_CONFIG_HOME = pkgs.linkFarm "yazi-merged-config" (
444+
map
445+
(a: {
446+
inherit (a) path;
447+
name = a.name;
448+
})
449+
(
450+
let
451+
entry = name: path: { inherit name path; };
452+
in
453+
[
454+
(entry "yazi.toml" yazi)
455+
(entry "keymap.toml" keymap)
456+
(entry "theme.toml" theme)
457+
(entry "vfs.toml" vfs)
458+
(entry "package.toml" package)
459+
]
460+
)
463461
);
464462
};
465463
config.meta.maintainers = [ wlib.maintainers.apetrovic6 ];

0 commit comments

Comments
 (0)