Compare commits
2 commits
03e1767b2a
...
5b99eaffea
Author | SHA1 | Date | |
---|---|---|---|
5b99eaffea | |||
5090767ba2 |
6 changed files with 53 additions and 61 deletions
|
@ -112,9 +112,6 @@
|
||||||
|
|
||||||
# Enable ollama support
|
# Enable ollama support
|
||||||
ollama.enable = true;
|
ollama.enable = true;
|
||||||
|
|
||||||
# Set the hostname for nixd in neovim
|
|
||||||
nixd.hostname = "wizlap";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Add monitor configuration to hyprland
|
# Add monitor configuration to hyprland
|
||||||
|
|
|
@ -4,16 +4,14 @@ The module extends `programs.neovim`.
|
||||||
|
|
||||||
## Module options
|
## Module options
|
||||||
|
|
||||||
### programs.neovim.nixd.hostname
|
### programs.neovim.flakePath
|
||||||
|
|
||||||
By default [nixd] is enabled, you **need** to pass the current machine's
|
|
||||||
hostname that is used to generate your system.
|
|
||||||
|
|
||||||
### programs.neovim.nixd.location
|
|
||||||
|
|
||||||
The location of your system's flake, [nixd] will execute an expression defined in the LSP's configuration that reads
|
The location of your system's flake, [nixd] will execute an expression defined in the LSP's configuration that reads
|
||||||
the flake's contents to evaluate [NixOS] and [Home Manager] options.
|
the flake's contents to evaluate [NixOS] and [Home Manager] options.
|
||||||
|
|
||||||
|
This setting is optional since other programs might force you to set the `FLAKE` environment variable; if this is not
|
||||||
|
set by the time you open [neovim] it will spout an error, impeding critical plugins from starting.
|
||||||
|
|
||||||
### programs.neovim.ollama.enable
|
### programs.neovim.ollama.enable
|
||||||
|
|
||||||
Whether to add an [ollama] package to be used with [ollama.nvim](https://github.com/nomnivore/ollama.nvim).
|
Whether to add an [ollama] package to be used with [ollama.nvim](https://github.com/nomnivore/ollama.nvim).
|
||||||
|
|
|
@ -25,20 +25,11 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.programs.neovim = {
|
options.programs.neovim = {
|
||||||
nixd = {
|
flakePath = mkOption {
|
||||||
hostname = mkOption {
|
default = null;
|
||||||
default = "wizdesk";
|
description = "The path to your flake, this will be the value of the `FLAKE` environment variable.";
|
||||||
description = "Your NixOS hostname, needed for nixd lsp.";
|
example = "~/.config/nix";
|
||||||
example = "nixos";
|
type = types.nullOr types.str;
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
location = mkOption {
|
|
||||||
default = "git+file:///home/wizardlink/.system";
|
|
||||||
description = "Path to your flake location, prepend 'file:///' to it and 'git+' before that if using git.";
|
|
||||||
example = "git+file:///home/wizardlink/.system";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ollama = {
|
ollama = {
|
||||||
|
@ -57,10 +48,14 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
home.sessionVariables = {
|
home.sessionVariables =
|
||||||
EDITOR = "nvim";
|
{
|
||||||
MANPAGER = "nvim +Man!";
|
EDITOR = "nvim";
|
||||||
};
|
MANPAGER = "nvim +Man!";
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs (config.programs.neovim.flakePath != null) {
|
||||||
|
FLAKE = config.programs.neovim.flakePath;
|
||||||
|
};
|
||||||
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
withNodeJs = true;
|
withNodeJs = true;
|
||||||
|
@ -157,14 +152,6 @@ in
|
||||||
source = ./ftplugin;
|
source = ./ftplugin;
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."nvim/lua/plugins/astrolsp.lua".source = pkgs.runCommand "astrolsp.lua" { } ''
|
|
||||||
cp ${./lsp.lua} $out
|
|
||||||
|
|
||||||
substituteInPlace $out \
|
|
||||||
--replace-fail "{hostname}" "${config.programs.neovim.nixd.hostname}" \
|
|
||||||
--replace-fail "{location}" "${config.programs.neovim.nixd.location}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
xdg.dataFile."nvim/lazy/blink.cmp/target/release/libblink_cmp_fuzzy.so" = {
|
xdg.dataFile."nvim/lazy/blink.cmp/target/release/libblink_cmp_fuzzy.so" = {
|
||||||
recursive = true;
|
recursive = true;
|
||||||
source = "${blink-cmp.packages.${pkgs.system}.blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.so";
|
source = "${blink-cmp.packages.${pkgs.system}.blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.so";
|
||||||
|
|
|
@ -9,6 +9,9 @@ return {
|
||||||
---@param opts AstroLSPOpts
|
---@param opts AstroLSPOpts
|
||||||
---@return AstroLSPOpts
|
---@return AstroLSPOpts
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
|
local system_flake_path = vim.fn.getenv "FLAKE" or error "FLAKE environment variable must be set."
|
||||||
|
local hostname = vim.fn.hostname()
|
||||||
|
|
||||||
---@type AstroLSPOpts
|
---@type AstroLSPOpts
|
||||||
local lsp_options = {
|
local lsp_options = {
|
||||||
-- Configuration table of features provided by AstroLSP
|
-- Configuration table of features provided by AstroLSP
|
||||||
|
@ -84,15 +87,23 @@ return {
|
||||||
settings = {
|
settings = {
|
||||||
nixd = {
|
nixd = {
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
expr = "import (builtins.getFlake ({location})).inputs.nixpkgs { }",
|
expr = "import (builtins.getFlake (" .. system_flake_path .. ")).inputs.nixpkgs { }",
|
||||||
},
|
},
|
||||||
options = {
|
options = {
|
||||||
nixos = {
|
nixos = {
|
||||||
expr = '(builtins.getFlake ("{location}")).nixosConfigurations.{hostname}.options',
|
expr = "(builtins.getFlake ("
|
||||||
|
.. system_flake_path
|
||||||
|
.. ")).nixosConfigurations."
|
||||||
|
.. hostname
|
||||||
|
.. ".options",
|
||||||
},
|
},
|
||||||
home_manager = {
|
home_manager = {
|
||||||
expr =
|
expr = "(builtins.getFlake ("
|
||||||
'(builtins.getFlake ("{location}")).nixosConfigurations.{hostname}.options.home-manager.users.type.getSubOptions []',
|
.. system_flake_path
|
||||||
|
.. ")).nixosConfigurations."
|
||||||
|
.. hostname
|
||||||
|
.. ".options"
|
||||||
|
.. ".home-manager.users.type.getSubOptions []",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
|
@ -7,9 +7,15 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"tris203/rzls.nvim",
|
"tris203/rzls.nvim",
|
||||||
|
---@return rzls.Config
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
|
local has_astrolsp, astrolsp = pcall(require, "astrolsp")
|
||||||
|
local has_blink, blink = pcall(require, "blink-cmp")
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
capabilities = vim.lsp.protocol.make_client_capabilities(),
|
capabilities = has_blink and blink.get_lsp_capabilities({}, true)
|
||||||
|
or vim.lsp.protocol.make_client_capabilities(),
|
||||||
|
on_attach = has_astrolsp and astrolsp.on_attach or nil,
|
||||||
path = vim.fn.get_nix_store "rzls" .. "/bin/rzls",
|
path = vim.fn.get_nix_store "rzls" .. "/bin/rzls",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,24 +24,25 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
|
local has_astrolsp, astrolsp = pcall(require, "astrolsp")
|
||||||
local rzlspath = vim.fn.get_nix_store "rzls"
|
local rzlspath = vim.fn.get_nix_store "rzls"
|
||||||
require("roslyn.config").get()
|
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
exe = "Microsoft.CodeAnalysis.LanguageServer",
|
|
||||||
args = {
|
|
||||||
"--stdio",
|
|
||||||
"--logLevel=Information",
|
|
||||||
"--extensionLogDirectory=" .. vim.fs.dirname(vim.lsp.get_log_path()),
|
|
||||||
"--razorSourceGenerator=" .. rzlspath .. "/lib/rzls/Microsoft.CodeAnalysis.Razor.Compiler.dll",
|
|
||||||
"--razorDesignTimePath="
|
|
||||||
.. rzlspath
|
|
||||||
.. "/lib/rzls/Targets/Microsoft.NET.Sdk.Razor.DesignTime.targets",
|
|
||||||
},
|
|
||||||
---@type vim.lsp.ClientConfig
|
---@type vim.lsp.ClientConfig
|
||||||
---@diagnostic disable-next-line: missing-fields
|
---@diagnostic disable-next-line: missing-fields
|
||||||
config = {
|
config = {
|
||||||
|
cmd = {
|
||||||
|
"Microsoft.CodeAnalysis.LanguageServer",
|
||||||
|
"--stdio",
|
||||||
|
"--logLevel=Information",
|
||||||
|
"--extensionLogDirectory=" .. vim.fs.dirname(vim.lsp.get_log_path()),
|
||||||
|
"--razorSourceGenerator=" .. rzlspath .. "/lib/rzls/Microsoft.CodeAnalysis.Razor.Compiler.dll",
|
||||||
|
"--razorDesignTimePath="
|
||||||
|
.. rzlspath
|
||||||
|
.. "/lib/rzls/Targets/Microsoft.NET.Sdk.Razor.DesignTime.targets",
|
||||||
|
},
|
||||||
handlers = require "rzls.roslyn_handlers",
|
handlers = require "rzls.roslyn_handlers",
|
||||||
|
on_attach = has_astrolsp and astrolsp.on_attach or nil,
|
||||||
settings = {
|
settings = {
|
||||||
["csharp|inlay_hints"] = {
|
["csharp|inlay_hints"] = {
|
||||||
csharp_enable_inlay_hints_for_implicit_object_creation = true,
|
csharp_enable_inlay_hints_for_implicit_object_creation = true,
|
||||||
|
|
|
@ -85,14 +85,6 @@
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
programs.neovim = {
|
# Enable Neovim, pre-configured by `linuxware`.
|
||||||
# Enable Neovim, pre-configured by `linuxware`.
|
programs.neovim.enable = true;
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# Configure nixd
|
|
||||||
nixd = {
|
|
||||||
hostname = "your-hostname-here";
|
|
||||||
location = "your-flake-location-here";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue