depot/version.nix

18 lines
416 B
Nix

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