mirror of
https://github.com/simplex-chat/haskell.nix.git
synced 2026-06-03 09:17:32 +00:00
* Add sha256 to source-repository-packages for hydra This allows source-repository-package to be downloaded and replaced in with `package: /nix/store/...` by callCabalPackageToNix so that `cabal` and `plan-to-nix` do not need to download them.
38 lines
1.4 KiB
Nix
38 lines
1.4 KiB
Nix
{ pkgs ? import nixpkgs { }
|
|
, nixpkgs ? ../nixpkgs
|
|
, haskell ? pkgs.callPackage ../. { }
|
|
}:
|
|
|
|
with pkgs;
|
|
|
|
let
|
|
util = callPackage ./util.nix {};
|
|
|
|
in pkgs.recurseIntoAttrs {
|
|
cabal-simple = haskell.callPackage ./cabal-simple { inherit util; };
|
|
cabal-simple-prof = haskell.callPackage ./cabal-simple-prof { inherit util; };
|
|
cabal-sublib = haskell.callPackage ./cabal-sublib { inherit util; };
|
|
cabal-22 = haskell.callPackage ./cabal-22 {};
|
|
with-packages = haskell.callPackage ./with-packages { inherit util; };
|
|
builder-haddock = haskell.callPackage ./builder-haddock {};
|
|
stack-simple = haskell.callPackage ./stack-simple {};
|
|
snapshots = haskell.callPackage ./snapshots {};
|
|
shell-for = haskell.callPackage ./shell-for {};
|
|
callStackToNix = haskell.callPackage ./call-stack-to-nix {};
|
|
callCabalProjectToNix = haskell.callPackage ./call-cabal-project-to-nix {};
|
|
cabal-source-repo = haskell.callPackage ./cabal-source-repo {};
|
|
|
|
# Run unit tests with: nix-instantiate --eval --strict -A unit.tests
|
|
# An empty list means success.
|
|
unit = let
|
|
tests = haskell.callPackage ./unit.nix {};
|
|
in runCommand "unit-tests" { passthru = { inherit tests; }; }
|
|
(lib.concatMapStringsSep "\n" (t: "echo ${t.name} failed") tests +
|
|
(if builtins.length tests == 0 then "\ntouch $out" else "\nexit 1"));
|
|
}
|
|
|
|
## more possible test cases
|
|
# 1. fully static linking
|
|
# 2. cabal 2.4 stuff
|
|
# 3. cross-compiling
|