nichts/modules/programs/editors/kakoune/default.nix

97 lines
2.2 KiB
Nix
Raw Normal View History

2024-10-28 21:52:16 +01:00
{
config,
lib,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
cfg = config.modules.system.programs.editors.kakoune;
inherit (lib) mkIf mkEnableOption;
2024-10-28 22:45:18 +01:00
custom-kakoune = pkgs.stdenv.mkDerivation {
name = "custom-kakoune";
src = pkgs.fetchFromGitHub {
owner = "mawww";
repo = "kakoune";
rev = "be82047dbf5f74f123e925b96e0e13962a4e0c09";
hash = "sha256-akSmIe0SUe9re8a90ssrykowCzThZnzqVow9erT+0U4=";
};
makeFlags = ["debug=no" "PREFIX=${placeholder "out"}"];
enableParallellBuilding = true;
doInstallCheck = false;
installCheckPhase = ''
$out/bin/kak -ui json -e "kill 0"
'';
postInstall = ''
cd "$out/share/kak"
autoload_target=$(readlink autoload)
rm autoload
mkdir autoload
ln -s --relative "$autoload_target" autoload
'';
};
2024-10-28 21:52:16 +01:00
in {
imports = [./mappings.nix];
2024-10-28 22:45:18 +01:00
options.modules.programs.editors.kakoune.enable = mkEnableOption "kakoune";
config = {
environment.systemPackages = [
custom-kakoune
];
home-manager.users.${username}.programs.kakoune = mkIf false {
enable = true;
package = custom-kakoune;
config = {
autoComplete = ["insert"];
autoReload = "yes";
indentWidth = 4;
tabStop = 4;
incrementalSearch = false;
numberLines = {
enable = true;
relative = true;
highlightCursor = true;
separator = " ";
};
2024-10-28 21:52:16 +01:00
2024-10-28 22:45:18 +01:00
scrollOff = {
lines = 4;
columns = 4;
};
wrapLines = {
enable = true;
indent = true;
word = true;
};
2024-10-28 21:52:16 +01:00
2024-10-28 22:45:18 +01:00
ui = {
enableMouse = true;
assistant = "none";
statusLine = "bottom";
};
2024-10-28 21:52:16 +01:00
};
2024-10-28 22:45:18 +01:00
plugins = with pkgs.kakounePlugins; [
active-window-kak
auto-pairs-kak
byline-kak # ope
prelude-kak # dependency of byline
kak-ls
kakboard
kakoune-buffer-switcher
kakoune-buffers
kakoune-lsp
kakoune-rainbow
kakoune-registers
kakoune-vertical-selection
powerline-kak
quickscope-kak
smarttab-kak
zig-kak
];
# extraConfig = ./kakrc;
};
2024-10-28 21:52:16 +01:00
};
}