/ readCommit.nix
readCommit.nix
 1  {...}:
 2  
 3  with builtins;
 4  let
 5    headFile = readFile ./.git/HEAD;
 6    headStr = replaceStrings ["ref: " "\n"] ["" ""] headFile;
 7    headPath = ./.git + ( "/" + headStr );
 8    commitFile = readFile headPath;
 9    commitHash = replaceStrings ["\n"] [""] commitFile;
10  in
11    builtins.hashFile "sha256" headPath
12