Reorganize pkgs, kak tweaks

work
mat ess 2022-07-21 19:51:23 -04:00
parent 309c858862
commit ee0c4462ee
6 changed files with 83 additions and 48 deletions

View File

@ -164,22 +164,22 @@
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-master": "nixpkgs-master", "nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"tokyonight-kak-src": "tokyonight-kak-src" "smarttab-kak-src": "smarttab-kak-src"
} }
}, },
"tokyonight-kak-src": { "smarttab-kak-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1636104069, "lastModified": 1649581983,
"narHash": "sha256-dFe1iGLDuSGlpdI4AxR613KjhIGjbvKbrK/TPrpMJ4Y=", "narHash": "sha256-STLZSwQPM+gTnkA+FQOF4I0ifPTjQWpEc/95JRzvIqU=",
"owner": "HeavyRain266", "owner": "andreyorst",
"repo": "tokyonight.kak", "repo": "smarttab.kak",
"rev": "f7ebeea07818df8ee7ea8e71b4dbfd3c0afdc05b", "rev": "86ac6599b13617ff938905ba4cdd8225d7eb6a2e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "HeavyRain266", "owner": "andreyorst",
"repo": "tokyonight.kak", "repo": "smarttab.kak",
"type": "github" "type": "github"
} }
}, },

View File

@ -30,8 +30,8 @@
flake = false; flake = false;
}; };
tokyonight-kak-src = { smarttab-kak-src = {
url = github:HeavyRain266/tokyonight.kak; url = github:andreyorst/smarttab.kak;
flake = false; flake = false;
}; };
}; };
@ -54,13 +54,12 @@
overlays = attrValues self.overlays ++ singleton ( overlays = attrValues self.overlays ++ singleton (
final: prev: final: prev:
let let
buildPkg = name: pkgs = import ./pkgs {
final.callPackage inherit inputs genAttrs;
(./. + "/pkgs/${name}.nix") inherit (final) callPackage;
{ "${name}-src" = inputs."${name}-src"; }; };
pkgs = [ "dark-mode-notify" "luar" "tokyonight-kak" ];
in in
genAttrs pkgs buildPkg // optionalAttrs pkgs // optionalAttrs
(prev.stdenv.system == "aarch64-darwin") (prev.stdenv.system == "aarch64-darwin")
{ {
# Sub in x86 version of packages that don't build on Apple Silicon yet # Sub in x86 version of packages that don't build on Apple Silicon yet

View File

@ -8,6 +8,47 @@
colorScheme = "tokyonight"; colorScheme = "tokyonight";
hooks = [
{
name = "BufOpenFile";
option = ".*";
commands = "expandtab";
}
{
name = "BufNewFile";
option = ".*";
commands = "expandtab";
}
{
name = "WinSetOption";
option = "filetype=(makefile)";
commands = "noexpandtab";
}
{
name = "ModuleLoaded";
option = "smarttab";
commands = ''
set-option global softtabstop %opt{indentwidth}
'';
}
{
name = "WinSetOption";
option = "filetype=(haskell)";
commands = ''
lsp-enable-window
'';
}
{
name = "WinSetOption";
option = "filetype=(haskell|nix)";
commands = ''
set-option window indentwidth 2
'';
}
];
indentWidth = 4;
keyMappings = [ keyMappings = [
{ {
key = "<c-a-p>"; key = "<c-a-p>";
@ -21,15 +62,11 @@
mode = "normal"; mode = "normal";
docstring = "Open fzf-mode file dialog with ctrl-p"; docstring = "Open fzf-mode file dialog with ctrl-p";
} }
];
hooks = [
{ {
name = "WinSetOption"; key = "<c-b>";
option = "filetype=(haskell)"; effect = ": fzf-mode<ret>b<ret>";
commands = '' mode = "normal";
lsp-enable-window docstring = "Open fzf-mode buffer dialog with ctrl-b";
'';
} }
]; ];
@ -42,12 +79,13 @@
showMatching = true; showMatching = true;
showWhitespace.enable = true;
ui.enableMouse = true; ui.enableMouse = true;
}; };
extraConfig = '' extraConfig = ''
eval %sh{${pkgs.kak-lsp}/bin/kak-lsp --kakoune -s $kak_session} eval %sh{${pkgs.kak-lsp}/bin/kak-lsp --kakoune -s $kak_session}
powerline-start
''; '';
plugins = with pkgs.kakounePlugins; [ plugins = with pkgs.kakounePlugins; [
@ -58,11 +96,10 @@
kakboard kakboard
kakoune-state-save kakoune-state-save
kakoune-vertical-selection kakoune-vertical-selection
powerline-kak pkgs.smarttab-kak
pkgs.tokyonight-kak
# needs luar # needs luar
# pkgs.luar pkgs.luar
# tabs-kak tabs-kak
]; ];
}; };
} }

9
pkgs/default.nix Normal file
View File

@ -0,0 +1,9 @@
{ callPackage, inputs, genAttrs }:
let
buildPkg = name:
callPackage
(./. + "/${name}.nix")
{ "${name}-src" = inputs."${name}-src"; };
pkgs = [ "dark-mode-notify" "luar" "smarttab-kak" ];
in
genAttrs pkgs buildPkg

8
pkgs/smarttab-kak.nix Normal file
View File

@ -0,0 +1,8 @@
{ kakouneUtils, smarttab-kak-src, ... }:
with kakouneUtils;
buildKakounePlugin {
name = "smarttab";
src = smarttab-kak-src;
}

View File

@ -1,18 +0,0 @@
{ stdenv, tokyonight-kak-src, ... }:
let
colorsPath = "share/kak/colors";
in
stdenv.mkDerivation rec {
name = "tokyonight";
src = tokyonight-kak-src;
installPhase = ''
runHook preInstall
target=$out/${colorsPath}
mkdir -p $target
cp -r colors/*.kak $target
runHook postInstall
'';
}