Skip to content

Alternative nix #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ tests: True
constraints: hashable ^>=1.3
constraints: semigroups ^>=0.19

allow-newer: aeson-1.4.2.0:hashable
allow-newer: aeson-1.4.2.0:semigroups

allow-newer: aeson-1.4.3.0:hashable
allow-newer: aeson-1.4.3.0:semigroups
71 changes: 46 additions & 25 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,47 @@
{ mkDerivation, aeson, attoparsec, base, base16-bytestring
, byteable, bytestring, case-insensitive, conduit, containers
, cryptohash, data-default, failure, hashable, hspec, HTTP
, http-conduit, http-types, network, old-locale, stdenv, text, time
, unordered-containers, vector
{ nixpkgs ? import ./nix/nixpkgs.nix
, cabal-v2 ? true
}:
mkDerivation {
pname = "github";
version = "0.14.0";
src = ./.;
buildDepends = [
aeson attoparsec base base16-bytestring byteable bytestring
case-insensitive conduit containers cryptohash data-default failure
hashable HTTP http-conduit http-types network old-locale text time
unordered-containers vector
];
testDepends = [
aeson attoparsec base base16-bytestring byteable bytestring
case-insensitive conduit containers cryptohash data-default failure
hashable hspec HTTP http-conduit http-types network old-locale text
time unordered-containers vector
];
homepage = "https://github.com/fpco/github";
description = "Access to the Github API, v3";
license = stdenv.lib.licenses.bsd3;
}
let
pkgs = import nixpkgs {};

# Newer versions to meet `constraints` in `cabal.project` for v2 builds
v2-overrides = super: if cabal-v2 then
{
hashable = super.hashable_1_3_0_0;
semigroups = super.semigroups_0_19;
}
else
{
};

hp = pkgs.haskellPackages.override (with pkgs.haskell.lib; {
overrides = self: super: {
# Newer versions of things we need
ansi-terminal = super.ansi-terminal_0_9_1;
binary-orphans = super.binary-orphans_1_0_1;
QuickCheck = super.QuickCheck_2_13_1;
quickcheck-instances = super.quickcheck-instances_0_3_21;
tasty = super.tasty_1_2_2;
time-compat = super.time-compat_1_9_2_2;
unordered-containers = super.unordered-containers_0_2_10_0;

# Things that work with our newer versions but don't know it yet
# hspec test failure looks like it relies on some RNG to be just
# right, not critical
ChasingBottoms = doJailbreak super.ChasingBottoms;
hspec-core = dontCheck (doJailbreak super.hspec-core);
optparse-applicative = doJailbreak super.optparse-applicative;

# We subbed in the correct versions of things it needs to work
binary-instances = overrideCabal super.binary-instances (drv: {
broken = false;
});

# Break infinite recursion through QuickCheck test dep
splitmix = dontCheck super.splitmix;

} // (v2-overrides super);
});
github = hp.callCabal2nix "github" ./. {};
in
github
7 changes: 7 additions & 0 deletions nix/nixpkgs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
builtins.fetchGit {
# Descriptive name to make the store path easier to identify
name = "nixos-unstable-2019-05-30";
url = https://github.com/nixos/nixpkgs/;
# `git ls-remote https://github.com/nixos/nixpkgs-channels nixos-unstable`
rev = "eccb90a2d997d65dc514253b441e515d8e0241c3";
}
5 changes: 5 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ nixpkgs ? import ./nix/nixpkgs.nix
, cabal-v2 ? true
}:

(import ./. {inherit nixpkgs cabal-v2;}).env