ofborg/shell.nix
Léo Gaspard aeaf93b9f4
Default to building with nix2
Nix is now mostly used in its version 2, so let's switch to that.
2018-05-04 16:02:04 +02:00

52 lines
987 B
Nix

{ pkgs ? import ./nix {}, useNix1 ? false }:
let
inherit (pkgs) stdenv;
phpEnv = stdenv.mkDerivation rec {
name = "gh-event-forwarder";
src = null;
buildInputs = with pkgs; [
nix-prefetch-git
php
phpPackages.composer
git
php
curl
bash
]
++ stdenv.lib.optional useNix1 nix1;
# HISTFILE = "${src}/.bash_hist";
};
rustEnv = stdenv.mkDerivation rec {
name = "gh-event-forwarder";
buildInputs = with pkgs; [
nix-prefetch-git
rust.rustc
rust.cargo
rustfmt
carnix
openssl.dev
pkgconfig
git
]
++ stdenv.lib.optional useNix1 nix1
++ stdenv.lib.optional stdenv.isDarwin pkgs.darwin.Security;
postHook = ''
checkPhase() {
( cd "${builtins.toString ./.}/ofborg" && cargo test --lib )
}
'';
HISTFILE = "${toString ./.}/.bash_hist";
RUSTFLAGS = "-D warnings";
passthru.phpEnv = phpEnv;
};
in rustEnv