ofborg/shell.nix

72 lines
1.4 KiB
Nix
Raw Normal View History

{ pkgs ? import ./nix {
overlays = [
(import ./nix/overlay.nix)
];
} }:
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";
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
];
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
};
rustEnv = stdenv.mkDerivation {
2017-11-05 14:46:42 +00:00
name = "gh-event-forwarder";
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
2022-01-09 02:21:56 +00:00
rustc
cargo
clippy
rustfmt
2021-03-17 08:22:27 +00:00
pkg-config
git
];
buildInputs = with pkgs; [
openssl
2022-01-09 02:21:56 +00:00
] ++ lib.optionals stdenv.isDarwin [ darwin.Security libiconv ];
2017-11-05 14:46:42 +00:00
postHook = ''
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
)
'';
HISTFILE = "${toString ./.}/.bash_hist";
RUSTFLAGS = "-D warnings";
2018-09-07 01:35:32 +00:00
RUST_BACKTRACE = "1";
RUST_LOG = "ofborg=debug";
NIX_PATH = "nixpkgs=${pkgs.path}";
2017-12-05 01:55:44 +00:00
passthru.phpEnv = phpEnv;
};
2017-11-05 14:46:42 +00:00
2017-12-05 01:55:44 +00:00
in rustEnv