user/neovim: switch to nixd
This commit is contained in:
parent
21dc584199
commit
4dfc898140
4 changed files with 33 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
{ config, lib, pkgs, ... }: {
|
{ config, inputs, pkgs, ... }: {
|
||||||
nix = {
|
nix = {
|
||||||
|
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||||
package = pkgs.nixVersions.latest;
|
package = pkgs.nixVersions.latest;
|
||||||
|
|
||||||
settings = rec {
|
settings = rec {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, sysConfig, ... }:
|
||||||
let
|
let
|
||||||
luaconf = pkgs.writeText "config.lua"
|
luaconf = pkgs.writeText "config.lua"
|
||||||
(lib.replaceStrings
|
(lib.replaceStrings
|
||||||
["{{OMNISHARP_PATH}}" "{{DART_PATH}}" "{{CATPPUCCIN_FLAVOUR}}"]
|
["{{OMNISHARP_PATH}}" "{{DART_PATH}}" "{{CATPPUCCIN_FLAVOUR}}" "{{USERNAME}}" "{{HOSTNAME}}"]
|
||||||
["${pkgs.omnisharp-roslyn}/bin/OmniSharp" "${pkgs.dart}/bin/dart" config.catppuccin.nvim.flavor]
|
["${pkgs.omnisharp-roslyn}/bin/OmniSharp" "${pkgs.dart}/bin/dart" config.catppuccin.nvim.flavor config.home.username sysConfig.networking.hostName]
|
||||||
(builtins.readFile ../../res/config.lua));
|
(builtins.readFile ../../res/config.lua));
|
||||||
in {
|
in {
|
||||||
systemd.user.tmpfiles.rules = [
|
systemd.user.tmpfiles.rules = [
|
||||||
|
|
@ -21,6 +21,7 @@ in {
|
||||||
withRuby = false;
|
withRuby = false;
|
||||||
|
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
|
nixd
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
texlab
|
texlab
|
||||||
astro-language-server
|
astro-language-server
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ vim.diagnostic.config({
|
||||||
|
|
||||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
|
|
||||||
local servers = { 'astro', 'clangd', 'cssls', 'html', 'nil_ls', 'tailwindcss', 'texlab', 'ts_ls', 'yamlls' }
|
local servers = { 'astro', 'clangd', 'cssls', 'html', 'tailwindcss', 'texlab', 'ts_ls', 'yamlls' }
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
vim.lsp.config(lsp, {
|
vim.lsp.config(lsp, {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
|
@ -292,6 +292,32 @@ vim.lsp.config("diagnosticls", {
|
||||||
})
|
})
|
||||||
vim.lsp.enable("diagnosticls")
|
vim.lsp.enable("diagnosticls")
|
||||||
|
|
||||||
|
-- LSP/nixd
|
||||||
|
vim.lsp.config("nixd", {
|
||||||
|
cmd = { "nixd" },
|
||||||
|
filetypes = { "nix" },
|
||||||
|
root_markers = { "flake.nix", ".git" },
|
||||||
|
settings = {
|
||||||
|
nixd = {
|
||||||
|
nixpkgs = {
|
||||||
|
expr = "import <nixpkgs> { }",
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
command = { "nixfmt" },
|
||||||
|
},
|
||||||
|
options = {
|
||||||
|
nixos = {
|
||||||
|
expr = '(builtins.getFlake (toString ./.)).nixosConfigurations.{{HOSTNAME}}.options',
|
||||||
|
},
|
||||||
|
home_manager = {
|
||||||
|
expr = '(builtins.getFlake (builtins.toString ./.)).nixosConfigurations."{{USERNAME}}@{{HOSTNAME}}".options.home-manager.users.type.getSubOptions []',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.lsp.enable("nixd")
|
||||||
|
|
||||||
-- LSP/Signatures
|
-- LSP/Signatures
|
||||||
require("lsp_signature").setup {
|
require("lsp_signature").setup {
|
||||||
hint_enable = false,
|
hint_enable = false,
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ in {
|
||||||
ffmpeg
|
ffmpeg
|
||||||
gnupg
|
gnupg
|
||||||
kitty
|
kitty
|
||||||
nil
|
|
||||||
nodejs_latest
|
nodejs_latest
|
||||||
pamixer
|
pamixer
|
||||||
pnpm
|
pnpm
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue