{ pkgs, lib, config, ... }: with lib; let cfg = config.modules.system.nix-ld; in { options.modules.system.nix-ld = { enable = mkOption { type = types.bool; default = any (user: user.modules.user.neovim.enable or false) (attrValues config.home-manager.users); description = "Enable nix-ld so Mason-installed Neovim tools can run on NixOS."; }; }; config = mkIf cfg.enable { programs.nix-ld = { enable = true; libraries = with pkgs; [ curl expat fontconfig freetype glib icu libgcc libGL libxkbcommon openssl stdenv.cc.cc zlib zstd ]; }; }; }