about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/yi/wrapper.nix
blob: a7456590ab811e6d331e1d07431fcddd505b276e (plain) (blame)
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
# To use this for hacking of your Yi config file, drop into a shell
# with env attribute.
{ lib, stdenv, makeWrapper
, haskellPackages
, extraPackages ? (s: [])
}:
let
  yiEnv = haskellPackages.ghcWithPackages
    (self: [ self.yi ] ++ extraPackages self);
in
stdenv.mkDerivation {
  pname = "yi-custom";
  version = "0.0.0.1";
  dontUnpack = true;
  nativeBuildInputs = [ makeWrapper ];

  buildCommand = ''
    mkdir -p $out/bin
    makeWrapper ${haskellPackages.yi}/bin/yi $out/bin/yi \
      --set NIX_GHC ${yiEnv}/bin/ghc
  '';

  # For hacking purposes
  passthru.env = yiEnv;

  meta = with lib; {
    description = "Allows Yi to find libraries and the compiler easily";
    # This wrapper and wrapper only is under PD
    license = licenses.publicDomain;
    maintainers = with maintainers; [ ];
  };

}