home/kak.nix

101 lines
2.5 KiB
Nix
Raw Normal View History

2023-10-12 22:51:18 +02:00
{ pkgs, kak }:
with pkgs; let
kakoune-mirror = kakouneUtils.buildKakounePluginFrom2Nix {
pname = "kakoune-mirror";
version = "latest";
src = fetchFromGitHub {
owner = "Delapouite";
repo = "kakoune-mirror";
rev = "5710635f440bcca914d55ff2ec1bfcba9efe0f15";
sha256 = "sha256-uslx4zZhvjUylrPWvTOugsKYKKpF0EEz1drc1Ckrpjk=";
};
meta.homepage = "https://github.com/Delapouite/kakoune-mirror";
};
ad-hoc-org-mode = kakouneUtils.buildKakounePluginFrom2Nix {
pname = "ad-hoc-org-mode";
version = "latest";
src = fetchFromGitHub {
owner = "loovjo";
repo = "ad-hoc-org-mode";
rev = "e32a5d18cbe9eec244695f9e39277c90d2960147";
sha256 = "sha256-BhyrOVJxbnB0NI3BBLwNTuPc3WgeuJKjuL2CPLqX8jA=";
};
meta.homepage = "https://github.com/loovjo/ad-hoc-org-mode";
};
# NOTE: kak-lsp must be in packages
kakoune-lsp = kakouneUtils.buildKakounePluginFrom2Nix {
pname = "kak-lsp";
version = "latest";
src = fetchFromGitHub {
owner = "kak-lsp";
repo = "kak-lsp";
rev = "v14.2.0";
sha256 = "sha256-U4eqIzvYzUfwprVpPHV/OFPKiBXK4/5z2p8kknX2iME=";
};
meta.homepage = "https://github.com/kak-lsp/kak-lsp/";
};
kak-lsp-config-file = writeText "kak-lsp.toml" ''
snippet_support = true
verbosity = 2
[language.haskell]
filetypes = ["haskell"]
roots = ["Setup.hs", "stack.yaml", "*.cabal"]
command = "hls"
[language.python]
filetypes = ["python"]
roots = ["requirements.txt", "setup.py", ".git", ".hg"]
command = "pylsp"
offset_encoding = "utf-8"
[language.rust]
filetypes = ["rust"]
roots = ["Cargo.toml"]
command = "rust-analyzer"
[language.c]
filetypes = ["c"]
roots = ["compile_commands.json"]
command = "clangd"
'';
kak-lsp-config-line = "set global lsp_cmd \"kak-lsp -s %val{session} --config ${kak-lsp-config-file} --log /tmp/kak-lsp.log\"";
in
{
enable = true;
plugins = with kakounePlugins; [
kakoune-buffers
kakoune-extra-filetypes
kakoune-mirror
ad-hoc-org-mode
kakoune-lsp
];
config = {
colorScheme = "gruvbox-dark";
indentWidth = 4;
ui.assistant = "cat"; # mjau
ui.statusLine = "top";
ui.useBuiltinKeyParser = true;
ui.enableMouse = true;
wrapLines = {
enable = true;
indent = true;
word = true;
};
};
extraConfig = kak-lsp-config-line + "\n" + builtins.readFile ./dotfiles/kakrc ;
} // (if stdenv.isDarwin then { package = kak; } else {}) # package seems to be broken on unix?