• This repository has been archived on 13/Feb/2021
  • Stars
    star
    193
  • Rank 201,081 (Top 4 %)
  • Language
    Nix
  • License
    GNU General Publi...
  • Created over 5 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cached Haskell IDE Engine Nix builds for all GHC versions

Deprecated

⚠️ This project is deprecated. Refer to https://github.com/haskell/haskell-language-server instead, which is available from nixpkgs directly ⚠️

Haskell IDE Engine for Nix

This project provides cached Nix builds for Haskell IDE Engine for GHC 8.6.5 and 8.8.3.

Installation

Installation is done with your projects nix-shell environment. Both haskell.nix and the nixpkgs Haskell infrastructure are supported. If you don't have a nix-shell environment for your project yet, I recommend using haskell.nix.

If you just want to get started, see the templates for fully working example projects.

haskell.nix Projects

In short, to install HIE for your haskell.nix project, apply the all-hies nixpkgs overlay and add { hie = "unstable"; } to the tools argument of shellFor. If you want to use the prebuilt binaries, use the all-hies cachix. Read the rest of this section for more details.

Applying the overlay can be done as follows in a recent haskell.nix version

let
  # Pin all-hies
  all-hies = fetchTarball {
    # Insert the desired all-hies commit here
    url = "https://github.com/infinisil/all-hies/tarball/000000000000000000000000000000000000000";
    # Insert the correct hash after the first evaluation
    sha256 = "0000000000000000000000000000000000000000000000000000";
  };

  # Assuming nixpkgs and haskellNix are defined here

  # Import nixpkgs with both haskell.nix's overlays and the all-hies one
  pkgs = import nixpkgs (haskellNix.nixpkgsArgs // {
    overlays = haskellNix.nixpkgsArgs.overlays ++ [
      (import all-hies {}).overlay
    ];
  });

  /* ... */
in /* ... */

Adding HIE to the environment is done like this in your shellFor call

shellFor {
  packages = p: [ p.my-package ];
  tools = {
    hie = "unstable";
  };
}

Configuring the all-hies cachix can be done with these instructions, or if you have cachix installed already:

$ cachix use all-hies

Note that for haskell.nix in general, cachix use iohk saves a lot of building time if you use the same nixpkgs as IOHK's CI.

See the haskell.nix stack template or haskell.nix cabal template for a fully working example including a working stack/cabal version and a hoogle database.

nixpkgs Haskell infrastructure

In short, to install HIE for your project using nixpkgs Haskell infrastructure, apply the all-hies overlay and add the hie Haskell package to the nativeBuildInputs argument of shellFor. If you want to use the prebuilt binaries, use the all-hies cachix. Read the rest of this section for more details.

Applying the overlay can be done as follows

let
  # Pin all-hies
  all-hies = fetchTarball {
    # Insert the desired all-hies commit here
    url = "https://github.com/infinisil/all-hies/tarball/000000000000000000000000000000000000000";
    # Insert the correct hash after the first evaluation
    sha256 = "0000000000000000000000000000000000000000000000000000";
  };

  # Assuming nixpkgs is defined here

  # Import nixpkgs with the all-hies overlay
  pkgs = import nixpkgs {
    # Pass no config for purity
    config = {};
    overlays = [
      (import all-hies {}).overlay
    ];
  };

  /* ... */
in /* ... */

Adding HIE to the environment is done like this in your shellFor call:

shellFor {
  packages = p: [ p.my-package ];
  nativeBuildInputs = [
    haskellPackages.hie
  ];
}

If you don't use shellFor, you can change your Haskell environment derivation like this instead:

envWithHIE = env.overrideAttrs (old: {
  nativeBuildInputs = old.nativeBuildInputs ++ [ haskellPackages.hie ];
})

Configuring the all-hies cachix can be done with these instructions, or if you have cachix installed already:

$ cachix use all-hies

See the nixpkgs infra template for a fully working example including a working cabal version and a hoogle database.

More Repositories

1

nixus

Experimental deployment tool supporting multi-host abstractions
Nix
198
star
2

system

My system configuration
Nix
125
star
3

nixlisp

Nix
61
star
4

sanix

Sane stable stateless NixOS setup
Nix
57
star
5

on-demand-minecraft

Haskell
46
star
6

nixbot

Haskell
24
star
7

nix-xdg

[WIP] Nix overlay for making programs xdg compliant
Nix
19
star
8

soph

Efficiently import pictures while handling duplicates gracefully
Haskell
10
star
9

aoc20

Nix
10
star
10

nix-store-brute

Brute force nix store path prefixes
Shell
9
star
11

nix-rts

Nix
6
star
12

aoc18

Haskell
5
star
13

fastnixarray

An array implementation for Nix with logarithmic update and access operations
Nix
5
star
14

toponix

Toponix will be a bunch of Nix functions that can transform a simple network topology description into useful answers
Nix
4
star
15

nixpkgs-analyzer

Haskell
4
star
16

SwiftUnits

Framework for working with arbitrary units in Swift (WIP, Name and repo might change)
Swift
4
star
17

random-twitch-stream

Shell
3
star
18

guides

Some guides for mainly NixOS
3
star
19

arvy

Bachelor thesis on Arvy Heuristics for Distributed Mutual Exclusion
TeX
2
star
20

ScriptKit

Framework for convenient scripts in Swift (WIP)
Swift
2
star
21

nixperiments

Uncurated Nix experiments
Nix
2
star
22

nix-url-verify

Haskell
2
star
23

non-det-nix-parsing-repro

Reproducer for a non-deterministic parser show result
Nix
2
star
24

github-test

Testing some GitHub features
1
star
25

nixexprs

Nix
1
star
26

aoc19

Haskell
1
star
27

nix-quote-urls

Utility against unquoted Nix URIs
Haskell
1
star
28

linz

Haskell
1
star
29

hnix-test

Haskell
1
star
30

floxpkgs

Nix
1
star
31

picstream

A simple script to stream pictures to clients
1
star
32

modules-ng

Nix
1
star
33

nixos-services

1
star
34

dream2nix-modules

Nix
1
star
35

StackOverflow

Example code for StackOverflow answers
Swift
1
star
36

list-youtube-uploads

Bash script for listing youtube channel uploads
Shell
1
star