tvl-depot/third_party/josh/default.nix
Vincent Ambo 26a8b38a3c chore(3p/josh): enable debug information in builds
Change-Id: I09e980e871bec32397755fb0cafeaa61701f47a7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8916
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2023-07-02 16:38:10 +00:00

49 lines
1.1 KiB
Nix

# https://github.com/josh-project/josh
{ depot, pkgs, ... }:
let
# TODO(sterni): switch to pkgs.josh as soon as that commit is released
rev = "c0a170a756dd5e63268673086218c0ce7bf18bdc";
src = pkgs.fetchFromGitHub {
owner = "josh-project";
repo = "josh";
inherit rev;
hash = "sha256:0rsf65fq9xm3qj77ig3s4wmmgm50jhvwrknr839hipjj5lj4x1hp";
};
rust169 = depot.third_party.nixpkgs.rust-bin.stable."1.69.0".default;
naersk = pkgs.callPackage depot.third_party.sources.naersk {
rustc = rust169;
cargo = rust169;
};
in
naersk.buildPackage {
inherit src;
JOSH_VERSION = "git-${builtins.substring 0 8 rev}";
buildInputs = with pkgs; [
libgit2
openssl
pkg-config
];
dontStrip = true;
cargoBuildOptions = x: x ++ [
"-p"
"josh-filter"
"-p"
"josh-proxy"
];
overrideMain = x: {
preBuild = x.preBuild or "" + ''
echo 'debug = true' >> Cargo.toml
'';
nativeBuildInputs = (x.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/josh-proxy --prefix PATH : "${pkgs.git}/bin"
'';
};
}