{ pkgs, ... }: let hgRepo = builtins.path { path = ./.hg; name = "depot-hg"; }; changesetDeriv = pkgs.runCommandLocal "depot-version" { HG_REPO = hgRepo; MERCURIAL = pkgs.mercurial; } '' mytmp=$(mktemp -d) pushd $mytmp ln -s $HG_REPO .hg echo -n "depot-$($MERCURIAL/bin/hg id --id | tr -d '+')" > $out popd rm -rf $mytmp ''; in builtins.readFile changesetDeriv