depot: add version attribute which is the current changeset
This commit is contained in:
parent
2969ca571a
commit
ef6eb092f9
2 changed files with 19 additions and 0 deletions
|
@ -21,6 +21,8 @@ in fix (self:
|
|||
web = import ./web ch;
|
||||
go = import ./go ch;
|
||||
|
||||
version = import ./version.nix ch;
|
||||
|
||||
lib = self.third_party.nixpkgs.lib;
|
||||
|
||||
pkgs = self.third_party.nixpkgs // self.nix.pkgs;
|
||||
|
|
17
version.nix
Normal file
17
version.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ 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
|
Loading…
Reference in a new issue