diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-10-30 14:20:24 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-10-30 14:49:58 -0400 |
commit | c34f5176f1173ac2cdaeed4512a61389d98f9d9f (patch) | |
tree | d777bd7d3097c3caca4f3069995c8db9425d4edf /pkgs/top-level | |
parent | 88cd633ea4dec7b9a247c0fd8ccb95f4982f5bf7 (diff) |
haskell-lib: Factor out shell completion scripts helper
Diffstat (limited to 'pkgs/top-level')
-rw-r--r-- | pkgs/top-level/all-packages.nix | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a2152113ae573..abd7db6263d5f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1001,10 +1001,10 @@ with pkgs; cue2pops = callPackage ../tools/cd-dvd/cue2pops { }; - cabal2nix = haskell.lib.overrideCabal haskellPackages.cabal2nix (drv: { + cabal2nix = haskell.lib.overrideCabal (haskell.lib.addOptparseApplicativeCompletionScripts "cabal2nix" haskellPackages.cabal2nix) (drv: { isLibrary = false; enableSharedExecutables = false; - executableToolDepends = [ makeWrapper ]; + executableToolDepends = (drv.executableToolDepends or []) ++ [ makeWrapper ]; postInstall = '' exe=$out/libexec/${drv.pname}-${drv.version}/${drv.pname} install -D $out/bin/${drv.pname} $exe @@ -1012,11 +1012,7 @@ with pkgs; makeWrapper $exe $out/bin/${drv.pname} \ --prefix PATH ":" "${nix}/bin" \ --prefix PATH ":" "${nix-prefetch-scripts}/bin" - mkdir -p $out/share/{bash-completion/completions,zsh/vendor-completions,fish/completions} - $exe --bash-completion-script $exe >$out/share/bash-completion/completions/${drv.pname} - $exe --zsh-completion-script $exe >$out/share/zsh/vendor-completions/_${drv.pname} - $exe --fish-completion-script $exe >$out/share/fish/completions/${drv.pname}.fish - ''; + '' + (drv.postInstall or ""); }); stack2nix = with haskell.lib; overrideCabal (justStaticExecutables haskellPackages.stack2nix) (drv: { |