2023-02-28 13:17:08 +01:00
|
|
|
# https://github.com/josh-project/josh
|
2021-04-15 16:45:51 +02:00
|
|
|
{ depot, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2023-03-24 14:33:38 +01:00
|
|
|
# TODO(sterni): switch to pkgs.josh as soon as that commit is released
|
2023-06-30 22:44:22 +02:00
|
|
|
rev = "c0a170a756dd5e63268673086218c0ce7bf18bdc";
|
2021-05-02 16:37:23 +02:00
|
|
|
src = pkgs.fetchFromGitHub {
|
2023-02-28 13:17:08 +01:00
|
|
|
owner = "josh-project";
|
2021-04-15 16:45:51 +02:00
|
|
|
repo = "josh";
|
2023-02-28 13:17:08 +01:00
|
|
|
inherit rev;
|
2023-06-30 22:44:22 +02:00
|
|
|
hash = "sha256:0rsf65fq9xm3qj77ig3s4wmmgm50jhvwrknr839hipjj5lj4x1hp";
|
2021-04-15 16:45:51 +02:00
|
|
|
};
|
2023-07-02 14:20:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
rust169 = depot.third_party.nixpkgs.rust-bin.stable."1.69.0".default;
|
|
|
|
naersk = pkgs.callPackage depot.third_party.sources.naersk {
|
|
|
|
rustc = rust169;
|
|
|
|
cargo = rust169;
|
|
|
|
};
|
2023-07-03 16:25:33 +02:00
|
|
|
version = "git-${builtins.substring 0 8 rev}";
|
2022-01-30 17:06:58 +01:00
|
|
|
in
|
2023-07-02 14:20:17 +02:00
|
|
|
naersk.buildPackage {
|
2023-07-03 16:25:33 +02:00
|
|
|
pname = "josh";
|
|
|
|
inherit src version;
|
|
|
|
JOSH_VERSION = version;
|
2021-04-15 16:45:51 +02:00
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
libgit2
|
|
|
|
openssl
|
2022-09-26 19:33:05 +02:00
|
|
|
pkg-config
|
2021-04-15 16:45:51 +02:00
|
|
|
];
|
|
|
|
|
2023-07-02 10:29:04 +02:00
|
|
|
dontStrip = true;
|
2021-04-15 16:45:51 +02:00
|
|
|
cargoBuildOptions = x: x ++ [
|
2022-01-30 17:06:58 +01:00
|
|
|
"-p"
|
2023-02-28 13:17:08 +01:00
|
|
|
"josh-filter"
|
2022-01-30 17:06:58 +01:00
|
|
|
"-p"
|
|
|
|
"josh-proxy"
|
2021-04-15 16:45:51 +02:00
|
|
|
];
|
2022-02-11 11:17:35 +01:00
|
|
|
|
|
|
|
overrideMain = x: {
|
2023-07-02 10:29:04 +02:00
|
|
|
preBuild = x.preBuild or "" + ''
|
|
|
|
echo 'debug = true' >> Cargo.toml
|
|
|
|
'';
|
|
|
|
|
2022-02-09 15:12:04 +01:00
|
|
|
nativeBuildInputs = (x.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ];
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/josh-proxy --prefix PATH : "${pkgs.git}/bin"
|
|
|
|
'';
|
2022-02-11 11:17:35 +01:00
|
|
|
};
|
2021-04-15 16:45:51 +02:00
|
|
|
}
|