Commit 39e696e9 authored by Christopher League's avatar Christopher League 🖥

Less flaky nix build

Don't rely on cabal2nix at build time.
parent 7c5cf499
Pipeline #544 passed with stage
in 1 minute and 26 seconds
{ mkDerivation, aeson, base, blaze-markup, bytestring
, case-insensitive, classy-prelude, classy-prelude-yesod
, containers, data-default, directory, exceptions, fast-logger
, file-embed, foreign-store, gitrev, gogol, gogol-apps-calendar
, hjsmin, hpack, hspec, http-client-tls, http-conduit, http-types
, lens, monad-control, monad-logger, shakespeare, sorted-list
, stdenv, template-haskell, text, time, transformers, tz
, unordered-containers, vector, wai, wai-extra, wai-logger, warp
, yaml, yesod, yesod-core, yesod-form, yesod-static, yesod-test
}:
mkDerivation {
pname = "bookme";
version = "0.0.0";
src = ./.;
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson base blaze-markup bytestring case-insensitive classy-prelude
classy-prelude-yesod containers data-default directory exceptions
fast-logger file-embed foreign-store gitrev gogol
gogol-apps-calendar hjsmin http-client-tls http-conduit http-types
lens monad-control monad-logger shakespeare sorted-list
template-haskell text time transformers tz unordered-containers
vector wai wai-extra wai-logger warp yaml yesod yesod-core
yesod-form yesod-static
];
libraryToolDepends = [ hpack ];
executableHaskellDepends = [
aeson base blaze-markup bytestring case-insensitive classy-prelude
classy-prelude-yesod containers data-default directory exceptions
fast-logger file-embed foreign-store gitrev gogol
gogol-apps-calendar hjsmin http-client-tls http-conduit http-types
lens monad-control monad-logger shakespeare sorted-list
template-haskell text time transformers tz unordered-containers
vector wai wai-extra wai-logger warp yaml yesod yesod-core
yesod-form yesod-static
];
testHaskellDepends = [
aeson base blaze-markup bytestring case-insensitive classy-prelude
classy-prelude-yesod containers data-default directory exceptions
fast-logger file-embed foreign-store gitrev gogol
gogol-apps-calendar hjsmin hspec http-client-tls http-conduit
http-types lens monad-control monad-logger shakespeare sorted-list
template-haskell text time transformers tz unordered-containers
vector wai wai-extra wai-logger warp yaml yesod yesod-core
yesod-form yesod-static yesod-test
];
preConfigure = "hpack";
license = stdenv.lib.licenses.unfree;
hydraPlatforms = stdenv.lib.platforms.none;
}
...@@ -2,40 +2,88 @@ ...@@ -2,40 +2,88 @@
}: }:
with nixpkgs; with nixpkgs;
let let
stackageVersion = "lts-1110"; # This requires the nixpkgs-stackage overlay.
hpkgs = nixpkgs.pkgs.haskell.packages.stackage.lts-1110;
hlib = nixpkgs.pkgs.haskell.lib;
stackageSrc = pkgs.fetchgit { # The gogol package is not part of stackage LTS, and it's a bit
url = "https://github.com/typeable/nixpkgs-stackage.git"; # tricky to build. Best results so far are with LTS specified above
rev = "7c94ec65e12850e7dd5282e83a6da91f88cb8857"; # and the gogol revision specified here.
sha256 = "1ihsbgb9agg1f5q7mk3ycja6njbrg1dqlxniav47kyr9cm5ng0kn"; gogol-src = pkgs.fetchgit {
};
gogolSrc = pkgs.fetchgit {
url = "https://github.com/brendanhay/gogol.git"; url = "https://github.com/brendanhay/gogol.git";
rev = "344c9f781560e1ed8395b17e370ba1b085f2edc2"; rev = "344c9f781560e1ed8395b17e370ba1b085f2edc2";
sha256 = "0f48mh7f2ifk3b7rjwgn9cwmi6845xv9zvs07khycbk70959pk1n"; sha256 = "0f48mh7f2ifk3b7rjwgn9cwmi6845xv9zvs07khycbk70959pk1n";
}; };
stackageOverlay = import stackageSrc; gogol-core =
nixpkgs' = import pkgs.path { overlays = [stackageOverlay]; }; { mkDerivation, aeson, attoparsec, base, bifunctors, bytestring
haskell = nixpkgs'.pkgs.haskell; , case-insensitive, conduit, dlist, exceptions, hashable
, http-api-data, http-client, http-media, http-types, lens
, resourcet, scientific, servant, stdenv, tasty, text, time
, unordered-containers
}:
mkDerivation {
pname = "gogol-core";
version = "0.3.0";
src = gogol-src;
preCompileBuildDriver = "cd core";
libraryHaskellDepends = [
aeson attoparsec base bifunctors bytestring case-insensitive
conduit dlist exceptions hashable http-api-data http-client
http-media http-types lens resourcet scientific servant text time
unordered-containers
];
testHaskellDepends = [ base tasty ];
homepage = "https://github.com/brendanhay/gogol";
description = "Core data types and functionality for Gogol libraries";
license = "unknown";
};
mkNix = name: loc: pkgs.runCommand name {} '' gogol =
${pkgs.cabal2nix}/bin/cabal2nix ${loc} >$out { mkDerivation, aeson, base, bytestring, case-insensitive, conduit
''; , conduit-extra, cryptonite, directory, exceptions, filepath
, gogol-core, http-client, http-conduit, http-media, http-types
, lens, memory, mime-types, mtl, resourcet, stdenv, text, time
, transformers, unliftio-core, unordered-containers, x509
, x509-store
}:
mkDerivation {
pname = "gogol";
version = "0.3.0";
src = gogol-src;
preCompileBuildDriver = "cd gogol";
libraryHaskellDepends = [
aeson base bytestring case-insensitive conduit conduit-extra
cryptonite directory exceptions filepath gogol-core http-client
http-conduit http-media http-types lens memory mime-types mtl
resourcet text time transformers unliftio-core unordered-containers
x509 x509-store
];
homepage = "https://github.com/brendanhay/gogol";
description = "Comprehensive Google Services SDK";
license = "unknown";
};
gogolCoreNix = mkNix "gogol-core.nix" "${gogolSrc}/core"; gogol-cal =
gogolNix = mkNix "gogol.nix" "${gogolSrc}/gogol"; { mkDerivation, base, gogol-core, stdenv }:
gogolCalNix = mkNix "gogol-cal.nix" "${gogolSrc}/gogol-apps-calendar"; mkDerivation {
bookmeNix = mkNix "bookme.nix" ./.; pname = "gogol-apps-calendar";
version = "0.3.0";
src = gogol-src;
preCompileBuildDriver = "cd gogol-apps-calendar";
libraryHaskellDepends = [ base gogol-core ];
homepage = "https://github.com/brendanhay/gogol";
description = "Google Calendar SDK";
license = "unknown";
};
hpkgs = haskell.packages.stackage.${stackageVersion}.override { hpkgs' = hpkgs.override {
overrides = self: super: { overrides = self: super: {
gogol-core = self.callPackage gogolCoreNix {}; alex = hlib.dontCheck super.alex;
gogol = self.callPackage gogolNix {}; bookme = self.callPackage (import ./bookme.nix) {};
gogol-apps-calendar = self.callPackage gogolCalNix {}; gogol-core = self.callPackage gogol-core {};
alex = haskell.lib.dontCheck super.alex; gogol = self.callPackage gogol {};
bookme = self.callPackage bookmeNix {}; gogol-apps-calendar = self.callPackage gogol-cal {};
# mkDerivation = args: super.mkDerivation (args // { # mkDerivation = args: super.mkDerivation (args // {
# enableLibraryProfiling = false; # enableLibraryProfiling = false;
# doHoogle = false; # doHoogle = false;
...@@ -44,4 +92,4 @@ let ...@@ -44,4 +92,4 @@ let
}; };
}; };
in in
haskell.lib.justStaticExecutables hpkgs.bookme hlib.justStaticExecutables hpkgs'.bookme
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment