Compare commits

..

4 commits

7 changed files with 59 additions and 23 deletions

View file

@ -7,10 +7,11 @@ let
name = "vscode-${name}-language-server";
value = {
args = [ "--stdio" ];
command = "${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-${name}-language-server";
command = "vscode-${name}-language-server";
filetypes = [ name ];
roots = [ "package.json" ".git" ];
};
package = pkgs.nodePackages.vscode-langservers-extracted;
};
tailwind = {
@ -23,6 +24,7 @@ let
validate = "warning";
userLanguages.templ = "html";
};
package = pkgs.tailwindcss-language-server;
};
templModule = { pkgs, lib, ... }: {
@ -33,9 +35,9 @@ let
args = [ "lsp" ];
filetypes = [ "templ" ];
roots = [ "go.mod" ".git" ];
package = pkgs.unstable.templ;
};
home.packages = [ pkgs.unstable.templ ];
};
in
@ -45,11 +47,6 @@ let
programs.kak-lsp.languageServers = (builtins.listToAttrs (map langserver [ "html" "css" "json" ])) // {
tailwindcss-language-server = tailwind;
};
home.packages = with pkgs; [
nodePackages.vscode-langservers-extracted
tailwindcss-language-server
];
};
ltexLsp = { pkgs, lib, ... }: {
@ -58,9 +55,8 @@ let
args = [ "--log-file=/tmp" ];
filetypes = [ "latex" "typst" ];
roots = [ "main.tex" "main.typ" ".git" ];
package = pkgs.ltex-ls;
};
home.packages = [ pkgs.ltex-ls ];
};
in
@ -72,8 +68,6 @@ in
universal-ctags
# tree-sitter for kak
kak-tree-sitter
# LSPs
metals
];
# xdg.configFile."kak-tree-sitter/config.toml".source = ./kak-tree-sitter.toml;
@ -106,8 +100,9 @@ in
programs.kak-lsp.languageServers.typescript-language-server = {
args = [ "--stdio" ];
command = "typescript-language-server";
filetypes = [ "typescript" ];
filetypes = [ "typescript" "javascript" ];
roots = [ "package.json" ];
package = pkgs.nodePackages.typescript-language-server;
};
programs.kak-lsp.languageServers.fsautocomplete = {
args = [ "--adaptive-lsp-server-enabled" "--project-graph-enabled" "--source-text-factory" "RoslynSourceText" ];
@ -135,6 +130,7 @@ in
statusBarProvider = "log-message";
compilerOptions = { overrideDefFormat = "unicode"; };
};
package = pkgs.metals;
};
programs.kak-lsp.languageServers.texlab = {
command = "texlab";

View file

@ -61,12 +61,8 @@ map global normal D ": delete-current-brackets<ret>"
# Tab sizes
hook global InsertChar \t %{ exec -draft -itersel h@ }
set global tabstop 4
set global indentwidth 4
hook global WinSetOption filetype=(c|cpp|haskell|nix|yaml) %{
set global tabstop 2
set global indentwidth 2
}
set global tabstop 2
set global indentwidth 2
# Ctrl + a in insert mode = esc
map global insert <c-a> '<esc>'
@ -91,6 +87,7 @@ hook global InsertCompletionHide .* %{
# Enable LSP
try %{
eval %sh{test -z "$WE_STARTED_KAK" && kak-lsp --kakoune -s $kak_session}
set-option global lsp_cmd "kak-lsp -s %val{session}"
}
hook global WinSetOption filetype=(racket|rust|python|go|javascript|typescript|c|cpp|tex|latex|fsharp|ocaml|haskell|nix|scala|typst|html|css|json|markdown|templ|elixir) %{
lsp-enable-window

View file

@ -143,10 +143,28 @@ let
default = null;
description = "Additional settings to be passed to the LSP server.";
};
package = mkOption {
type = types.nullOr types.package;
default = null;
description = "The default package of the language server. Will be appended as the ending segments of the PATH to kak-lsp";
};
};
};
cfg = config.programs.kak-lsp;
serverPackages =
filter (v: v != null)
(lib.mapAttrsToList (_: serv: serv.package) cfg.languageServers);
wrappedPackage = pkgs.symlinkJoin {
name = "kak-lsp-wrapped";
nativeBuildInputs = [ pkgs.makeWrapper ];
paths = [ cfg.package ];
postBuild = ''
wrapProgram $out/bin/kak-lsp --suffix PATH ":" ${lib.makeBinPath serverPackages}
'';
};
in
{
options.programs.kak-lsp = {
@ -195,13 +213,13 @@ in
config = mkIf cfg.enable
{
home.packages = [ cfg.package ];
home.packages = [ wrappedPackage ];
# Configurations
xdg.configFile."kak-lsp/kak-lsp.toml" =
let
toml = pkgs.formats.toml { };
stripNulls = lib.filterAttrsRecursive (n: v: v != null);
toLspConfig = lib.filterAttrsRecursive (n: v: n != "package" && v != null);
in
{
source = toml.generate "config.toml"
@ -210,7 +228,7 @@ in
server.timeout = cfg.serverTimeout;
snippet_support = cfg.enableSnippets;
verbosity = 255;
language_server = stripNulls (lspConfig.language_servers // cfg.languageServers);
language_server = toLspConfig (lspConfig.language_servers // cfg.languageServers);
language_ids = lspConfig.language_ids // cfg.languageIds;
};
};

View file

@ -119,7 +119,7 @@ in
dnsServers = mkOption {
type = types.listOf types.str;
description = "DNS server list";
default = [ "8.8.8.8" "8.8.4.4" ];
default = [ "1.1.1.1" "2606:4700:4700:1111" ];
};
networks = mkOption {
type = types.attrsOf (types.submodule {

View file

@ -13,6 +13,8 @@
../modules/personal/fonts
# Encrypted DNS
../modules/services/edns
# Wireless card
./wireless.nix
];
# services.xserver.enable = true;

View file

@ -0,0 +1,13 @@
{ pkgs, lib, ... }: {
environment.systemPackages = with pkgs; [ iw ];
# Disable power_save on boot
services.udev.packages = [
(pkgs.writeTextFile {
name = "udev_disable_wifi_power_save";
destination = "/etc/udev/rules.d/10-wifi-power_save.rules";
text = ''
ACTION=="add", SUBSYSTEM=="net", KERNEL=="wl*", RUN+="${lib.getExe pkgs.iw} dev $name set power_save off"
'';
})
];
}

View file

@ -86,6 +86,17 @@ let
})
];
};
# rbw: https://github.com/doy/rbw/pull/189
rbw = prev.rbw.overrideAttrs (attrs: {
patches = (attrs.patches or [ ]) ++ [
(final.fetchurl
{
url = "https://github.com/doy/rbw/pull/189.patch";
hash = "sha256-617nYL9Jmu+inpAzDu/+iYXhajckzpsxW+jlhcRwseM=";
})
];
});
};
overlay-libs = final: prev: {
@ -95,7 +106,6 @@ let
overlay-packages = final: prev: {
kak-tree-sitter = final.callPackage ./packages/common/kak-tree-sitter.nix { rustPlatform = final.unstable.rustPlatform; };
kak-lsp =
let
src = inputs.kak-lsp;