2019-01-03 00:38:38 +00:00
|
|
|
{ pkgs ? import ./nix {
|
|
|
|
overlays = [
|
|
|
|
(import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz))
|
|
|
|
];
|
|
|
|
}, useNix1 ? false }:
|
2017-10-29 21:10:26 +00:00
|
|
|
|
2018-04-04 21:13:56 +00:00
|
|
|
let
|
2018-09-03 21:14:17 +00:00
|
|
|
# A random Nixpkgs revision *before* the default glibc
|
|
|
|
# was switched to version 2.27.x.
|
|
|
|
oldpkgsSrc = pkgs.fetchFromGitHub {
|
|
|
|
owner = "nixos";
|
|
|
|
repo = "nixpkgs";
|
|
|
|
rev = "0252e6ca31c98182e841df494e6c9c4fb022c676";
|
|
|
|
sha256 = "1sr5a11sb26rgs1hmlwv5bxynw2pl5w4h5ic0qv3p2ppcpmxwykz";
|
|
|
|
};
|
|
|
|
|
|
|
|
oldpkgs = import oldpkgsSrc {};
|
|
|
|
|
2017-10-29 21:10:26 +00:00
|
|
|
inherit (pkgs) stdenv;
|
|
|
|
|
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
|
2018-04-04 21:13:56 +00:00
|
|
|
]
|
2018-12-01 04:04:43 +00:00
|
|
|
++ stdenv.lib.optional useNix1 oldpkgs.nix1;
|
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
|
|
|
};
|
|
|
|
|
2019-01-03 01:06:50 +00:00
|
|
|
mozilla-rust-overlay = stdenv.mkDerivation (rec {
|
2019-01-03 01:18:42 +00:00
|
|
|
name = "mozilla-rust-overlay";
|
2019-01-03 01:06:50 +00:00
|
|
|
buildInputs = with pkgs; [
|
2019-01-03 01:18:42 +00:00
|
|
|
latest.rustChannels.stable.rust
|
2019-01-03 01:06:50 +00:00
|
|
|
git
|
2019-01-03 01:18:42 +00:00
|
|
|
pkgconfig
|
|
|
|
openssl.dev
|
2019-01-03 01:06:50 +00:00
|
|
|
]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin pkgs.darwin.Security;
|
|
|
|
|
|
|
|
postHook = ''
|
2019-01-03 01:18:42 +00:00
|
|
|
checkPhase() (
|
|
|
|
cd "${builtins.toString ./.}/ofborg"
|
|
|
|
|
2019-01-03 02:28:11 +00:00
|
|
|
set -x
|
|
|
|
|
2019-01-03 01:18:42 +00:00
|
|
|
cargo fmt
|
|
|
|
git diff --exit-code
|
|
|
|
cargofmtexit=$?
|
|
|
|
|
|
|
|
cargo clippy
|
|
|
|
cargoclippyexit=$?
|
|
|
|
|
|
|
|
sum=$((cargofmtexit + cargoclippyexit))
|
|
|
|
exit $sum
|
|
|
|
)
|
2019-01-03 01:06:50 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
RUSTFLAGS = "-D warnings";
|
|
|
|
RUST_BACKTRACE = "1";
|
|
|
|
NIX_PATH = "nixpkgs=${pkgs.path}";
|
|
|
|
}
|
|
|
|
// stdenv.lib.optionalAttrs stdenv.isLinux {
|
|
|
|
LOCALE_ARCHIVE_2_21 = "${oldpkgs.glibcLocales}/lib/locale/locale-archive";
|
|
|
|
LOCALE_ARCHIVE_2_27 = "${pkgs.glibcLocales}/lib/locale/locale-archive";
|
|
|
|
});
|
|
|
|
|
2018-10-24 06:05:19 +00:00
|
|
|
rustEnv = stdenv.mkDerivation (rec {
|
2017-11-05 14:46:42 +00:00
|
|
|
name = "gh-event-forwarder";
|
|
|
|
buildInputs = with pkgs; [
|
2018-09-03 21:14:17 +00:00
|
|
|
bash
|
2017-11-30 03:31:40 +00:00
|
|
|
nix-prefetch-git
|
2017-11-05 14:46:42 +00:00
|
|
|
rust.rustc
|
|
|
|
rust.cargo
|
2018-12-01 04:04:43 +00:00
|
|
|
#rustfmt
|
|
|
|
#carnix
|
2017-11-14 13:32:28 +00:00
|
|
|
openssl.dev
|
|
|
|
pkgconfig
|
2018-01-29 19:27:34 +00:00
|
|
|
git
|
2018-04-04 21:13:56 +00:00
|
|
|
]
|
2018-12-01 04:04:43 +00:00
|
|
|
++ stdenv.lib.optional useNix1 oldpkgs.nix1
|
2018-04-04 21:13:56 +00:00
|
|
|
++ stdenv.lib.optional stdenv.isDarwin pkgs.darwin.Security;
|
2017-11-05 14:46:42 +00:00
|
|
|
|
2018-04-12 21:23:32 +00:00
|
|
|
postHook = ''
|
|
|
|
checkPhase() {
|
2018-12-01 13:50:54 +00:00
|
|
|
( cd "${builtins.toString ./.}/ofborg" && cargo build && cargo test)
|
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;
|
2019-01-03 01:18:42 +00:00
|
|
|
passthru.mozilla-rust-overlay = mozilla-rust-overlay;
|
2018-10-24 06:05:19 +00:00
|
|
|
}
|
|
|
|
// stdenv.lib.optionalAttrs stdenv.isLinux {
|
|
|
|
LOCALE_ARCHIVE_2_21 = "${oldpkgs.glibcLocales}/lib/locale/locale-archive";
|
|
|
|
LOCALE_ARCHIVE_2_27 = "${pkgs.glibcLocales}/lib/locale/locale-archive";
|
|
|
|
});
|
2017-11-05 14:46:42 +00:00
|
|
|
|
2017-12-05 01:55:44 +00:00
|
|
|
in rustEnv
|