Skip to content

Commit

Permalink
zsh-autosuggestions: init at 0.3.3 (#21792)
Browse files Browse the repository at this point in the history
Added a related `programs.zsh.enableAutosuggestions` option
  • Loading branch information
Yacine Hmito authored and fpletz committed Jan 11, 2017
1 parent c03bc57 commit f88e2fb
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nixos/modules/programs/zsh/zsh.nix
Expand Up @@ -91,6 +91,13 @@ in
'';
type = types.bool;
};

enableAutosuggestions = mkOption {
default = false;
description = ''
Enable zsh-autosuggestions
'';
};

};

Expand Down Expand Up @@ -132,6 +139,10 @@ in
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
}
${optionalString (cfg.enableAutosuggestions)
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
}
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
'';

Expand Down
32 changes: 32 additions & 0 deletions pkgs/shells/zsh-autosuggestions/default.nix
@@ -0,0 +1,32 @@
{ stdenv, fetchFromGitHub, zsh }:

# To make use of this derivation, use the `programs.zsh.enableAutoSuggestions` option

stdenv.mkDerivation rec {
name = "zsh-autosuggestions-${version}";
version = "0.3.3";

src = fetchFromGitHub {
repo = "zsh-autosuggestions";
owner = "zsh-users";
rev = "v${version}";
sha256 = "0mnwyz4byvckrslzqfng5c0cx8ka0y12zcy52kb7amg3l07jrls4";
};

buildInputs = [ zsh ];

buildPhases = [ "unpackPhase" "installPhase" ];

installPhase = ''
install -D zsh-autosuggestions.zsh \
$out/share/zsh-autosuggestions/zsh-autosuggestions.zsh
'';

meta = with stdenv.lib; {
description = "Fish shell autosuggestions for Zsh";
homepage = "https://github.com/zsh-users/zsh-autosuggestions";
license = licenses.mit;
platforms = platforms.unix;
maintainers = [ maintainers.loskutov ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -4553,6 +4553,8 @@ in

zsh-syntax-highlighting = callPackage ../shells/zsh-syntax-highlighting { };

zsh-autosuggestions = callPackage ../shells/zsh-autosuggestions { };

zstd = callPackage ../tools/compression/zstd { };

zsync = callPackage ../tools/compression/zsync { };
Expand Down

0 comments on commit f88e2fb

Please sign in to comment.