package.nix (1081B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 bashInteractive, 6 installShellFiles, 7 bash, 8 }: 9 10 stdenv.mkDerivation (finalAttrs: { 11 pname = "bash-completor"; 12 version = "0.2.0"; 13 14 src = fetchFromGitHub { 15 owner = "adoyle-h"; 16 repo = "bash-completor"; 17 tag = "v${finalAttrs.version}"; 18 hash = "sha256-nE+UPjDglFEPXyKZk1cs22eUaUxnWEjikMKcku4Pmy0="; 19 }; 20 21 postPatch = '' 22 substituteInPlace tools/build-dist --replace "/usr/bin/env bash" "${lib.getExe bash}" 23 ''; 24 25 nativeBuildInputs = [ 26 bashInteractive 27 installShellFiles 28 ]; 29 30 buildFlags = [ "build" ]; 31 32 installPhase = '' 33 install -Dm755 dist/bash-completor -t $out/bin 34 installShellCompletion dist/bash-completor.completion.bash 35 ''; 36 37 meta = { 38 description = "Creating a bash completion script in a declarative way"; 39 homepage = "https://github.com/adoyle-h/bash-completor"; 40 license = lib.licenses.asl20; 41 maintainers = [ lib.maintainers.sikmir ]; 42 platforms = lib.platforms.unix; 43 broken = stdenv.isLinux; # ./tools/build-dist: cannot execute: required file not found 44 }; 45 })