feat(nvim): add config options to disable some LSPs
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-01-09 09:56:48 -05:00
parent aeae84f66d
commit 5cb0b971cc
6 changed files with 29 additions and 4 deletions

View file

@ -43,6 +43,12 @@
programs.neovim = { programs.neovim = {
enable = true; enable = true;
user = "nix-on-droid"; user = "nix-on-droid";
ideConfig = {
enableJava = false;
enableNix= false;
enablePython = false;
};
}; };
} }

View file

@ -19,6 +19,25 @@ in {
user = mkOption { user = mkOption {
type = types.str; type = types.str;
}; };
ideConfig = {
enableBash = mkOption {
type = types.bool;
default = true;
};
enableJava = mkOption {
type = types.bool;
default = true;
};
enableNix = mkOption {
type = types.bool;
default = true;
};
enablePython = mkOption {
type = types.bool;
default = true;
};
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -8,7 +8,7 @@
cfg = config.programs.neovim; cfg = config.programs.neovim;
in { in {
config = mkIf cfg.enable { config = mkIf (cfg.enable && cfg.ideConfig.enableBash) {
programs = { programs = {
# I love doing typos # I love doing typos
bash.shellAliases = { bash.shellAliases = {

View file

@ -10,7 +10,7 @@
javaSdk = pkgs.temurin-bin-21; javaSdk = pkgs.temurin-bin-21;
in { in {
config = mkIf cfg.enable { config = mkIf (cfg.enable && cfg.ideConfig.enableJava) {
programs = { programs = {
# We keep the packages here because java is a bit complicated # We keep the packages here because java is a bit complicated
java = { java = {

View file

@ -23,7 +23,7 @@ self: {
then "nixosConfigurations.${hostName}.options" then "nixosConfigurations.${hostName}.options"
else "nixOnDroidConfigurations.default"; else "nixOnDroidConfigurations.default";
in { in {
config = mkIf cfg.enable { config = mkIf (cfg.enable && cfg.ideConfig.enableNix) {
assertions = [ assertions = [
{ {
assertion = hasPrefix "${mainHmCfg.home.homeDirectory}/" flakeEnv; assertion = hasPrefix "${mainHmCfg.home.homeDirectory}/" flakeEnv;

View file

@ -15,7 +15,7 @@
}) })
++ py.python-lsp-server.optional-dependencies.all; ++ py.python-lsp-server.optional-dependencies.all;
in { in {
config = mkIf cfg.enable { config = mkIf (cfg.enable && cfg.ideConfig.enablePython) {
programs = { programs = {
neovim = { neovim = {
withPython3 = true; withPython3 = true;