mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
treewide: use mkWarnings where possible
This commit is contained in:
parent
abba4af10b
commit
12e658eca8
34 changed files with 309 additions and 225 deletions
|
@ -21,13 +21,16 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
warnings = lib.optional (cfg.installGhc == null) ''
|
||||
`hls` relies on `ghc` (the Glasgow Haskell Compiler).
|
||||
- Set `plugins.lsp.servers.hls.installGhc = true` to install it automatically with Nixvim.
|
||||
You can customize which package to install by changing `plugins.lsp.servers.hls.ghcPackage`.
|
||||
- Set `plugins.lsp.servers.hls.installGhc = false` to not have it install through Nixvim.
|
||||
By doing so, you will dismiss this warning.
|
||||
'';
|
||||
warnings = lib.nixvim.mkWarnings "plugins.lsp.servers.hls" {
|
||||
when = cfg.installGhc == null;
|
||||
message = ''
|
||||
`hls` relies on `ghc` (the Glasgow Haskell Compiler).
|
||||
- Set `plugins.lsp.servers.hls.installGhc = true` to install it automatically with Nixvim.
|
||||
You can customize which package to install by changing `plugins.lsp.servers.hls.ghcPackage`.
|
||||
- Set `plugins.lsp.servers.hls.installGhc = false` to not have it install through Nixvim.
|
||||
By doing so, you will dismiss this warning.
|
||||
'';
|
||||
};
|
||||
|
||||
extraPackages = lib.optional ((lib.isBool cfg.installGhc) && cfg.installGhc) cfg.ghcPackage;
|
||||
};
|
||||
|
|
|
@ -41,27 +41,36 @@ in
|
|||
rustfmtPackage = mkPackageOption pkgs "rustfmt" { };
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
warnings =
|
||||
(lib.optional (cfg.installCargo == null) ''
|
||||
`rust_analyzer` relies on `cargo`.
|
||||
- Set `plugins.lsp.servers.rust_analyzer.installCargo = true` to install it automatically
|
||||
with Nixvim.
|
||||
You can customize which package to install by changing
|
||||
`plugins.lsp.servers.rust_analyzer.cargoPackage`.
|
||||
- Set `plugins.lsp.servers.rust_analyzer.installCargo = false` to not have it install
|
||||
through Nixvim.
|
||||
By doing so, you will dismiss this warning.
|
||||
'')
|
||||
++ (lib.optional (cfg.installRustc == null) ''
|
||||
`rust_analyzer` relies on `rustc`.
|
||||
- Set `plugins.lsp.servers.rust_analyzer.installRustc = true` to install it automatically
|
||||
with Nixvim.
|
||||
You can customize which package to install by changing
|
||||
`plugins.lsp.servers.rust_analyzer.rustcPackage`.
|
||||
- Set `plugins.lsp.servers.rust_analyzer.installRustc = false` to not have it install
|
||||
through Nixvim.
|
||||
By doing so, you will dismiss this warning.
|
||||
'');
|
||||
warnings = lib.nixvim.mkWarnings "plugins.lsp.servers.rust_analyzer" [
|
||||
{
|
||||
when = cfg.installCargo == null;
|
||||
|
||||
message = ''
|
||||
`rust_analyzer` relies on `cargo`.
|
||||
- Set `plugins.lsp.servers.rust_analyzer.installCargo = true` to install it automatically
|
||||
with Nixvim.
|
||||
You can customize which package to install by changing
|
||||
`plugins.lsp.servers.rust_analyzer.cargoPackage`.
|
||||
- Set `plugins.lsp.servers.rust_analyzer.installCargo = false` to not have it install
|
||||
through Nixvim.
|
||||
By doing so, you will dismiss this warning.
|
||||
'';
|
||||
}
|
||||
{
|
||||
when = cfg.installRustc == null;
|
||||
|
||||
message = ''
|
||||
`rust_analyzer` relies on `rustc`.
|
||||
- Set `plugins.lsp.servers.rust_analyzer.installRustc = true` to install it automatically
|
||||
with Nixvim.
|
||||
You can customize which package to install by changing
|
||||
`plugins.lsp.servers.rust_analyzer.rustcPackage`.
|
||||
- Set `plugins.lsp.servers.rust_analyzer.installRustc = false` to not have it install
|
||||
through Nixvim.
|
||||
By doing so, you will dismiss this warning.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
extraPackages =
|
||||
let
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue