From 37165453a964310ff6d76baa677aa1b802095206 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Tue, 3 Sep 2024 16:30:01 +0100 Subject: [PATCH] plugins/lsp: use `mkPackageOption` for pylsp + rust-analyzer --- plugins/lsp/language-servers/pylsp.nix | 6 ++---- plugins/lsp/language-servers/rust-analyzer.nix | 14 ++++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/plugins/lsp/language-servers/pylsp.nix b/plugins/lsp/language-servers/pylsp.nix index 4aadd0fd..26b17f0d 100644 --- a/plugins/lsp/language-servers/pylsp.nix +++ b/plugins/lsp/language-servers/pylsp.nix @@ -11,10 +11,8 @@ let in { options.plugins.lsp.servers.pylsp = { - pythonPackage = mkOption { - type = lib.types.package; - description = "Python package to use for lsp."; - default = pkgs.python3; + pythonPackage = mkPackageOption pkgs "python" { + default = "python3"; }; # All settings are documented here: diff --git a/plugins/lsp/language-servers/rust-analyzer.nix b/plugins/lsp/language-servers/rust-analyzer.nix index 4b487a1b..62a66415 100644 --- a/plugins/lsp/language-servers/rust-analyzer.nix +++ b/plugins/lsp/language-servers/rust-analyzer.nix @@ -18,11 +18,8 @@ in description = "Whether to install `cargo`."; }; - cargoPackage = mkOption { - type = types.package; - default = pkgs.cargo; - description = "Which package to use for `cargo`."; - }; + # TODO: make nullable? + cargoPackage = mkPackageOption pkgs "cargo" { }; installRustc = mkOption { type = with types; nullOr bool; @@ -31,11 +28,8 @@ in description = "Whether to install `rustc`."; }; - rustcPackage = mkOption { - type = types.package; - default = pkgs.rustc; - description = "Which package to use for `rustc`."; - }; + # TODO: make nullable + rustcPackage = mkPackageOption pkgs "rustc" { }; }; config = mkIf cfg.enable { warnings =