default.nix 2.56 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
Valentin Reis's avatar
Valentin Reis committed
13 14
  filterHdevTools = builtins.filterSource (path: type: baseNameOf path != ".hdevtools.sock");

15 16
  hpkgs = pkgs.haskellPackages.override {
        overrides = self: super: rec {
17
        argo = self.callCabal2nix "argo" (filterHdevTools ./argo) {};
18 19
    };
  };
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

  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
37
    source ${./completion/argotk.sh}
38 39 40
    echo "Installed bash completion."
  '';

Valentin Reis's avatar
Valentin Reis committed
41
in rec
Valentin Reis's avatar
Valentin Reis committed
42
{
43 44 45 46 47 48
  nrm = pkgs.nodelevel.nrm.overrideAttrs (old: { src =  nrm-src; });
  libnrm = pkgs.nodelevel.libnrm.overrideAttrs (old: { src =  libnrm-src; });
  containers = pkgs.nodelevel.containers.overrideAttrs (old: { src =  containers-src; });

  amg = pkgs.applications.nrm.amg;

49
  inherit(hpkgs) argo;
50

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

57 58 59
  manifests = ./manifests;

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

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

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

Valentin Reis's avatar
Valentin Reis committed
112 113
}