home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (710B)


      1 { stdenv, lib, python3, fetchFromGitHub }:
      2 
      3 stdenv.mkDerivation rec {
      4   pname = "kss";
      5   version = "0.0.2";
      6   name = "${pname}-${version}";
      7 
      8   src = fetchFromGitHub {
      9     owner = "chmouel";
     10     repo = "kss";
     11     rev = "${version}";
     12     sha256 = "1akjval7f17ij0fwyghspp2p27agkls82nafynfaxiakmxwmr7lr";
     13   };
     14   buildInputs = [ python3 ];
     15   installPhase = ''
     16     substituteInPlace kss --replace \
     17         "fileout.write(('#!/usr/bin/env %s\n' % env).encode('utf-8'))" \
     18         "fileout.write(('#!%s/bin/%s\n' % (os.environ['python3'], env)).encode('utf-8'))"
     19     mkdir -p $out/bin
     20     cp kss $out/bin
     21     # completions
     22     mkdir -p $out/share/zsh/site-functions
     23     cp _kss $out/share/zsh/site-functions/
     24   '';
     25 }