diff --git a/home.nix b/home.nix index ed70fe4..28ab2f5 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ pkgs, ... }: let unstable = import {}; @@ -22,7 +22,6 @@ in { procps-ng mmv-go terminator - bottom ]; }; @@ -30,14 +29,17 @@ in { ./modules/alacritty.nix ./modules/bat.nix ./modules/broot.nix + ./modules/bottom.nix ./modules/dircolors.nix + ./modules/fzf.nix ./modules/git.nix + ./modules/go.nix + ./modules/gpg.nix ./modules/kakoune.nix ./modules/qogir_theme.nix ./modules/rofi.nix ./modules/sxhkd.nix ./modules/terminator.nix - ./modules/fzf.nix ]; programs = { diff --git a/modules/bottom.nix b/modules/bottom.nix new file mode 100644 index 0000000..904735e --- /dev/null +++ b/modules/bottom.nix @@ -0,0 +1,11 @@ +{ pkgs, lib, ... }: +let + tomlGenerate = (pkgs.formats.toml {}).generate "bottom-toml"; +in { + home.packages = [ pkgs.bottom ]; + xdg.configFile."bottom/bottom.toml".source = tomlGenerate { + "flags" = { + "left_legend" = true; + }; + }; +} diff --git a/modules/go.nix b/modules/go.nix new file mode 100644 index 0000000..f8d8c26 --- /dev/null +++ b/modules/go.nix @@ -0,0 +1,5 @@ +{ + programs.go = { + enable = true; + }; +} diff --git a/modules/gpg.nix b/modules/gpg.nix new file mode 100644 index 0000000..6ad7fee --- /dev/null +++ b/modules/gpg.nix @@ -0,0 +1,14 @@ +{ + programs.gpg = { + enable = true; + settings = { + + }; + }; + + services.gpg-agent = { + enable = true; + defaultCacheTtl = 600; + # extraConfig = "allow-loopback-pinentry"; + }; +} diff --git a/modules/kakoune.nix b/modules/kakoune.nix index a8dcd86..91ca972 100644 --- a/modules/kakoune.nix +++ b/modules/kakoune.nix @@ -25,126 +25,43 @@ in { enable = true; highlightCursor = true; }; - keyMappings = [{ - mode = "normal"; - docstring = "Open file"; - key = ""; - effect = ":edit"; - } { - mode = "user"; - docstring = "Comment block"; - key = "b"; - effect = ":comment-block"; - } { - mode = "user"; - docstring = "Comment line"; - key = "l"; - effect = ":comment-line"; - } { - mode = "user"; - docstring = "Show hover info"; - key = "q"; - effect = ":lsp-hover"; - } { - mode = "user"; - docstring = "Jump to definition"; - key = "d"; - effect = ":lsp-definition"; - } { - mode = "user"; - docstring = "List project diagnostics"; - key = "i"; - effect = ":lsp-diagnostics"; - } { - mode = "user"; - docstring = "Jump to type definition"; - key = "t"; - effect = ":lsp-type-definition"; - } { - mode = "user"; - docstring = "Code actions"; - key = "a"; - effect = ":lsp-code-actions"; - } { - mode = "user"; - docstring = "Format code"; - key = "F"; - effect = ":lsp-formatting-sync"; - } { - mode = "user"; - docstring = "Spellcheck"; - key = "s"; - effect = ":spell "; - } { - mode = "user"; - docstring = "Spellcheck English"; - key = "S"; - effect = ":spell en"; - } { - mode = "user"; - docstring = "Copy to clipboard"; - key = "y"; - effect = "${pkgs.xclip}/bin/xclip -i -selection clipboard"; - } { - mode = "user"; - docstring = "Paste from clipboard (before)"; - key = "p"; - effect = "!${pkgs.xclip}/bin/xclip -selection clipboard -o"; - } { - mode = "user"; - docstring = "Paste from clipboard (after)"; - key = "P"; - effect = "${pkgs.xclip}/bin/xclip -selection clipboard -o"; - }]; - hooks = [{ - name = "WinSetOption"; - option = "filetype=(rust|python|c|cpp|latex|javascript|go)"; - commands = builtins.concatStringsSep "\n" [ - "lsp-enable-window" - ]; - } { - name = "BufCreate"; - option = ".*"; - commands = "editorconfig-load"; - } { - name = "ModuleLoaded"; - option = "powerline"; - commands = builtins.concatStringsSep "\n" [ - # "powerline-theme default" - "powerline-enable" - ]; - } { - name = "ModuleLoaded"; - option = "auto-pairs"; - commands = "auto-pairs-enable"; - } { - name = "InsertCompletionShow"; - option = ".*"; - commands = builtins.concatStringsSep "\n" [ - "map window insert " - "map window insert " - ]; - } { - name = "InsertCompletionHide"; - option = ".*"; - commands = builtins.concatStringsSep "\n" [ - "unmap window insert " - "unmap window insert " - ]; - }]; + keyMappings = [ + { mode = "normal"; docstring = "Open file"; key = ""; effect = ":edit"; } + { mode = "user"; docstring = "Comment block"; key = "b"; effect = ":comment-block"; } + { mode = "user"; docstring = "Comment line"; key = "l"; effect = ":comment-line"; } + { mode = "user"; docstring = "Show hover info"; key = "q"; effect = ":lsp-hover"; } + { mode = "user"; docstring = "Jump to definition"; key = "d"; effect = ":lsp-definition"; } + { mode = "user"; docstring = "List project diagnostics"; key = "i"; effect = ":lsp-diagnostics"; } + { mode = "user"; docstring = "Jump to type definition"; key = "t"; effect = ":lsp-type-definition"; } + { mode = "user"; docstring = "Code actions"; key = "a"; effect = ":lsp-code-actions"; } + { mode = "user"; docstring = "Format code"; key = "F"; effect = ":lsp-formatting-sync"; } + { mode = "user"; docstring = "Spellcheck"; key = "s"; effect = ":spell "; } + { mode = "user"; docstring = "Spellcheck English"; key = "S"; effect = ":spell en"; } + { mode = "user"; docstring = "Copy to clipboard"; key = "y"; effect = "${pkgs.xclip}/bin/xclip -i -selection clipboard"; } + { mode = "user"; docstring = "Paste from clipboard (before)"; key = "p"; effect = "!${pkgs.xclip}/bin/xclip -selection clipboard -o"; } + { mode = "user"; docstring = "Paste from clipboard (after)"; key = "P"; effect = "${pkgs.xclip}/bin/xclip -selection clipboard -o"; } + ]; + hooks = [ + { name = "WinSetOption"; option = "filetype=(rust|python|c|cpp|latex|javascript|go)"; commands = builtins.concatStringsSep "\n" [ "lsp-enable-window" ]; } + { name = "BufCreate"; option = ".*"; commands = "editorconfig-load"; } + # { name = "ModuleLoaded"; option = "powerline"; commands = builtins.concatStringsSep "\n" [ "powerline-enable" ]; } + # { name = "ModuleLoaded"; option = "auto-pairs"; commands = "auto-pairs-enable"; } + { name = "InsertCompletionShow"; option = ".*"; commands = builtins.concatStringsSep "\n" [ "map window insert " "map window insert " ]; } + { name = "InsertCompletionHide"; option = ".*"; commands = builtins.concatStringsSep "\n" [ "unmap window insert " "unmap window insert " ]; } + ]; }; extraConfig = builtins.concatStringsSep "\n" [ "# Extra" "define-command -docstring 'save and quit' x 'write-all; quit'" - "add-highlighter global/ regex \\h+$ 0:Error" - "eval %sh{kak-lsp --kakoune -s \$kak_session}" - "require-module auto-pairs" - "require-module powerline" + "add-highlighter global/ regex \\h+$ 0:Error # " + "eval %sh{kak-lsp --kakoune -s \$kak_session} # Start kak-lsp" + # "require-module auto-pairs" + # "require-module powerline" ]; - plugins = with pkgs; [ - kakounePlugins.kak-auto-pairs - unstable.kakounePlugins.powerline-kak - unstable.kakounePlugins.prelude-kak + plugins = with pkgs.kakounePlugins; [ + kak-auto-pairs + # unstable.kakounePlugins.powerline-kak + # unstable.kakounePlugins.prelude-kak ]; }; } diff --git a/modules/sxhkd.nix b/modules/sxhkd.nix index 19a36e7..9621eee 100644 --- a/modules/sxhkd.nix +++ b/modules/sxhkd.nix @@ -28,10 +28,10 @@ in { enable = true; keybindings = { - "super + Return" = "${bash} -c ${alacritty} || ${terminator}"; + "super + Return" = "${bash} -c ${alacritty} || /usr/bin/alacritty || ${terminator}"; "super + @space" = "${rofi} -show drun"; "super + e" = "${nautilus} -w"; - "super + alt + m" = ''${betterlockscreen} -l -t "Welcome back $USER"''; + "super + alt + {,+ shift} + m" = ''${betterlockscreen} {-l,-s} -t "Welcome back $USER"''; "super + Escape" = "pkill -USR1 -x sxhkd"; "super + alt + {q,r}" = "${bspc} {quit,wm -r}"; "super + {_,shift + }w" = "${bspc} node -{c,k}";