citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

default.nix (898B)


      1 { stdenv
      2 , perlPackages
      3 , makeWrapper
      4 , perl
      5 , rsync
      6 , lib
      7 , coreutils
      8 , openssh
      9 , fetchFromGitHub
     10 }:
     11 let
     12   inputs = [ perl perlPackages.URI perlPackages.AnyURIEscape rsync openssh coreutils ];
     13   buildPaths = sep: fmt: "${lib.concatStringsSep sep (map fmt inputs)}";
     14 in stdenv.mkDerivation rec {
     15   name = "sharefile-${version}";
     16   version = "1.2";
     17   buildInputs = [ makeWrapper ] ++ inputs;
     18 
     19   src = fetchFromGitHub {
     20     rev = version;
     21     owner = "jb55";
     22     repo = "sharefile";
     23     sha256 = "0cvw2hakxsjmpn5frfxp38jpc94knq0lfrzqhpv1xah6l83cb4vy";
     24   };
     25 
     26   installPhase = ''
     27     mkdir -p $out/bin
     28 
     29     cp sharefile $out/bin
     30     cp share_last_ss $out/bin
     31     cp hashname $out/bin
     32     cp hashshare $out/bin
     33 
     34     for prog in $(echo "$out/bin/"*)
     35     do
     36       wrapProgram "$prog" \
     37         --prefix PERL5LIB : "$PERL5LIB" \
     38         --prefix PATH : "${buildPaths ":" (f: "${f}/bin")}"
     39     done
     40   '';
     41 }