From d90af1448cfa1d7a013c80d435878023f92471bf Mon Sep 17 00:00:00 2001 From: Icy-Thought Date: Fri, 18 Oct 2024 16:39:21 +0200 Subject: [PATCH] zsh-abbr: a newer installPhase approach --- pkgs/shells/zsh/zsh-abbr/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/shells/zsh/zsh-abbr/default.nix b/pkgs/shells/zsh/zsh-abbr/default.nix index 5294d7831a494..c9e0e9de85f88 100644 --- a/pkgs/shells/zsh/zsh-abbr/default.nix +++ b/pkgs/shells/zsh/zsh-abbr/default.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + installShellFiles, }: stdenv.mkDerivation rec { pname = "zsh-abbr"; @@ -15,12 +16,18 @@ stdenv.mkDerivation rec { }; strictDeps = true; + nativeBuildInputs = [ installShellFiles ]; installPhase = '' - install -D zsh-abbr.zsh $out/share/zsh/${pname}/abbr.plugin.zsh - # Needed so that `man` can find the manpage, since it looks via PATH - mkdir -p $out/bin - mv man $out/share/man + runHook preInstall + + install zsh-abbr.plugin.zsh zsh-abbr.zsh -Dt $out/share/zsh/zsh-abbr/ + install completions/_abbr -Dt $out/share/zsh/zsh-abbr/completions/ + + # Required for `man` to find the manpage of abbr, since it looks via PATH + installManPage man/man1/* + + runHook postInstall ''; meta = with lib; {