Compare commits
No commits in common. "9a11fd1b3888d0597e9709b42fbd955f444010a1" and "8bd64fbe7905ca242674b06a718ad139f6112e85" have entirely different histories.
9a11fd1b38
...
8bd64fbe79
|
@ -1223,11 +1223,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_9": {
|
"nixpkgs_9": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720954236,
|
"lastModified": 1720691131,
|
||||||
"narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=",
|
"narHash": "sha256-CWT+KN8aTPyMIx8P303gsVxUnkinIz0a/Cmasz1jyIM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27",
|
"rev": "a046c1202e11b62cbede5385ba64908feb7bfac4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -36,6 +36,11 @@ in
|
||||||
pinentry-gnome3 # until pinentry-qt introduces caching
|
pinentry-gnome3 # until pinentry-qt introduces caching
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Git "safe-directory"
|
||||||
|
programs.git.extraConfig.safe.directory = [
|
||||||
|
"${config.home.homeDirectory}/.config/nixpkgs"
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.startServices = "sd-switch";
|
systemd.user.startServices = "sd-switch";
|
||||||
|
|
||||||
# Audio stuff!
|
# Audio stuff!
|
||||||
|
|
|
@ -109,7 +109,6 @@
|
||||||
.envrc
|
.envrc
|
||||||
.kakrc
|
.kakrc
|
||||||
''}";
|
''}";
|
||||||
safe.directory = "*";
|
|
||||||
merge.conflictstyle = "diff3";
|
merge.conflictstyle = "diff3";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
# Catppuccin theme for Kakoune
|
|
||||||
|
|
||||||
declare-option str rosewater "rgb:dc8a78"
|
|
||||||
declare-option str flamingo "rgb:dd7878"
|
|
||||||
declare-option str pink "rgb:ea76cb"
|
|
||||||
declare-option str mauve "rgb:8839ef"
|
|
||||||
declare-option str red "rgb:d20f39"
|
|
||||||
declare-option str maroon "rgb:e64553"
|
|
||||||
declare-option str peach "rgb:fe640b"
|
|
||||||
declare-option str yellow "rgb:df8e1d"
|
|
||||||
declare-option str green "rgb:40a02b"
|
|
||||||
declare-option str teal "rgb:179299"
|
|
||||||
declare-option str sky "rgb:04a5e5"
|
|
||||||
declare-option str sapphire "rgb:209fb5"
|
|
||||||
declare-option str blue "rgb:1e66f5"
|
|
||||||
declare-option str lavender "rgb:7287fd"
|
|
||||||
declare-option str text "rgb:4c4f69"
|
|
||||||
declare-option str subtext1 "rgb:5c5f77"
|
|
||||||
declare-option str subtext0 "rgb:6c6f85"
|
|
||||||
declare-option str overlay2 "rgb:7c7f93"
|
|
||||||
declare-option str overlay1 "rgb:8c8fa1"
|
|
||||||
declare-option str overlay0 "rgb:9ca0b0"
|
|
||||||
declare-option str surface2 "rgb:acb0be"
|
|
||||||
declare-option str surface1 "rgb:bcc0cc"
|
|
||||||
declare-option str surface0 "rgb:ccd0da"
|
|
||||||
declare-option str base "rgb:eff1f5"
|
|
||||||
declare-option str mantle "rgb:e6e9ef"
|
|
||||||
declare-option str crust "rgb:dce0e8"
|
|
||||||
|
|
||||||
|
|
||||||
set-face global title "%opt{text}+b"
|
|
||||||
set-face global header "%opt{subtext0}+b"
|
|
||||||
set-face global bold "%opt{maroon}+b"
|
|
||||||
set-face global italic "%opt{maroon}+i"
|
|
||||||
set-face global mono "%opt{green}"
|
|
||||||
set-face global block "%opt{sapphire}"
|
|
||||||
set-face global link "%opt{blue}"
|
|
||||||
set-face global bullet "%opt{peach}"
|
|
||||||
set-face global list "%opt{peach}"
|
|
||||||
|
|
||||||
set-face global Default "%opt{text},%opt{base}"
|
|
||||||
set-face global PrimarySelection "%opt{text},%opt{surface2}"
|
|
||||||
set-face global SecondarySelection "%opt{text},%opt{surface2}"
|
|
||||||
set-face global PrimaryCursor "%opt{crust},%opt{rosewater}"
|
|
||||||
set-face global SecondaryCursor "%opt{text},%opt{overlay0}"
|
|
||||||
set-face global PrimaryCursorEol "%opt{surface2},%opt{lavender}"
|
|
||||||
set-face global SecondaryCursorEol "%opt{surface2},%opt{overlay1}"
|
|
||||||
set-face global LineNumbers "%opt{overlay1},%opt{base}"
|
|
||||||
set-face global LineNumberCursor "%opt{rosewater},%opt{surface2}+b"
|
|
||||||
set-face global LineNumbersWrapped "%opt{rosewater},%opt{surface2}+i"
|
|
||||||
set-face global MenuForeground "%opt{text},%opt{surface1}+b"
|
|
||||||
set-face global MenuBackground "%opt{text},%opt{surface0}"
|
|
||||||
set-face global MenuInfo "%opt{crust},%opt{teal}"
|
|
||||||
set-face global Information "%opt{crust},%opt{teal}"
|
|
||||||
set-face global Error "%opt{crust},%opt{red}"
|
|
||||||
set-face global StatusLine "%opt{text},%opt{mantle}"
|
|
||||||
set-face global StatusLineMode "%opt{crust},%opt{yellow}"
|
|
||||||
set-face global StatusLineInfo "%opt{crust},%opt{teal}"
|
|
||||||
set-face global StatusLineValue "%opt{crust},%opt{yellow}"
|
|
||||||
set-face global StatusCursor "%opt{crust},%opt{rosewater}"
|
|
||||||
set-face global Prompt "%opt{teal},%opt{base}+b"
|
|
||||||
set-face global MatchingChar "%opt{maroon},%opt{base}"
|
|
||||||
set-face global Whitespace "%opt{overlay1},%opt{base}+f"
|
|
||||||
set-face global WrapMarker "Whitespace"
|
|
||||||
set-face global BufferPadding "%opt{base},%opt{base}"
|
|
||||||
|
|
||||||
set-face global value "%opt{peach}"
|
|
||||||
set-face global type "%opt{blue}"
|
|
||||||
set-face global variable "%opt{text}"
|
|
||||||
set-face global module "%opt{maroon}"
|
|
||||||
set-face global function "%opt{blue}"
|
|
||||||
set-face global string "%opt{green}"
|
|
||||||
set-face global keyword "%opt{mauve}"
|
|
||||||
set-face global operator "%opt{sky}"
|
|
||||||
set-face global attribute "%opt{green}"
|
|
||||||
set-face global comment "%opt{overlay0}"
|
|
||||||
set-face global documentation "comment"
|
|
||||||
set-face global meta "%opt{yellow}"
|
|
||||||
set-face global builtin "%opt{red}"
|
|
|
@ -201,7 +201,8 @@ in
|
||||||
owner = "tree-sitter";
|
owner = "tree-sitter";
|
||||||
repo = "tree-sitter-go";
|
repo = "tree-sitter-go";
|
||||||
rev = "v0.20.0";
|
rev = "v0.20.0";
|
||||||
hash = "sha256-G7d8CHCyKDAb9j6ijRfHk/HlgPqSI+uvkuRIRRvjkHI=";
|
hash = "sha256-XUSXOTqUySShJ7gebnhObwaFllfIxEYIHN70/wpiJdw=";
|
||||||
|
leaveDotGit = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -211,7 +212,11 @@ in
|
||||||
owner = "tree-sitter";
|
owner = "tree-sitter";
|
||||||
repo = "tree-sitter-scala";
|
repo = "tree-sitter-scala";
|
||||||
rev = "70afdd5632d57dd63a960972ab25945e353a52f6";
|
rev = "70afdd5632d57dd63a960972ab25945e353a52f6";
|
||||||
hash = "sha256-bi0Lqo/Zs2Uaz1efuKAARpEDg5Hm59oUe7eSXgL1Wow=";
|
hash =
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then lib.fakeHash
|
||||||
|
else "sha256-Q8KSI8H7+d/sUdSlcNAiOPn2THKk7SFqC3U7rLqSqtE=";
|
||||||
|
leaveDotGit = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -225,7 +230,11 @@ in
|
||||||
owner = "tree-sitter";
|
owner = "tree-sitter";
|
||||||
repo = "tree-sitter-haskell";
|
repo = "tree-sitter-haskell";
|
||||||
rev = "ba0bfb0e5d8e9e31c160d287878c6f26add3ec08";
|
rev = "ba0bfb0e5d8e9e31c160d287878c6f26add3ec08";
|
||||||
hash = "sha256-ZSOF0CLOn82GwU3xgvFefmh/AD2j5zz8I0t5YPwfan0=";
|
sha256 =
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then "sha256-lW3E4gSZV/m2RfofUqeiCu8KDz06YEvXbYKs8smXFi4="
|
||||||
|
else "sha256-H5Z4vPTZCFxDCWguOB8oVSGPJyQonrD8FWAQZTYPG2U=";
|
||||||
|
leaveDotGit = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -239,7 +248,8 @@ in
|
||||||
owner = "ikatyang";
|
owner = "ikatyang";
|
||||||
repo = "tree-sitter-yaml";
|
repo = "tree-sitter-yaml";
|
||||||
rev = "0e36bed171768908f331ff7dff9d956bae016efb";
|
rev = "0e36bed171768908f331ff7dff9d956bae016efb";
|
||||||
hash = "sha256-bpiT3FraOZhJaoiFWAoVJX1O+plnIi8aXOW2LwyU23M=";
|
hash = "sha256-rN/a8dYffDQNuvnhNp/nfu0AzhYrR1ESACQbQWb/n5w=";
|
||||||
|
leaveDotGit = true;
|
||||||
};
|
};
|
||||||
grammar.compile.args = [ "-c" "-fpic" "../scanner.cc" "../parser.c" "-I" ".." ];
|
grammar.compile.args = [ "-c" "-fpic" "../scanner.cc" "../parser.c" "-I" ".." ];
|
||||||
grammar.link.args = [ "-shared" "-fpic" "scanner.o" "parser.o" ];
|
grammar.link.args = [ "-shared" "-fpic" "scanner.o" "parser.o" ];
|
||||||
|
@ -249,7 +259,8 @@ in
|
||||||
owner = "helix-editor";
|
owner = "helix-editor";
|
||||||
repo = "helix";
|
repo = "helix";
|
||||||
rev = "dbd248fdfa680373d94fbc10094a160aafa0f7a7";
|
rev = "dbd248fdfa680373d94fbc10094a160aafa0f7a7";
|
||||||
hash = "sha256-wk8qVUDFXhAOi1Ibc6iBMzDCXb6t+YiWZcTd0IJybqc=";
|
hash = "sha256-dv/T8ROXmwEdjM71gza1RzF2HoINA7Zl2jmz63kCZyQ=";
|
||||||
|
leaveDotGit = true;
|
||||||
};
|
};
|
||||||
queries.path = "runtime/queries/yaml";
|
queries.path = "runtime/queries/yaml";
|
||||||
};
|
};
|
||||||
|
@ -260,17 +271,27 @@ in
|
||||||
owner = "vrischmann";
|
owner = "vrischmann";
|
||||||
repo = "tree-sitter-templ";
|
repo = "tree-sitter-templ";
|
||||||
rev = "044ad200092170727650fa6d368df66a8da98f9d";
|
rev = "044ad200092170727650fa6d368df66a8da98f9d";
|
||||||
hash = "sha256-hJuB3h5pp+LLfP0/7bAYH0uLVo+OQk5jpzJb3J9BNkY=";
|
hash = "sha256-umhemFnz/nLzkJk75wMoMAHT+Zs9MYOqWPoYQwoFu74=";
|
||||||
|
leaveDotGit = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
grammar.src = src;
|
grammar.src = src;
|
||||||
queries.src = pkgs.runCommandLocal "templ-tree-sitter-queries" { } ''
|
queries.src = pkgs.runCommandLocal "templ-tree-sitter-queries" { } ''
|
||||||
mkdir -p $out/queries
|
mkdir -p queries
|
||||||
# copy most stuff from tree-sitter-templ
|
# copy most stuff from tree-sitter-templ
|
||||||
install -m644 ${src}/queries/templ/* $out/queries
|
install -m644 ${src}/queries/templ/* queries
|
||||||
# override inherited files
|
# override inherited files
|
||||||
cat ${tree-sitter-go}/queries/highlights.scm ${src}/queries/templ/highlights.scm > $out/queries/highlights.scm
|
cat ${tree-sitter-go}/queries/highlights.scm ${src}/queries/templ/highlights.scm > queries/highlights.scm
|
||||||
|
|
||||||
|
mkdir -p $out/queries
|
||||||
|
cp -r queries $out/queries/templ
|
||||||
|
cd $out
|
||||||
|
${lib.getExe pkgs.git} init
|
||||||
|
${lib.getExe pkgs.git} config user.email "a@b.com"
|
||||||
|
${lib.getExe pkgs.git} config user.name "a"
|
||||||
|
${lib.getExe pkgs.git} add .
|
||||||
|
${lib.getExe pkgs.git} commit -m "Just making a git commit"
|
||||||
'';
|
'';
|
||||||
queries.path = "queries/templ";
|
queries.path = "queries/templ";
|
||||||
};
|
};
|
||||||
|
@ -296,11 +317,11 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
programs.my-kakoune.extraFaces = {
|
programs.my-kakoune.extraFaces = {
|
||||||
Default = "%opt{text},%opt{base}";
|
Default = "%opt{white},%opt{background}";
|
||||||
BufferPadding = "%opt{base},%opt{base}";
|
BufferPadding = "%opt{background},%opt{background}";
|
||||||
MenuForeground = "%opt{blue},white+bF";
|
MenuForeground = "blue,white+bF";
|
||||||
MenuBackground = "%opt{sky},white+F";
|
MenuBackground = "bright-blue,white+F";
|
||||||
Information = "%opt{sky},white";
|
Information = "bright-blue,white";
|
||||||
# Markdown help color scheme
|
# Markdown help color scheme
|
||||||
InfoDefault = "Information";
|
InfoDefault = "Information";
|
||||||
InfoBlock = "@block";
|
InfoBlock = "@block";
|
||||||
|
@ -492,7 +513,10 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
programs.my-kakoune.themes = {
|
programs.my-kakoune.themes = {
|
||||||
catppuccin-latte = ./catppuccin-latte.kak;
|
catppuccin-latte = builtins.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/catppuccin/kakoune/f6d43770609433c45046632f1bb68d1395305dbb/colors/catppuccin_latte.kak";
|
||||||
|
sha256 = "sha256:0ycvxs8hmsvd0zrpxiby16wzmapvmz6p34b6j343pc1girw6fi4i";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# Enable kak-tree-sitter
|
# Enable kak-tree-sitter
|
||||||
eval %sh{test -z "$WE_STARTED_KAK" && kak-tree-sitter --kakoune -d --server --init $kak_session}
|
eval %sh{ kak-tree-sitter --kakoune -d --server --with-text-objects }
|
||||||
map global normal <c-t> ": enter-user-mode tree-sitter<ret>"
|
map global normal <c-t> ": enter-user-mode tree-sitter<ret>"
|
||||||
# ## Set some color overrides
|
## Set some color overrides
|
||||||
# set global kts_yellow "rgb:e2b75e"
|
set global kts_yellow "rgb:e2b75e"
|
||||||
# set global kts_teal "rgb:008080"
|
set global kts_teal "rgb:008080"
|
||||||
# set global kts_mauve "rgb:c264ff"
|
set global kts_mauve "rgb:c264ff"
|
||||||
# set global kts_sky "rgb:6aa622"
|
set global kts_sky "rgb:6aa622"
|
||||||
# Color scheme
|
# Color scheme
|
||||||
colorscheme catppuccin-latte
|
colorscheme catppuccin-latte
|
||||||
set global base "default"
|
set global background default
|
||||||
|
|
||||||
# Set indentation guides
|
# Set indentation guides
|
||||||
add-highlighter global/indent-guides show-whitespaces -tab " " -spc " " -lf " " -nbsp " "
|
add-highlighter global/indent-guides show-whitespaces -tab " " -spc " " -lf " " -nbsp " "
|
||||||
|
|
|
@ -43,96 +43,83 @@ in
|
||||||
};
|
};
|
||||||
package = mkPackageOption pkgs "kak-tree-sitter" { };
|
package = mkPackageOption pkgs "kak-tree-sitter" { };
|
||||||
|
|
||||||
features = {
|
|
||||||
highlighting = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
description = "Enable highlighting";
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
text_objects = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
description = "Enable text objects";
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
highlighterGroups = mkOption {
|
highlighterGroups = mkOption {
|
||||||
type = types.attrsOf types.str;
|
type = types.attrsOf types.str;
|
||||||
default = {
|
default = {
|
||||||
attribute = "@attribute";
|
attribute = "@attribute";
|
||||||
comment = "@comment";
|
comment = "@comment";
|
||||||
conceal = "%opt{mauve}+i";
|
conceal = "%opt{kts_mauve}+i";
|
||||||
constant = "%opt{peach}";
|
constant = "%opt{kts_peach}";
|
||||||
constant_builtin_boolean = "%opt{sky}";
|
constant_builtin_boolean = "%opt{kts_sky}";
|
||||||
constant_character = "%opt{yellow}";
|
constant_character = "%opt{kts_yellow}";
|
||||||
constant_macro = "%opt{mauve}";
|
constant_macro = "%opt{kts_mauve}";
|
||||||
constant_numeric = "%opt{peach}";
|
constant_numeric = "%opt{kts_peach}";
|
||||||
constructor = "%opt{sapphire}";
|
constructor = "%opt{kts_sapphire}";
|
||||||
diff_plus = "%opt{green}";
|
diff_plus = "%opt{kts_green}";
|
||||||
diff_minus = "%opt{red}";
|
diff_minus = "%opt{kts_red}";
|
||||||
diff_delta = "%opt{blue}";
|
diff_delta = "%opt{kts_blue}";
|
||||||
diff_delta_moved = "%opt{mauve}";
|
diff_delta_moved = "%opt{kts_mauve}";
|
||||||
error = "%opt{red}+b";
|
error = "%opt{kts_red}+b";
|
||||||
function = "@function";
|
function = "@function";
|
||||||
function_builtin = "@builtin";
|
function_builtin = "@builtin";
|
||||||
function_macro = "+i@ts_function";
|
function_macro = "+i@ts_function";
|
||||||
hint = "%opt{blue}+b";
|
hint = "%opt{kts_blue}+b";
|
||||||
info = "%opt{green}+b";
|
info = "%opt{kts_green}+b";
|
||||||
keyword = "keyword";
|
keyword = "keyword";
|
||||||
keyword_conditional = "+i@ts_keyword";
|
keyword_conditional = "+i@ts_keyword";
|
||||||
keyword_control_conditional = "+i@ts_keyword";
|
keyword_control_conditional = "+i@ts_keyword";
|
||||||
keyword_control_directive = "+i@ts_keyword";
|
keyword_control_directive = "+i@ts_keyword";
|
||||||
keyword_control_import = "+i@ts_keyword";
|
keyword_control_import = "+i@ts_keyword";
|
||||||
keyword_directive = "+i@ts_keyword";
|
keyword_directive = "+i@ts_keyword";
|
||||||
label = "%opt{sapphire}+i";
|
label = "%opt{kts_sapphire}+i";
|
||||||
markup_bold = "%opt{peach}+b";
|
markup_bold = "%opt{kts_peach}+b";
|
||||||
markup_heading = "%opt{red}";
|
markup_heading = "%opt{kts_red}";
|
||||||
markup_heading_1 = "%opt{red}";
|
markup_heading_1 = "%opt{kts_red}";
|
||||||
markup_heading_2 = "%opt{mauve}";
|
markup_heading_2 = "%opt{kts_mauve}";
|
||||||
markup_heading_3 = "%opt{green}";
|
markup_heading_3 = "%opt{kts_green}";
|
||||||
markup_heading_4 = "%opt{yellow}";
|
markup_heading_4 = "%opt{kts_yellow}";
|
||||||
markup_heading_5 = "%opt{pink}";
|
markup_heading_5 = "%opt{kts_pink}";
|
||||||
markup_heading_6 = "%opt{teal}";
|
markup_heading_6 = "%opt{kts_teal}";
|
||||||
markup_heading_marker = "%opt{peach}+b";
|
markup_heading_marker = "%opt{kts_peach}+b";
|
||||||
markup_italic = "%opt{pink}+i";
|
markup_italic = "%opt{kts_pink}+i";
|
||||||
markup_list_checked = "%opt{green}";
|
markup_list_checked = "%opt{kts_green}";
|
||||||
markup_list_numbered = "%opt{blue}+i";
|
markup_list_numbered = "%opt{kts_blue}+i";
|
||||||
markup_list_unchecked = "%opt{teal}";
|
markup_list_unchecked = "%opt{kts_teal}";
|
||||||
markup_list_unnumbered = "%opt{mauve}";
|
markup_list_unnumbered = "%opt{kts_mauve}";
|
||||||
markup_link_label = "%opt{blue}";
|
markup_link_label = "%opt{kts_blue}";
|
||||||
markup_link_url = "%opt{teal}+u";
|
markup_link_url = "%opt{kts_teal}+u";
|
||||||
markup_link_uri = "%opt{teal}+u";
|
markup_link_uri = "%opt{kts_teal}+u";
|
||||||
markup_link_text = "%opt{blue}";
|
markup_link_text = "%opt{kts_blue}";
|
||||||
markup_quote = "%opt{crust}";
|
markup_quote = "%opt{kts_gray1}";
|
||||||
markup_raw = "%opt{sky}";
|
markup_raw = "%opt{kts_sky}";
|
||||||
markup_raw_block = "%opt{sky}";
|
markup_raw_block = "%opt{kts_sky}";
|
||||||
markup_raw_inline = "%opt{green}";
|
markup_raw_inline = "%opt{kts_green}";
|
||||||
markup_strikethrough = "%opt{crust}+s";
|
markup_strikethrough = "%opt{kts_gray1}+s";
|
||||||
namespace = "@module";
|
namespace = "@module";
|
||||||
operator = "@operator";
|
operator = "@operator";
|
||||||
property = "%opt{sky}";
|
property = "%opt{kts_sky}";
|
||||||
punctuation = "%opt{overlay2}";
|
punctuation = "%opt{kts_overlay2}";
|
||||||
punctuation_special = "%opt{sky}";
|
punctuation_special = "%opt{kts_sky}";
|
||||||
special = "%opt{blue}";
|
special = "%opt{kts_blue}";
|
||||||
spell = "%opt{mauve}";
|
spell = "%opt{kts_mauve}";
|
||||||
string = "%opt{green}";
|
string = "%opt{kts_green}";
|
||||||
string_regex = "%opt{peach}";
|
string_regex = "%opt{kts_peach}";
|
||||||
string_regexp = "%opt{peach}";
|
string_regexp = "%opt{kts_peach}";
|
||||||
string_escape = "%opt{mauve}";
|
string_escape = "%opt{kts_mauve}";
|
||||||
string_special = "%opt{blue}";
|
string_special = "%opt{kts_blue}";
|
||||||
string_special_path = "%opt{green}";
|
string_special_path = "%opt{kts_green}";
|
||||||
string_special_symbol = "%opt{mauve}";
|
string_special_symbol = "%opt{kts_mauve}";
|
||||||
string_symbol = "%opt{red}";
|
string_symbol = "%opt{kts_red}";
|
||||||
tag = "%opt{teal}";
|
tag = "%opt{kts_teal}";
|
||||||
tag_error = "%opt{red}";
|
tag_error = "%opt{kts_red}";
|
||||||
text_title = "%opt{mauve}";
|
text_title = "%opt{kts_mauve}";
|
||||||
type = "@type";
|
type = "%opt{kts_yellow}";
|
||||||
type_enum_variant = "+i@ts_type";
|
type_enum_variant = "%opt{kts_flamingo}";
|
||||||
variable = "@variable";
|
variable = "@variable";
|
||||||
variable_builtin = "@builtin";
|
variable_builtin = "@builtin";
|
||||||
variable_other_member = "%opt{teal}";
|
variable_other_member = "%opt{kts_teal}";
|
||||||
variable_parameter = "+i@variable";
|
variable_parameter = "%opt{kts_maroon}+i";
|
||||||
warning = "%opt{peach}+b";
|
warning = "%opt{kts_peach}+b";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -187,6 +174,8 @@ in
|
||||||
|
|
||||||
config =
|
config =
|
||||||
let
|
let
|
||||||
|
aliasedOnce = name: values: if asserts.assertMsg (builtins.length values 1) "face ${name} was aliased more than once: ${toString values}" then (builtins.head values) else [ ];
|
||||||
|
|
||||||
allGroups = attrsets.recursiveUpdate cfg.highlighterGroups cfg.extraHighlighterGroups;
|
allGroups = attrsets.recursiveUpdate cfg.highlighterGroups cfg.extraHighlighterGroups;
|
||||||
|
|
||||||
aliases = attrsets.recursiveUpdate cfg.aliases cfg.extraAliases;
|
aliases = attrsets.recursiveUpdate cfg.aliases cfg.extraAliases;
|
||||||
|
@ -200,24 +189,10 @@ in
|
||||||
|
|
||||||
toml = pkgs.formats.toml { };
|
toml = pkgs.formats.toml { };
|
||||||
|
|
||||||
srcName = src: lib.removePrefix "/nix/store/" src.outPath;
|
|
||||||
mkGitRepo = src: pkgs.runCommandLocal "${src.name}-git" { } ''
|
|
||||||
cp -r --no-preserve=all ${src} $out
|
|
||||||
cd $out
|
|
||||||
if ! test -d $out/.git; then
|
|
||||||
${lib.getExe pkgs.git} init -b ${srcName src}
|
|
||||||
${lib.getExe pkgs.git} config user.email "a@b.com"
|
|
||||||
${lib.getExe pkgs.git} config user.name "a"
|
|
||||||
${lib.getExe pkgs.git} add .
|
|
||||||
${lib.getExe pkgs.git} commit -m "Just making a git commit"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
toLanguageConf = name: lang: with lang; {
|
toLanguageConf = name: lang: with lang; {
|
||||||
grammar = {
|
grammar = {
|
||||||
inherit (grammar) path;
|
inherit (grammar) path;
|
||||||
source.git.url = "${mkGitRepo grammar.src}";
|
url = "${grammar.src}";
|
||||||
source.git.pin = "${srcName grammar.src}";
|
|
||||||
compile = grammar.compile.command;
|
compile = grammar.compile.command;
|
||||||
compile_args = grammar.compile.args;
|
compile_args = grammar.compile.args;
|
||||||
compile_flags = grammar.compile.flags;
|
compile_flags = grammar.compile.flags;
|
||||||
|
@ -226,8 +201,7 @@ in
|
||||||
link_flags = grammar.link.flags;
|
link_flags = grammar.link.flags;
|
||||||
};
|
};
|
||||||
queries = {
|
queries = {
|
||||||
source.git.url = "${mkGitRepo queries.src}";
|
url = "${queries.src}";
|
||||||
source.git.pin = "${srcName queries.src}";
|
|
||||||
path = if queries.path == null then "runtime/queries/${name}" else queries.path;
|
path = if queries.path == null then "runtime/queries/${name}" else queries.path;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -246,14 +220,19 @@ in
|
||||||
xdg.configFile."kak-tree-sitter/config.toml" = {
|
xdg.configFile."kak-tree-sitter/config.toml" = {
|
||||||
source = toml.generate "config.toml" {
|
source = toml.generate "config.toml" {
|
||||||
highlight.groups = builtins.map toScm (builtins.attrNames allGroups ++ builtins.attrNames aliases);
|
highlight.groups = builtins.map toScm (builtins.attrNames allGroups ++ builtins.attrNames aliases);
|
||||||
features = cfg.features;
|
|
||||||
language = builtins.mapAttrs toLanguageConf cfg.languages;
|
language = builtins.mapAttrs toLanguageConf cfg.languages;
|
||||||
};
|
};
|
||||||
|
|
||||||
onChange = ''
|
onChange =
|
||||||
export PATH=$PATH:${lib.getBin pkgs.gcc}
|
let
|
||||||
${cfg.package}/bin/ktsctl sync -a
|
buildCmd = lang: "${cfg.package}/bin/ktsctl -fci ${lang}";
|
||||||
'';
|
buildAll = strings.concatMapStringsSep "\n" buildCmd (builtins.attrNames cfg.languages);
|
||||||
|
in
|
||||||
|
''
|
||||||
|
# Rebuild languages
|
||||||
|
${buildAll}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.my-kakoune.extraFaces = faces;
|
programs.my-kakoune.extraFaces = faces;
|
||||||
|
|
11
overlay.nix
11
overlay.nix
|
@ -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: {
|
overlay-libs = final: prev: {
|
||||||
|
|
|
@ -1,41 +1,20 @@
|
||||||
{ lib, rustPlatform, fetchFromSourcehut, symlinkJoin, clang, git, writeText, ... }:
|
{ lib, rustPlatform, fetchFromGitHub, symlinkJoin, clang, git, ... }:
|
||||||
let
|
let
|
||||||
src = fetchFromSourcehut {
|
src = fetchFromGitHub {
|
||||||
owner = "~hadronized";
|
owner = "phaazon";
|
||||||
repo = "kak-tree-sitter";
|
repo = "kak-tree-sitter";
|
||||||
rev = "kak-tree-sitter-v1.1.2";
|
rev = "61cce127ca03e3c969df1ff46f41074a3c69be31";
|
||||||
hash = "sha256-wBWfSyR8LGtug/mCD0bJ4lbdN3trIA/03AnCxZoEOSA=";
|
hash = "sha256-wcgc1L6Y6obLTIonWLJzNK72fWW8oJ0yMEfGotCg5b8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
kak-tree-sitter = rustPlatform.buildRustPackage {
|
kak-tree-sitter = rustPlatform.buildRustPackage rec {
|
||||||
inherit src;
|
inherit src;
|
||||||
pname = "kak-tree-sitter";
|
pname = "kak-tree-sitter";
|
||||||
version = "1.1.2";
|
version = "0.5.5-${lib.substring 0 6 src.rev}";
|
||||||
cargoHash = "sha256-OQPUWqJAts8DbFNSsC/CmMCbuZ9TVxRTR05O7oiodKI=";
|
cargoHash = "sha256-Ozzcn4k+1Q+50zxCy9Flvv8vZKNcAesrHT/izVAgn54=";
|
||||||
cargoBuildOptions = [ "--package" "kak-tree-sitter" "--package" "ktsctl" ];
|
cargoBuildOptions = [ "--package" "kak-tree-sitter" "--package" "ktsctl" ];
|
||||||
|
|
||||||
nativeBuildInputs = [ clang git ];
|
nativeBuildInputs = [ clang git ];
|
||||||
|
|
||||||
patches = [
|
|
||||||
# Allow absolute-path style repos
|
|
||||||
(writeText "resources.patch" ''
|
|
||||||
diff --git a/ktsctl/src/resources.rs b/ktsctl/src/resources.rs
|
|
||||||
index f1da3ff..ac89345 100644
|
|
||||||
--- a/ktsctl/src/resources.rs
|
|
||||||
+++ b/ktsctl/src/resources.rs
|
|
||||||
@@ -48,7 +48,8 @@ impl Resources {
|
|
||||||
url
|
|
||||||
.trim_start_matches("http")
|
|
||||||
.trim_start_matches('s')
|
|
||||||
- .trim_start_matches("://"),
|
|
||||||
+ .trim_start_matches(":/")
|
|
||||||
+ .trim_start_matches("/"),
|
|
||||||
);
|
|
||||||
|
|
||||||
self.runtime_dir.join("sources").join(url_dir)
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kak-tree-sitter
|
kak-tree-sitter
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue