nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

package.nix (1110B)


      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   __structuredAttrs = true;
     15 
     16   src = fetchFromGitHub {
     17     owner = "adoyle-h";
     18     repo = "bash-completor";
     19     tag = "v${finalAttrs.version}";
     20     hash = "sha256-nE+UPjDglFEPXyKZk1cs22eUaUxnWEjikMKcku4Pmy0=";
     21   };
     22 
     23   postPatch = ''
     24     substituteInPlace tools/build-dist --replace "/usr/bin/env bash" "${lib.getExe bash}"
     25   '';
     26 
     27   nativeBuildInputs = [
     28     bashInteractive
     29     installShellFiles
     30   ];
     31 
     32   buildFlags = [ "build" ];
     33 
     34   installPhase = ''
     35     install -Dm755 dist/bash-completor -t $out/bin
     36     installShellCompletion dist/bash-completor.completion.bash
     37   '';
     38 
     39   meta = {
     40     description = "Creating a bash completion script in a declarative way";
     41     homepage = "https://github.com/adoyle-h/bash-completor";
     42     license = lib.licenses.asl20;
     43     maintainers = [ lib.maintainers.sikmir ];
     44     platforms = lib.platforms.unix;
     45     broken = stdenv.isLinux; # ./tools/build-dist: cannot execute: required file not found
     46   };
     47 })