nix-community.nixvim/plugins/null-ls/default.nix
Pedro Alves 4ddd3969e5
nixvim: support standalone nixvim
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition.

The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix.

For module development, the main change is that you should no longer prefix your modules with programs.nixvim..
2022-09-18 11:19:23 +01:00

47 lines
1 KiB
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.plugins.null-ls;
helpers = (import ../helpers.nix { inherit lib; });
in
{
imports = [
./servers.nix
];
options.plugins.null-ls = {
enable = mkEnableOption "Enable null-ls";
debug = mkOption {
default = null;
type = with types; nullOr bool;
};
sourcesItems = mkOption {
default = null;
# type = with types; nullOr (either (listOf str) (listOf attrsOf str));
type = with types; nullOr (listOf (attrsOf str));
description = "The list of sources to enable, should be strings of lua code. Don't use this directly";
};
# sources = mkOption {
# default = null;
# type = with types; nullOr attrs;
# };
};
config =
let
options = {
debug = cfg.debug;
sources = cfg.sourcesItems;
};
in
mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ null-ls-nvim ];
extraConfigLua = ''
require("null-ls").setup(${helpers.toLuaObject options})
'';
};
}