From 9d3fff359b6c2cea4ac69299f3c1621af8bde64c Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 16 Oct 2022 19:03:35 -0700 Subject: ref(tools/git-blame-stats): rewrite the tool in python The tool can calculate some stats about authors in a git repository. It computes the number of lines that are authored by authors at a given revision (HEAD by default), and the number of commits. --- tools/git-blame-stats/default.nix | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'tools/git-blame-stats/default.nix') diff --git a/tools/git-blame-stats/default.nix b/tools/git-blame-stats/default.nix index 5071f10..767329b 100644 --- a/tools/git-blame-stats/default.nix +++ b/tools/git-blame-stats/default.nix @@ -1,15 +1,25 @@ -{ pkgs, buildGoModule, ... }: +{ self, lib, python3, stdenvNoCC, pkgs }: + +stdenvNoCC.mkDerivation rec { + pname = "git-blame-stats"; + src = ./git-blame-stats.py; + version = "0.1.1"; + + nativeBuildInputs = with pkgs; [ python3 ]; + + dontUnpack = true; + dontBuild = true; + + installPhase = '' + mkdir -p $out/bin + cp $src $out/bin/${pname} + ''; -buildGoModule rec { - name = "git-blame-stats"; - src = ./.; - vendorSha256 = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="; - nativeBuildInputs = with pkgs; [ go ]; meta = with pkgs.lib; { description = "CLI to reports git blame statistics per author."; license = licenses.mit; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = [ ]; }; } -- cgit v1.2.3