default.nix 1.15 KB
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1 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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
{
  hostPkgs ? import <nixpkgs> {},
  pkgs ? import (hostPkgs.nix-update-source.fetch ./argopkgs.json).src {},
}:
let
  filterHdevTools = builtins.filterSource (path: type: baseNameOf path != ".hdevtools.sock");

  hpkgs = pkgs.haskellPackages.override {
      overrides = self: super: rec {
      argonix = self.callCabal2nix "argonix" (filterHdevTools ./.) {};
    };
  };

  devHPackages = with hpkgs; [
    pkgs.tmuxinator
    cabal-install
    apply-refact
    hdevtools
    hindent
    hlint
    shake
    brittany
    ghcid
  ];
in rec
{
  argonix = hpkgs.argonix.overrideAttrs (old:{
        installPhase = old.installPhase + ''
          mkdir $out/share/
          MANIFESTS=/tmp $out/bin/argonix --bash-completion-script argonix > $out/share/argonix.sh
        '';
      });

  hack = hpkgs.shellFor {
    packages = p: with p; [ argonix ];
    withHoogle = true;
    buildInputs = devHPackages;
  };

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