default.nix 2.51 KB
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1
{
2 3 4 5 6 7 8 9 10
  argopkgs-src ? (builtins.fetchGit {
    url = https://xgitlab.cels.anl.gov/argo/argopkgs.git;
    ref = "master";
    rev = "86c53fa5ba67edb3994f6ed971cdfa14bf850b4b";
  }) ,
  pkgs ? (import argopkgs-src {}),
  nrm-src ? pkgs.nodelevel.nrm.src,
  containers-src ? pkgs.nodelevel.containers.src,
  libnrm-src ? pkgs.nodelevel.libnrm.src
Valentin Reis's avatar
Valentin Reis committed
11 12
}:
let
13
  nrm = pkgs.nodelevel.nrm.overrideAttrs (old: { src =  nrm-src; });
14 15
  libnrm = pkgs.nodelevel.libnrm.overrideAttrs (old: { src =  libnrm-src; });
  containers = pkgs.nodelevel.containers.overrideAttrs (old: { src =  containers-src; });
16
  amg = pkgs.applications.nrm.amg;
Valentin Reis's avatar
Valentin Reis committed
17

Valentin Reis's avatar
Valentin Reis committed
18 19
  filterHdevTools = builtins.filterSource (path: type: baseNameOf path != ".hdevtools.sock");

20 21
  hpkgs = pkgs.haskellPackages.override {
        overrides = self: super: rec {
22
        argo = self.callCabal2nix "argo" (filterHdevTools ./argo) {};
23 24
    };
  };
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

  devInputs = with hpkgs; with pkgs; [
    sysstat
  ];

  devHPackages = with hpkgs; [
    cabal-install
    apply-refact
    hdevtools
    hindent
    hlint
    shake
    brittany
    ghcid
  ];

  shellHook = ''
Valentin Reis's avatar
Valentin Reis committed
42
    source ${./completion/argotk.sh}
43 44 45
    echo "Installed bash completion."
  '';

Valentin Reis's avatar
Valentin Reis committed
46
in rec
Valentin Reis's avatar
Valentin Reis committed
47
{
48
  inherit(hpkgs) argo;
49

50
  dev-lib = hpkgs.shellFor {
51
    packages = p: with p; [ argo ];
52
    withHoogle = true;
53
    buildInputs = devInputs ++ devHPackages;
54 55
  };

56 57 58
  manifests = ./manifests;

  argotk = pkgs.stdenv.mkDerivation rec {
59
    name = "env";
60
    env = pkgs.buildEnv { name = name; paths = buildInputs ++ propagatedBuildInputs; };
61
    src = filterHdevTools ./argotk;
62 63 64 65 66 67
    installPhase =''
      mkdir -p $out/bin
      mkdir -p $out/share
      cp argotk.hs $out/bin
      cp ${manifests}/* $out/share/
      '';
68
    buildInputs = [
69
      (hpkgs.ghcWithPackages (p: [p.argo ]))
70
    ];
71
    propagatedBuildInputs = [
72
      (hpkgs.ghcWithPackages (p: [p.argo ]))
73 74 75
      pkgs.coreutils
    ];
    inherit shellHook;
76 77
  };

78 79 80
  test = pkgs.stdenv.mkDerivation rec {
    name = "env";
    env = pkgs.buildEnv { name = name; paths = buildInputs; };
81 82 83
    buildInputs =  [
      argotk
      pkgs.coreutils
84 85 86 87
      containers
      amg
      nrm
    ];
88
    inherit shellHook;
89
    MANIFESTS = ./manifests;
Valentin Reis's avatar
Valentin Reis committed
90
  };
91

92 93 94 95 96 97 98 99 100

  hack = pkgs.stdenv.mkDerivation rec {
    name = "env";
    env = pkgs.buildEnv { name = name; paths = buildInputs; };
    buildInputs =  [
      containers
      amg
      nrm
      (hpkgs.ghcWithPackages (p: devHPackages ++ [
101 102
      argotk
      argo
103 104 105 106 107 108 109
     (pkgs.haskell.lib.doJailbreak p.panpipe)
      p.turtle]))
    ];
    inherit shellHook;
    MANIFESTS = ./manifests;
  };

Valentin Reis's avatar
Valentin Reis committed
110 111
}