diff --git a/flake.lock b/flake.lock index fb68150..50de1ed 100644 --- a/flake.lock +++ b/flake.lock @@ -164,22 +164,22 @@ "nixpkgs": "nixpkgs", "nixpkgs-master": "nixpkgs-master", "nixpkgs-unstable": "nixpkgs-unstable", - "tokyonight-kak-src": "tokyonight-kak-src" + "smarttab-kak-src": "smarttab-kak-src" } }, - "tokyonight-kak-src": { + "smarttab-kak-src": { "flake": false, "locked": { - "lastModified": 1636104069, - "narHash": "sha256-dFe1iGLDuSGlpdI4AxR613KjhIGjbvKbrK/TPrpMJ4Y=", - "owner": "HeavyRain266", - "repo": "tokyonight.kak", - "rev": "f7ebeea07818df8ee7ea8e71b4dbfd3c0afdc05b", + "lastModified": 1649581983, + "narHash": "sha256-STLZSwQPM+gTnkA+FQOF4I0ifPTjQWpEc/95JRzvIqU=", + "owner": "andreyorst", + "repo": "smarttab.kak", + "rev": "86ac6599b13617ff938905ba4cdd8225d7eb6a2e", "type": "github" }, "original": { - "owner": "HeavyRain266", - "repo": "tokyonight.kak", + "owner": "andreyorst", + "repo": "smarttab.kak", "type": "github" } }, diff --git a/flake.nix b/flake.nix index a6319e9..79c7c11 100644 --- a/flake.nix +++ b/flake.nix @@ -30,8 +30,8 @@ flake = false; }; - tokyonight-kak-src = { - url = github:HeavyRain266/tokyonight.kak; + smarttab-kak-src = { + url = github:andreyorst/smarttab.kak; flake = false; }; }; @@ -54,13 +54,12 @@ overlays = attrValues self.overlays ++ singleton ( final: prev: let - buildPkg = name: - final.callPackage - (./. + "/pkgs/${name}.nix") - { "${name}-src" = inputs."${name}-src"; }; - pkgs = [ "dark-mode-notify" "luar" "tokyonight-kak" ]; + pkgs = import ./pkgs { + inherit inputs genAttrs; + inherit (final) callPackage; + }; in - genAttrs pkgs buildPkg // optionalAttrs + pkgs // optionalAttrs (prev.stdenv.system == "aarch64-darwin") { # Sub in x86 version of packages that don't build on Apple Silicon yet diff --git a/home/kakoune.nix b/home/kakoune.nix index 47aae3f..902cb17 100644 --- a/home/kakoune.nix +++ b/home/kakoune.nix @@ -8,6 +8,47 @@ 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 = [ { key = ""; @@ -21,15 +62,11 @@ mode = "normal"; docstring = "Open fzf-mode file dialog with ctrl-p"; } - ]; - - hooks = [ { - name = "WinSetOption"; - option = "filetype=(haskell)"; - commands = '' - lsp-enable-window - ''; + key = ""; + effect = ": fzf-modeb"; + mode = "normal"; + docstring = "Open fzf-mode buffer dialog with ctrl-b"; } ]; @@ -42,12 +79,13 @@ showMatching = true; + showWhitespace.enable = true; + ui.enableMouse = true; }; extraConfig = '' eval %sh{${pkgs.kak-lsp}/bin/kak-lsp --kakoune -s $kak_session} - powerline-start ''; plugins = with pkgs.kakounePlugins; [ @@ -58,11 +96,10 @@ kakboard kakoune-state-save kakoune-vertical-selection - powerline-kak - pkgs.tokyonight-kak + pkgs.smarttab-kak # needs luar - # pkgs.luar - # tabs-kak + pkgs.luar + tabs-kak ]; }; } diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..74bd4b4 --- /dev/null +++ b/pkgs/default.nix @@ -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 diff --git a/pkgs/smarttab-kak.nix b/pkgs/smarttab-kak.nix new file mode 100644 index 0000000..b783f8e --- /dev/null +++ b/pkgs/smarttab-kak.nix @@ -0,0 +1,8 @@ +{ kakouneUtils, smarttab-kak-src, ... }: + +with kakouneUtils; + +buildKakounePlugin { + name = "smarttab"; + src = smarttab-kak-src; +} diff --git a/pkgs/tokyonight-kak.nix b/pkgs/tokyonight-kak.nix deleted file mode 100644 index e6191c5..0000000 --- a/pkgs/tokyonight-kak.nix +++ /dev/null @@ -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 - ''; -}