2019-01-03 00:38:38 +00:00
|
|
|
{ pkgs ? import ./nix {
|
|
|
|
overlays = [
|
2020-04-29 19:06:48 +00:00
|
|
|
(import ./nix/overlay.nix)
|
2019-01-03 00:38:38 +00:00
|
|
|
];
|
2020-04-12 17:51:39 +00:00
|
|
|
} }:
|
2017-10-29 21:10:26 +00:00
|
|
|
|
2018-04-04 21:13:56 +00:00
|
|
|
let
|
2021-04-01 19:31:05 +00:00
|
|
|
inherit (pkgs) stdenv lib;
|
2017-10-29 21:10:26 +00:00
|
|
|
|
2017-11-05 14:46:42 +00:00
|
|
|
phpEnv = stdenv.mkDerivation rec {
|
|
|
|
name = "gh-event-forwarder";
|
2017-11-09 12:33:10 +00:00
|
|
|
src = null;
|
2017-11-05 14:46:42 +00:00
|
|
|
buildInputs = with pkgs; [
|
2017-11-30 03:31:40 +00:00
|
|
|
nix-prefetch-git
|
2017-11-05 14:46:42 +00:00
|
|
|
php
|
|
|
|
phpPackages.composer
|
|
|
|
git
|
|
|
|
php
|
|
|
|
curl
|
|
|
|
bash
|
2020-04-12 17:51:39 +00:00
|
|
|
];
|
2017-11-05 14:46:42 +00:00
|
|
|
|
2017-11-30 03:31:40 +00:00
|
|
|
# HISTFILE = "${src}/.bash_hist";
|
2017-11-05 14:46:42 +00:00
|
|
|
};
|
|
|
|
|
2021-05-16 15:37:05 +00:00
|
|
|
rustEnv = stdenv.mkDerivation {
|
2017-11-05 14:46:42 +00:00
|
|
|
name = "gh-event-forwarder";
|
2021-05-16 15:45:28 +00:00
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
nix # so in --pure mode we actually find the "correct" nix
|
2018-09-03 21:14:17 +00:00
|
|
|
bash
|
2017-11-30 03:31:40 +00:00
|
|
|
nix-prefetch-git
|
2021-05-16 15:45:28 +00:00
|
|
|
rustPackages.cargo
|
|
|
|
rustPackages.clippy
|
|
|
|
rustPackages.rustfmt
|
2021-03-17 08:22:27 +00:00
|
|
|
pkg-config
|
2018-01-29 19:27:34 +00:00
|
|
|
git
|
2021-05-16 15:45:28 +00:00
|
|
|
];
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
openssl
|
2018-04-04 21:13:56 +00:00
|
|
|
]
|
2021-04-01 19:31:05 +00:00
|
|
|
++ lib.optional stdenv.isDarwin pkgs.darwin.Security;
|
2017-11-05 14:46:42 +00:00
|
|
|
|
2018-04-12 21:23:32 +00:00
|
|
|
postHook = ''
|
2021-05-16 15:45:28 +00:00
|
|
|
checkPhase() (
|
|
|
|
cd "${builtins.toString ./.}/ofborg"
|
|
|
|
set -x
|
|
|
|
cargo fmt
|
|
|
|
git diff --exit-code
|
|
|
|
cargofmtexit=$?
|
|
|
|
|
|
|
|
cargo clippy
|
|
|
|
cargoclippyexit=$?
|
|
|
|
|
|
|
|
|
|
|
|
cargo build && cargo test
|
|
|
|
cargotestexit=$?
|
|
|
|
|
|
|
|
sum=$((cargofmtexit + cargoclippyexit + cargotestexit))
|
|
|
|
exit $sum
|
|
|
|
)
|
2018-04-12 21:23:32 +00:00
|
|
|
'';
|
|
|
|
|
2017-11-09 12:33:10 +00:00
|
|
|
HISTFILE = "${toString ./.}/.bash_hist";
|
2018-04-12 21:23:32 +00:00
|
|
|
RUSTFLAGS = "-D warnings";
|
2018-09-07 01:35:32 +00:00
|
|
|
RUST_BACKTRACE = "1";
|
2018-09-07 02:31:25 +00:00
|
|
|
RUST_LOG = "ofborg=debug";
|
2018-12-01 03:22:44 +00:00
|
|
|
NIX_PATH = "nixpkgs=${pkgs.path}";
|
2017-12-05 01:55:44 +00:00
|
|
|
passthru.phpEnv = phpEnv;
|
2021-05-16 15:37:05 +00:00
|
|
|
};
|
2017-11-05 14:46:42 +00:00
|
|
|
|
2017-12-05 01:55:44 +00:00
|
|
|
in rustEnv
|