pkgs/shells: move extensions to subdirs
These are not reaal shells and should go into their parent shell directory.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{ stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "bash-completion-${version}";
|
||||
version = "2.8";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/scop/bash-completion/releases/download/${version}/${name}.tar.xz";
|
||||
sha256 = "0kgmflrr1ga9wfk770vmakna3nj46ylb5ky9ipd0v2k9ymq5a7y0";
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
|
||||
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://github.com/scop/bash-completion;
|
||||
description = "Programmable completion for the bash shell";
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = platforms.unix;
|
||||
maintainers = [ maintainers.peti ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{ stdenv, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.6.5";
|
||||
name = "nix-bash-completions-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hedning";
|
||||
repo = "nix-bash-completions";
|
||||
rev = "v${version}";
|
||||
sha256 = "10f70jw81vky52s3fidf7vzl725fihiypsw39825wnkpynayhmrg";
|
||||
};
|
||||
|
||||
# To enable lazy loading via. bash-completion we need a symlink to the script
|
||||
# from every command name.
|
||||
installPhase = ''
|
||||
commands=$(
|
||||
function complete() { shift 2; echo "$@"; }
|
||||
shopt -s extglob
|
||||
source _nix
|
||||
)
|
||||
install -Dm444 -t $out/share/bash-completion/completions _nix
|
||||
cd $out/share/bash-completion/completions
|
||||
for c in $commands; do
|
||||
ln -s _nix $c
|
||||
done
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://github.com/hedning/nix-bash-completions;
|
||||
description = "Bash completions for Nix, NixOS, and NixOps";
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ hedning ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user