depot/version.nix

19 lines
416 B
Nix
Raw Normal View History

{ pkgs, ... }:
let
hgRepo = builtins.path { path = ./.hg; name = "depot-hg"; };
changesetDeriv = pkgs.runCommandLocal "depot-version" {
HG_REPO = hgRepo;
MERCURIAL = pkgs.mercurial;
} ''
2021-01-11 18:35:22 +00:00
export HGPLAIN=
mytmp=$(mktemp -d)
pushd $mytmp
ln -s $HG_REPO .hg
2021-01-11 18:35:22 +00:00
echo -n "depot-$($MERCURIAL/bin/hg id --id -r.)" > $out
popd
rm -rf $mytmp
'';
in
builtins.readFile changesetDeriv