From cf35e08566d4b60fa8ec1d8493feac45f286091c Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Wed, 17 Mar 2021 23:06:22 +0300 Subject: [PATCH] add fzf --- modules/workspace/zsh.nix | 146 ++++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 69 deletions(-) diff --git a/modules/workspace/zsh.nix b/modules/workspace/zsh.nix index 909b02a..00fba2e 100644 --- a/modules/workspace/zsh.nix +++ b/modules/workspace/zsh.nix @@ -2,78 +2,86 @@ environment.pathsToLink = [ "/share/zsh" ]; environment.sessionVariables.SHELL = "zsh"; - home-manager.users.alukard.programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - oh-my-zsh = { + home-manager.users.alukard.programs = { + zsh = { enable = true; - theme = "agnoster"; - plugins = [ "git" "dirhistory" ]; + enableAutosuggestions = true; + enableCompletion = true; + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = [ "git" "dirhistory" ]; + }; + plugins = [ + { + name = "zsh-nix-shell"; + file = "nix-shell.plugin.zsh"; + src = inputs.zsh-nix-shell; + } + { + name = "zsh-autosuggestions"; + src = inputs.zsh-autosuggestions; + } + { + name = "you-should-use"; + src = inputs.zsh-you-should-use; + } + ]; + + envExtra = '' + SHELL="${pkgs.zsh}/bin/zsh"; + ''; + + shellAliases = { + "clr" = "clear"; + "weather" = "curl wttr.in/Volzhskiy"; + # "l" = "ls -lah --group-directories-first"; + "rede" = "systemctl --user start redshift.service &"; + "redd" = "systemctl --user stop redshift.service &"; + "bare" = "systemctl --user start barrier-client.service &"; + "bard" = "systemctl --user stop barrier-client.service &"; + "wgup" = "_ systemctl start wg-quick-wg0.service"; + "wgdown" = "_ systemctl stop wg-quick-wg0.service"; + "show-packages" = "_ nix-store -q --references /run/current-system/sw"; + "cat" = "${pkgs.bat}/bin/bat"; + "nsp" = "nix-shell --run zsh -p"; + "find" = "fd"; + "grep" = "rg"; + # "mkdir" = "ad"; + "man" = "pinfo"; + "l" = "exa -lahgF@ --git --group-directories-first"; + "tree" = "exa -T"; + "ltree" = "exa -lhgFT@ --git"; + "atree" = "exa -aT"; + "latree" = "exa -lahgFT@ --git"; + }; + initExtra = '' + + nixify() { + if [ ! -e ./.envrc ]; then + echo 'use nix' > .envrc + direnv allow + fi + if [ ! -e shell.nix ]; then + cat > shell.nix <<'EOF' + { pkgs ? import {} }: + # with import {}; + pkgs.mkShell { + # Hack SSL Cert error + GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt; + SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt; + buildInputs = []; + } + EOF + fi + } + ''; }; - plugins = [ - { - name = "zsh-nix-shell"; - file = "nix-shell.plugin.zsh"; - src = inputs.zsh-nix-shell; - } - { - name = "zsh-autosuggestions"; - src = inputs.zsh-autosuggestions; - } - { - name = "you-should-use"; - src = inputs.zsh-you-should-use; - } - ]; - envExtra = '' - SHELL="${pkgs.zsh}/bin/zsh"; - ''; - - shellAliases = { - "clr" = "clear"; - "weather" = "curl wttr.in/Volzhskiy"; - # "l" = "ls -lah --group-directories-first"; - "rede" = "systemctl --user start redshift.service &"; - "redd" = "systemctl --user stop redshift.service &"; - "bare" = "systemctl --user start barrier-client.service &"; - "bard" = "systemctl --user stop barrier-client.service &"; - "wgup" = "_ systemctl start wg-quick-wg0.service"; - "wgdown" = "_ systemctl stop wg-quick-wg0.service"; - "show-packages" = "_ nix-store -q --references /run/current-system/sw"; - "cat" = "${pkgs.bat}/bin/bat"; - "nsp" = "nix-shell --run zsh -p"; - "find" = "fd"; - "grep" = "rg"; - # "mkdir" = "ad"; - "man" = "pinfo"; - "l" = "exa -lahgF@ --git --group-directories-first"; - "tree" = "exa -T"; - "ltree" = "exa -lhgFT@ --git"; - "atree" = "exa -aT"; - "latree" = "exa -lahgFT@ --git"; + fzf = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; }; - initExtra = '' - - nixify() { - if [ ! -e ./.envrc ]; then - echo 'use nix' > .envrc - direnv allow - fi - if [ ! -e shell.nix ]; then - cat > shell.nix <<'EOF' - { pkgs ? import {} }: - # with import {}; - pkgs.mkShell { - # Hack SSL Cert error - GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt; - SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt; - buildInputs = []; - } - EOF - fi - } - ''; }; }