Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.direnv
result*
dist-newstyle
.pre-commit-config.yaml
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,19 @@ but will appear before examples with a greater order.

## Reference: Technology choices

### JS

The website generated by `message-index` uses a few JS components.

- [highlight.js](https://highlightjs.org/) for highlighting blocks of code. [License: BSD 3-Clause](https://github.com/highlightjs/highlight.js/blob/main/LICENSE).
- [TableFilter](http://www.tablefilter.com/) for the filtering functionality in the error message table. [License: MIT](https://github.com/koalyptus/TableFilter/blob/master/LICENSE).

### Nix flake

The Nix flake uses [flake-parts](https://flake.parts/), as well as the flake-parts modules for
- [haskell-flake](https://github.com/srid/haskell-flake) ([haskell-flake flake-parts module](https://flake.parts/options/haskell-flake))
- [devshell](https://github.com/numtide/devshell) ([devshell flake-parts module](https://flake.parts/options/devshell))

Generally speaking, we choose technology for this site based on the following criteria:

* The build process for the site should be simple, relying on no build tools or package managers aside from `cabal` or `stack`
Expand Down
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,51 @@ Today, the Haskell Message Index supports three tools. Any user-facing Haskell-r
| GHCup | 0.1.19.0 | `GHCup-` |
| Cabal | 3.12 | `Cabal-` |

## Setup

This site is built with [Haskell](https://haskell.org) using the static-site generator [Hakyll](https://jaspervdj.be/hakyll/).

### 'Normal' Install

To run the site locally, you need to
0. [install Haskell & Cabal](https://www.haskell.org/ghcup/):
```shell
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
```
1. Clone the Repo
```shell
git clone https://github.com/haskellfoundation/error-message-index.git
```
2. Run it
```shell
cd error-message-index # yes,
cd message-index # both of those are needed
cabal update
cabal run -- site watch # Starts a web server on http://localhost:8000
```

### with Nix

To run the site with Nix, you need to have [Nix](https://nixos.org/) installed. You can install it via the [Determinate Systems installer](https://zero-to-nix.com/start/install):
```shell
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
```
1. Clone the Repo
```shell
git clone https://github.com/haskellfoundation/error-message-index.git
```
2. Run it
```shell
cd error-message-index # yes,
cd message-index # both of those are needed
nix develop
cabal run -- site watch # Starts a web server on http://localhost:8000
```

For more on the Nix flake, have a look [here](./CONTRIBUTING.md#nix-flake).

And now, since you're up and running, you can start [contributing](./CONTRIBUTING.md)! :)

## Contributing to the Message Index

Contributions may come in the form of changes to the code base, as well as opening or commenting on issues and pull requests. You are warmly invited to participate!
Expand Down
186 changes: 186 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
nixConfig.allow-import-from-derivation = true;
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
devshell.url = "github:numtide/devshell";
devshell.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs:
inputs.parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
imports = [
inputs.devshell.flakeModule
inputs.haskell-flake.flakeModule
inputs.pre-commit-hooks.flakeModule
];

perSystem = {
config,
pkgs,
...
}: {
devshells.default = {
devshell = {
packagesFrom = [config.devShells.ghc96];
packages = [];
startup = {
pre-commit.text = config.pre-commit.installationScript;
};
};
};
pre-commit = {
check.enable = true;
settings.hooks = {
cabal-fmt.enable = true;
hlint.enable = true;
Comment on lines +37 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cabal-fmt.enable = true;
hlint.enable = true;
cabal-fmt.enable = true;
hlint.enable = true;
ormolu.enable = true;

ormolu.enable = true;

alejandra.enable = true;
deadnix.enable = true;
};
};
haskellProjects.ghc96 = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
haskellProjects.ghc96 = {
haskellProjects.ghc96 = {
basePackages = pkgs.haskell.packages.ghc96;

alternatively you can also rename this to smth like default-haskell or you can search fo the option on flake.parts that switches off the automatic population of default.

basePackages = pkgs.haskell.packages.ghc96;
projectRoot = ./message-index;
};
};
};
}