From 2c933ad3db8bd168709a967c27cfa5c3457a9006 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Mon, 17 Aug 2015 22:00:47 -0500 Subject: [PATCH] nixpkgs: add tarsnap shell completion utils Signed-off-by: Austin Seipp --- pkgs/tools/backup/tarsnap/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/tools/backup/tarsnap/default.nix b/pkgs/tools/backup/tarsnap/default.nix index 280c0cdb05ea..e2857eed7d86 100644 --- a/pkgs/tools/backup/tarsnap/default.nix +++ b/pkgs/tools/backup/tarsnap/default.nix @@ -1,5 +1,16 @@ { stdenv, fetchurl, openssl, zlib, e2fsprogs }: +let + bashCompletion = fetchurl { + url = "https://gist.githubusercontent.com/thoughtpolice/daa9431044883d3896f6/raw/282360677007db9739e5bf229873d3b231eb303a/tarsnap.bash"; + sha256 = "1cj7m0n3sw9vlaz2dfvf0bgaxkv1pcc0l31zb4h5rmm8z6d33405"; + }; + + zshCompletion = fetchurl { + url = "https://gist.githubusercontent.com/thoughtpolice/daa9431044883d3896f6/raw/282360677007db9739e5bf229873d3b231eb303a/tarsnap.zsh"; + sha256 = "0pawqwichzpz29rva7mh8lpx4zznnrh2rqyzzj6h7z98l0dxpair"; + }; +in stdenv.mkDerivation rec { name = "tarsnap-${version}"; version = "1.0.35"; @@ -9,6 +20,13 @@ stdenv.mkDerivation rec { sha256 = "16lc14rwrq84fz95j1g10vv0qki0qw73lzighidj5g23pib6g7vc"; }; + postInstall = '' + # Install some handy-dandy shell completions + mkdir -p $out/etc/bash_completion.d $out/share/zsh/site-functions + cp ${bashCompletion} $out/etc/bash_completion.d/tarsnap.bash + cp ${zshCompletion} $out/share/zsh/site-functions/_tarsnap + ''; + buildInputs = [ openssl zlib e2fsprogs ]; meta = {