modules/output: avoid using global with lib;

This commit is contained in:
Stanislav Asunkin 2024-07-07 18:50:30 +03:00 committed by traxys
parent 6387299364
commit 119f12db27

View file

@ -5,7 +5,10 @@
helpers, helpers,
... ...
}: }:
with lib; let
inherit (lib) types mkOption;
inherit (lib) optional optionalString optionalAttrs;
in
{ {
options = { options = {
viAlias = mkOption { viAlias = mkOption {
@ -97,7 +100,7 @@ with lib;
# Necessary to make sure the runtime path is set properly in NixOS 22.05, # Necessary to make sure the runtime path is set properly in NixOS 22.05,
# or more generally before the commit: # or more generally before the commit:
# cda1f8ae468 - neovim: pass packpath via the wrapper # cda1f8ae468 - neovim: pass packpath via the wrapper
// optionalAttrs (functionArgs pkgs.neovimUtils.makeNeovimConfig ? configure) { // optionalAttrs (lib.functionArgs pkgs.neovimUtils.makeNeovimConfig ? configure) {
configure.packages = { configure.packages = {
nixvim = { nixvim = {
start = map (x: x.plugin) normalizedPlugins; start = map (x: x.plugin) normalizedPlugins;
@ -115,7 +118,9 @@ with lib;
init = helpers.writeLua "init.lua" customRC; init = helpers.writeLua "init.lua" customRC;
extraWrapperArgs = builtins.concatStringsSep " " ( extraWrapperArgs = builtins.concatStringsSep " " (
(optional (config.extraPackages != [ ]) ''--prefix PATH : "${makeBinPath config.extraPackages}"'') (optional (
config.extraPackages != [ ]
) ''--prefix PATH : "${lib.makeBinPath config.extraPackages}"'')
++ (optional config.wrapRc ''--add-flags -u --add-flags "${init}"'') ++ (optional config.wrapRc ''--add-flags -u --add-flags "${init}"'')
); );