default.nix 2.77 KB
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1
let
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
  hostPkgs = import <nixpkgs> {};
in
  {
    argopkgs             ? import (hostPkgs.nix-update-source.fetch ./argopkgs.json).src {},
    argotk-src           ? argopkgs.argotk.src,
    nrm-src              ? argopkgs.nodelevel.nrm.src,
    containers-src       ? argopkgs.nodelevel.containers.src,
    libnrm-src           ? argopkgs.nodelevel.libnrm.src,
    amg-src              ? argopkgs.applications.nrm.amg.src,
    lammps-src           ? argopkgs.applications.nrm.lammps.src,
    qmcpack-src          ? argopkgs.applications.nrm.qmcpack.src,
    stream-src           ? argopkgs.applications.nrm.stream.src,
    dgemm_randomwalk-src ? argopkgs.applications.nrm.dgemm_randomwalk.src,
  }:
  rec {
    argotk           = argopkgs.argotk.overrideAttrs                    (old: {src = argotk-src;}     );
    nrm              = argopkgs.nodelevel.nrm.overrideAttrs             (old: {src = nrm-src;}        );
    libnrm           = argopkgs.nodelevel.libnrm.overrideAttrs          (old: {src = libnrm-src;}     );
    containers       = argopkgs.nodelevel.containers.overrideAttrs      (old: {src = containers-src;} );
    amg              = (argopkgs.applications.nrm.amg.overrideAttrs     (old: {src = amg-src;}        )).override {libnrm = libnrm;};
    qmcpack          = (argopkgs.applications.nrm.qmcpack.overrideAttrs (old: {src = qmcpack-src;}    )).override {libnrm = libnrm;};
    stream-test      = (argopkgs.applications.nrm.stream.overrideAttrs  (old: {src = stream-src;}     )).override {libnrm = libnrm; iterationCount = "20";};
    stream           = (argopkgs.applications.nrm.stream.overrideAttrs  (old: {src = stream-src;}     )).override {libnrm = libnrm; iterationCount = "20000";};
    lammps           = (argopkgs.applications.nrm.lammps.overrideAttrs  (old: {src = lammps-src;}     )).override {libnrm = libnrm;};

    test = argopkgs.stdenv.mkDerivation rec {
28 29 30 31 32
      name = "testEnv";
      installPhase = "mkdir $out";
      unpackPhase = "true";
      dontStrip = true;
      buildPhase = "true";
33 34 35 36 37 38 39 40 41 42 43 44
      buildInputs =  [
        argotk
        argopkgs.coreutils
        argopkgs.utillinux
        containers
        stream stream-test
        argopkgs.mpich2
        nrm
      ];
      shellHook = ''
        source ${argotk}/share/argotk.sh
        echo "Installed bash completion."
45
      '';
46 47
      MANIFESTS = ./manifests;
    };
48

49 50 51 52 53 54
    hack = test.overrideAttrs (old:{
        buildInputs = old.buildInputs ++ [argopkgs.zmcat];
      }
    );

    expe = test.overrideAttrs (old:{
55
        buildInputs = old.buildInputs ++ [amg lammps];
56 57 58 59 60 61 62 63 64 65 66 67 68
      }
    );

    preCommit = argopkgs.mkShell {
      name = "shake";
      buildInputs = [
        (argopkgs.haskellPackages.ghcWithPackages (p: with p; [
            shake
            (argopkgs.haskell.lib.doJailbreak panpipe)
          ]))
        ];
    };
  }