diff --git a/default.nix b/default.nix index 805f49b9f1..cf9e3cb1fa 100644 --- a/default.nix +++ b/default.nix @@ -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; diff --git a/version.nix b/version.nix new file mode 100644 index 0000000000..a5a062b769 --- /dev/null +++ b/version.nix @@ -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