add misc dotfiles (etc/)
This commit is contained in:
parent
fcadfc6cfc
commit
82538540ca
|
@ -1,39 +1,16 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
with builtins;
|
with builtins;
|
||||||
with import <nixpkgs> {};
|
with import <nixpkgs> { };
|
||||||
|
|
||||||
let
|
let
|
||||||
kakoune-smarttab = stdenv.mkDerivation {
|
kakPlugins = import ./modules/kakoune-plugins.nix;
|
||||||
name = "kakoune-smarttab";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "andreyorst";
|
|
||||||
repo = "smarttab.kak";
|
|
||||||
rev = "e7fe8efd0b91ab8dc1c99c131f138de9b38fd965";
|
|
||||||
sha256 = "0x93mmxv9qi7vxsyqdhg4x5bvsl8sss9m2mq2qks6ghr5h9pmigk";
|
|
||||||
};
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/share/kak/autoload/plugins
|
|
||||||
cp -r rc $out/share/kak/autoload/plugins/smarttab
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
kakoune-joule = stdenv.mkDerivation {
|
|
||||||
name = "kakoune-joule";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "katesuyu";
|
|
||||||
repo = "joule.kak";
|
|
||||||
rev = "17fb4a08c525b6a7e7899c29efafd55a94908cd4";
|
|
||||||
sha256 = "1jpl9x7a07f7igwd60dn2y3sxakpnlh07cja06l9fsnfpb02jis3";
|
|
||||||
};
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/share/kak/autoload
|
|
||||||
cp colors/joule.kak $out/share/kak/autoload
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
zig-master = stdenv.mkDerivation {
|
zig-master = stdenv.mkDerivation {
|
||||||
name = "zig-master";
|
name = "zig-master";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = https://ziglang.org/builds/zig-linux-x86_64-0.6.0+0e4c3934a.tar.xz;
|
url =
|
||||||
sha256 = "f51d45e0780af942f9128fa915ab96ec8afc7b11dde8b24c8c40ff46a12b8228";
|
"https://ziglang.org/builds/zig-linux-x86_64-0.6.0+0e4c3934a.tar.xz";
|
||||||
|
sha256 =
|
||||||
|
"f51d45e0780af942f9128fa915ab96ec8afc7b11dde8b24c8c40ff46a12b8228";
|
||||||
};
|
};
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
|
@ -46,10 +23,7 @@ in {
|
||||||
username = "lyla";
|
username = "lyla";
|
||||||
homeDirectory = "/home/lyla";
|
homeDirectory = "/home/lyla";
|
||||||
stateVersion = "20.09";
|
stateVersion = "20.09";
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [ xclip neofetch kak-lsp rnix-lsp nixfmt zig-master ];
|
||||||
kak-lsp rnix-lsp
|
|
||||||
zig-master
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
@ -67,12 +41,23 @@ in {
|
||||||
kakoune = let
|
kakoune = let
|
||||||
lspFiletypes = [ "zig" "c" "cpp" "rust" "nix" ];
|
lspFiletypes = [ "zig" "c" "cpp" "rust" "nix" ];
|
||||||
tabSettings = [
|
tabSettings = [
|
||||||
{ filetype = [ "zig" "rust" "nix" ]; tab = "expandtab"; }
|
{
|
||||||
{ filetype = [ "c" "cpp" ]; tab = "smarttab"; }
|
filetype = [ "zig" "rust" "nix" ];
|
||||||
|
tab = "expandtab";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
filetype = [ "c" "cpp" ];
|
||||||
|
tab = "smarttab";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = [ kakoune-joule kakoune-smarttab ];
|
plugins = with pkgs.kakounePlugins; [
|
||||||
|
kak-fzf
|
||||||
|
kakPlugins.kakboard
|
||||||
|
kakPlugins.joule
|
||||||
|
kakPlugins.smarttab
|
||||||
|
];
|
||||||
config = {
|
config = {
|
||||||
tabStop = 4;
|
tabStop = 4;
|
||||||
numberLines = {
|
numberLines = {
|
||||||
|
@ -89,8 +74,15 @@ in {
|
||||||
assistant = "none";
|
assistant = "none";
|
||||||
setTitle = true;
|
setTitle = true;
|
||||||
};
|
};
|
||||||
|
keyMappings = [{
|
||||||
|
docstring = "fzf mode";
|
||||||
|
mode = "user";
|
||||||
|
effect = ": fzf-mode<ret>";
|
||||||
|
key = "d";
|
||||||
|
}];
|
||||||
hooks = [
|
hooks = [
|
||||||
{ name = "ModuleLoaded";
|
{
|
||||||
|
name = "ModuleLoaded";
|
||||||
option = "smarttab";
|
option = "smarttab";
|
||||||
commands = ''
|
commands = ''
|
||||||
set-option global softtabstop 4
|
set-option global softtabstop 4
|
||||||
|
@ -99,35 +91,35 @@ in {
|
||||||
set-option global smarttab_smarttab_mode_name 'smart'
|
set-option global smarttab_smarttab_mode_name 'smart'
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
] ++ lib.lists.forEach
|
{
|
||||||
tabSettings
|
name = "WinCreate";
|
||||||
(v: {
|
option = ".*";
|
||||||
name = "WinSetOption";
|
commands = "kakboard-enable";
|
||||||
commands = "${v.tab}";
|
}
|
||||||
option =
|
] ++ lib.lists.forEach tabSettings (v: {
|
||||||
if isList v.filetype then
|
name = "WinSetOption";
|
||||||
let
|
commands = "${v.tab}";
|
||||||
flist = builtins.concatStringsSep "|" v.filetype;
|
option = if isList v.filetype then
|
||||||
in
|
"filetype=(${builtins.concatStringsSep "|" v.filetype})"
|
||||||
"filetype=(${flist})"
|
else
|
||||||
else
|
"filetype=${v.filetype}";
|
||||||
"filetype=${v.filetype}";
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
extraConfig = let ftypes = builtins.concatStringsSep "|" lspFiletypes; in ''
|
extraConfig = ''
|
||||||
# kak-lsp initialization
|
# kak-lsp initialization
|
||||||
eval %sh{kak-lsp --kakoune -s $kak_session}
|
eval %sh{kak-lsp --kakoune -s $kak_session}
|
||||||
hook global WinSetOption filetype=(${ftypes}) %{
|
hook global WinSetOption filetype=(${builtins.concatStringsSep "|" lspFiletypes}) %{
|
||||||
map buffer normal p ': enter-user-mode lsp<ret>'
|
map buffer user l ': enter-user-mode lsp<ret>' -docstring 'LSP mode'
|
||||||
lsp-enable-window
|
lsp-enable-window
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg = {
|
xdg = {
|
||||||
dataFile = {
|
dataFile = {
|
||||||
# not done here: compile ZLS and copy the binaries to ~/.local/share/zls
|
# compile ZLS and copy the binaries manually to ~/.local/share/zls
|
||||||
|
# TODO: get ZLS to compile with Nix.
|
||||||
"zls/zls.json".text = ''
|
"zls/zls.json".text = ''
|
||||||
{
|
{
|
||||||
"zig_lib_path": "${zig-master}/lib/zig/",
|
"zig_lib_path": "${zig-master}/lib/zig/",
|
||||||
|
@ -138,6 +130,12 @@ in {
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
configFile = {
|
||||||
|
"kak-lsp/kak-lsp.toml".source = ~/etc/kak-lsp.toml;
|
||||||
|
"../.tmux.conf".source = ~/etc/tmux.conf;
|
||||||
|
};
|
||||||
|
|
||||||
userDirs = {
|
userDirs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
desktop = "$HOME/usr";
|
desktop = "$HOME/usr";
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
with import <nixpkgs> { };
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
kakboard = stdenv.mkDerivation {
|
||||||
|
name = "kakoune-kakboard";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "lePerdu";
|
||||||
|
repo = "kakboard";
|
||||||
|
rev = "2f13f5cd99591b76ad5cba230815b80138825120";
|
||||||
|
sha256 = "1kvnbsv20y09rlnyar87qr0h26i16qsq801krswvxcwhid7ijlvd";
|
||||||
|
};
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/share/kak/autoload/plugins
|
||||||
|
cp kakboard.kak $out/share/kak/autoload/plugins/kakboard.kak
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
smarttab = stdenv.mkDerivation {
|
||||||
|
name = "kakoune-smarttab";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "andreyorst";
|
||||||
|
repo = "smarttab.kak";
|
||||||
|
rev = "e7fe8efd0b91ab8dc1c99c131f138de9b38fd965";
|
||||||
|
sha256 = "0x93mmxv9qi7vxsyqdhg4x5bvsl8sss9m2mq2qks6ghr5h9pmigk";
|
||||||
|
};
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/share/kak/autoload/plugins
|
||||||
|
cp -r rc $out/share/kak/autoload/plugins/smarttab
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
joule = stdenv.mkDerivation {
|
||||||
|
name = "kakoune-joule";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "katesuyu";
|
||||||
|
repo = "joule.kak";
|
||||||
|
rev = "17fb4a08c525b6a7e7899c29efafd55a94908cd4";
|
||||||
|
sha256 = "1jpl9x7a07f7igwd60dn2y3sxakpnlh07cja06l9fsnfpb02jis3";
|
||||||
|
};
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/share/kak/autoload
|
||||||
|
cp colors/joule.kak $out/share/kak/autoload
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
kakboard = kakboard;
|
||||||
|
joule = joule;
|
||||||
|
smarttab = smarttab;
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
snippet_support = true
|
||||||
|
verbosity = 2
|
||||||
|
|
||||||
|
[semantic_scopes]
|
||||||
|
variable = "variable"
|
||||||
|
entity_name_function = "function"
|
||||||
|
entity_name_type = "type"
|
||||||
|
variable_other_enummember = "variable"
|
||||||
|
entity_name_namespace = "module"
|
||||||
|
|
||||||
|
[semantic_tokens]
|
||||||
|
type = "type"
|
||||||
|
variable = "variable"
|
||||||
|
namespace = "module"
|
||||||
|
function = "function"
|
||||||
|
string = "string"
|
||||||
|
keyword = "keyword"
|
||||||
|
operator = "operator"
|
||||||
|
comment = "comment"
|
||||||
|
|
||||||
|
[semantic_modifiers]
|
||||||
|
documentation = "documentation"
|
||||||
|
readonly = "default+d"
|
||||||
|
|
||||||
|
[server]
|
||||||
|
timeout = 1800 # seconds = 30 minutes
|
||||||
|
|
||||||
|
[language.c_cpp]
|
||||||
|
filetypes = ["c", "cpp"]
|
||||||
|
roots = ["compile_commands.json", ".clangd"]
|
||||||
|
command = "clangd"
|
||||||
|
|
||||||
|
[language.haskell]
|
||||||
|
filetypes = ["haskell"]
|
||||||
|
roots = ["Setup.hs", "stack.yaml", "*.cabal"]
|
||||||
|
# You might also be interested in the newer, but early stage, haskell-language-server
|
||||||
|
# https://github.com/haskell/haskell-language-server
|
||||||
|
command = "hie-wrapper"
|
||||||
|
args = ["--lsp"]
|
||||||
|
|
||||||
|
[language.latex]
|
||||||
|
filetypes = ["latex"]
|
||||||
|
roots = [".git"]
|
||||||
|
command = "texlab"
|
||||||
|
|
||||||
|
[language.nix]
|
||||||
|
filetypes = ["nix"]
|
||||||
|
roots = ["flake.nix", "shell.nix", ".git"]
|
||||||
|
command = "rnix-lsp"
|
||||||
|
|
||||||
|
[language.rust]
|
||||||
|
filetypes = ["rust"]
|
||||||
|
roots = ["Cargo.toml"]
|
||||||
|
command = "sh"
|
||||||
|
args = ["-c", "if command -v rustup >/dev/null; then $(rustup which rls); else rls; fi"]
|
||||||
|
|
||||||
|
[language.zig]
|
||||||
|
filetypes = ["zig"]
|
||||||
|
roots = ["build.zig"]
|
||||||
|
command = "/home/lyla/.local/share/zls/zls"
|
|
@ -0,0 +1,42 @@
|
||||||
|
set -g mouse on
|
||||||
|
set -g prefix C-a
|
||||||
|
|
||||||
|
set-option -g set-titles on
|
||||||
|
set-option -g set-titles-string '[#S:#I] #W'
|
||||||
|
set-window-option -g automatic-rename on
|
||||||
|
set-option -g status-bg "#070707"
|
||||||
|
set-option -g status-fg "#969896"
|
||||||
|
|
||||||
|
set -g default-terminal "tmux-256color"
|
||||||
|
set -ga terminal-overrides ",*col*:Tc"
|
||||||
|
|
||||||
|
unbind c
|
||||||
|
bind c new-window
|
||||||
|
bind C-c new-window
|
||||||
|
unbind &
|
||||||
|
bind k confirm-before kill-window
|
||||||
|
bind C-k confirm-before kill-window
|
||||||
|
unbind l
|
||||||
|
bind C-a last-window
|
||||||
|
unbind C-b
|
||||||
|
bind a send-prefix
|
||||||
|
unbind n
|
||||||
|
bind n next-window
|
||||||
|
bind C-n next-window
|
||||||
|
unbind p
|
||||||
|
bind p previous-window
|
||||||
|
bind C-p previous-window
|
||||||
|
unbind d
|
||||||
|
bind d detach
|
||||||
|
bind C-d detach
|
||||||
|
set-option escape-time 0
|
||||||
|
unbind [
|
||||||
|
bind Escape copy-mode
|
||||||
|
|
||||||
|
unbind %
|
||||||
|
bind h split-window -h
|
||||||
|
bind C-h split-window -h
|
||||||
|
unbind "'"
|
||||||
|
bind v split-window -v
|
||||||
|
bind C-v split-window -v
|
||||||
|
bind / command-prompt "split-window 'exec man %%'"
|
Loading…
Reference in New Issue