dev: pkgOrStr function to help decide lsp server cmd

This commit is contained in:
raf 2023-08-11 10:14:36 +03:00
commit 105fe86f74
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29

View file

@ -1,6 +1,6 @@
{lib}:
with lib; let
diagnosticSubmodule = {...}: {
diagnosticSubmodule = _: {
options = {
type = mkOption {
description = "Type of diagnostic to enable";
@ -28,4 +28,10 @@ in {
mkPackageOption pkgs ["${grammar} treesitter"] {
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
};
# helper function to return the desired value based on entry type in lsp server cmd
pkgOrStr = v:
if builtins.isString v
then v
else lib.getExe v;
}