• Stars
    star
    132
  • Rank 274,205 (Top 6 %)
  • Language
    Nix
  • License
    MIT License
  • Created over 2 years ago
  • Updated 4 months ago

Reviews

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

Repository Details

A `flake-parts` Nix module for Haskell development

project chat Harmeless Code of Conduct

haskell-flake - Manage Haskell projects conveniently with Nix

There are several ways to manage Haskell packages using Nix with varying degrees of integration. haskell-flake makes Haskell development, packaging and deployment with Nix flakes a lot simpler than other existing approaches. This project is set up as a modern flake-parts module to integrate easily into other Nix projects and shell development environments in a lightweight and modular way.

To see more background information, guides and best practices, visit https://community.flake.parts/haskell-flake

Caveat: haskell-flake only supports the Haskell package manager Cabal, so your project must have a top-level .cabal file (single package project) or a cabal.project file (multi-package project).

Getting started

The minimal changes to your flake.nix to introduce the haskell-flake and flake-parts modules will look similar to:

# file: flake.nix
{
  inputs = {
    ...
    flake-parts.url = "github:hercules-ci/flake-parts";
    haskell-flake.url = "github:srid/haskell-flake";
  };

  outputs = inputs:
    inputs.flake-parts.lib.mkFlake { inherit inputs; } {
      systems = [ "x86_64-linux", ... ];
      imports = [
        ...
        inputs.haskell-flake.flakeModule
      ];
      perSystem = { self', system, lib, config, pkgs, ... }: {
        haskellProjects.default = {
          # basePackages = pkgs.haskellPackages;

          # Packages to add on top of `basePackages`, e.g. from Hackage
          packages = {
            aeson.source = "1.5.0.0" # Hackage version
          };

          # my-haskell-package development shell configuration
          devShell = {
            hlsCheck.enable = false;
          };

          # What should haskell-flake add to flake outputs?
          autoWire = [ "packages" "apps" "checks" ]; # Wire all but the devShell
        };

        devShells.default = pkgs.mkShell {
          name = "my-haskell-package custom development shell";
          inputsFrom = [
            ...
            config.haskellProjects.default.outputs.devShell
          ];
          nativeBuildInputs = with pkgs; [
            # other development tools.
          ];
        };
      };
    };
}

haskell-flake scans your folder automatically for a .cabal or cabal.project file. In this example an imaginary my-haskell-package.cabal project is used.

To see in more detail how to use haskell-flake in a realistic Haskell project with several other development tools, take a look at the corresponding Haskell single-package project Nix template and this Haskell multi-package project Nix example.

Documentation

https://community.flake.parts/haskell-flake

Discussion

Zulip is the primary venue for discussion; we also have Github Discussions enabled.

More Repositories

1

neuron

Future-proof note-taking and publishing based on Zettelkasten (superseded by Emanote: https://github.com/srid/emanote)
Haskell
1,462
star
2

emanote

Emanate a structured view of your plain-text notes
Haskell
790
star
3

haskell-template

Haskell project template using Nix + Flakes + VSCode (HLS)
Nix
141
star
4

nix-config

My NixOS configuration (DEPRECATED)
Nix
122
star
5

rust-nix-template

Rust project template with Nix (Flakes) and VSCode support
Nix
116
star
6

rib

Haskell static site generator based on Shake (superseded by https://github.com/srid/ema)
Haskell
115
star
7

slownews

🐢 Bringing slow news for the nervous among us
Haskell
113
star
8

ema

Change-aware static site generator for Haskell programmers
Haskell
112
star
9

chronicle

Forming reliable memories.
Elm
90
star
10

discourse-docker

[unmaintained] Install and manage Discourse via docker [2014]
Shell
85
star
11

neuron-template

A template to get started with neuron
Markdown
76
star
12

modern-package-template

[unmaintained] Modern project template for Python [2010]
Python
51
star
13

readability

[unmaintained] Python version of arc90's *older* readability.js
Python
47
star
14

heroku-buildpack-elm

Heroku buildpack for deploying Elm apps (NEEDS MAINTAINER)
Shell
38
star
15

spas

Single-page application server using PostgREST and more
Haskell
32
star
16

nixos-flake

A flake-parts module to manage NixOS and macOS machines, along with home-manager support, in a unified fashion.
Nix
29
star
17

reflex-stone

Template repository for writing GHCJS/Reflex apps targeting static sites without a backend.
Nix
24
star
18

Taut

An ambitious Slack JSON export viewer.
Haskell
24
star
19

rib-sample

Sample site for the Rib static site generator
Haskell
23
star
20

emanote-template

Notebook template for Emanote
Markdown
21
star
21

ema-template

Template repo for Ema static site generator
Haskell
20
star
22

leptos-fullstack

A Nix template for full-stack web apps in Rust using Leptos
Rust
15
star
23

monorepo-nix-template

Make monorepos with Nix flakes
Nix
13
star
24

tailwind-haskell

A No-JavaScript Tailwind runner in Haskell
Haskell
13
star
25

orgself

Exploring calendar outlining
Haskell
13
star
26

devour-flake

Devour all outputs in a Nix flake.
Nix
13
star
27

zulip-archive

Zulip Archive viewer (statically generated HTML)
Haskell
13
star
28

fsharp-wasm-static-demo

A proof-of-concept demo of Bolero serverless SPA running on GitHub Pages using WebAssembly
F#
13
star
29

unionmount

Union mount in Haskell, with fsnotify
Haskell
11
star
30

mpt-sample

A sample project created using modern-package-template
Python
11
star
31

weeklyreddit

RSS of weekly top posts in reddit. Superseded by https://github.com/srid/slownews
Python
11
star
32

emanote.obelisk

Incremental fast build engine cum unique navigation UI (with search) for plain-text notes, optimized for private notebooks.
Haskell
11
star
33

flake-root

A `flake-parts` module for finding your way to the project root directory
Nix
9
star
34

fablib

Fabric (fabfile.py) helper library
Python
9
star
35

proc-flake

A `flake-parts` module for running multiple processes in a dev shell
Nix
9
star
36

ka

Experimental playground for neuron
Haskell
8
star
37

cargo-doc-live

Flake module to provide live server version of `cargo doc`
Nix
8
star
38

miso-viso

Playing with abstract visualizations in Miso. Work in Progress.
Haskell
8
star
39

haskell-multi-nix

A simple demo of Nixifying a multi-package Haskell project
Nix
8
star
40

agda-template

Imperfect Agda project template using Nix
Nix
7
star
41

awesome-stars

My starred repos
7
star
42

revue

Personal website written in Haskell & Reflex using Obelisk
Haskell
7
star
43

anima

Playground for creating animations programatically
Nix
7
star
44

boalisp

Lisp to Python bytecode compiler (2007 hack)
Scheme
7
star
45

pandoc-link-context

Extract context around links in Pandoc
Haskell
6
star
46

tailwind-nix

Nix
6
star
47

Pallanguzhi

A Tamil mancala game written in PureScript
PureScript
6
star
48

reflex-dom-pandoc

Render Pandoc documents in reflex-dom
Haskell
6
star
49

MarkdownPreview

Demo Obelisk app
Haskell
6
star
50

check-flake

Add a `.#check` package for building all checks for the current system
Nix
5
star
51

dropbox-docker

Experiments in dropbox, docker, static site hosting
Shell
5
star
52

Feather

[Paused] Static site generator with customizable pipeline and live-reload
F#
5
star
53

codebackup

Backup your Github and Bitbucket repositories
Python
5
star
54

propertygraph

Persisted property graphs in Haskell
Haskell
4
star
55

srid

Source for https://srid.ca (do you know that you can git clone and `nix run` this website locally?)
Markdown
4
star
56

www.srid.ca

My website based on Emanote
Markdown
4
star
57

TheMotteDashboard

A dashboard for r/TheMotte, powered by Ema
Haskell
4
star
58

dropweb

Render markdown files in Dropbox; and thus expose (not host) one's website or blog via App Engine.
Python
4
star
59

notaskinnerbox

weekly stackoverflow, and many other things (to come)
Clojure
4
star
60

nix-health

WIP: Check the health of your Nix install
Nu
4
star
61

OneBird

F# + memstate example
F#
4
star
62

aoc2019

Srid's solutions to Advent of Code 2019 in Haskell
Haskell
4
star
63

my-haskell-scripts

Bunch of Haskell scripts for various purposes
Haskell
4
star
64

motif

[WIP] A typed outliner
Haskell
3
star
65

debris

a simple bliki - runs on appengine (this project is dead)
Python
3
star
66

nvim.nix-archived

MOVED https://github.com/srid/nixos-config/blob/master/home/neovim.nix
Vim Script
3
star
67

nixpkgs-match

Update your nixpkgs flake input to the same rev as that of the given flake
Nix
3
star
68

elm-laundrycoins

A simple Elm program to calculate the exact coin change for doing laundry
Elm
3
star
69

org-clock-dashboard

An OSX menubar app to display orgmode clock information.
Python
3
star
70

banyan

Tree of time
Haskell
3
star
71

generics-sop-examples

Haskell
3
star
72

go-tool

Fork of http://code.google.com/p/go-tool
Python
3
star
73

commonmark-wikilink

Commonmark Wikilink parser for Pandoc
Haskell
3
star
74

invoice-generator

Invoice Generator using Rib
Haskell
3
star
75

haskell-ladder

WIP: Haskell Pedagogic Ladder (Run `nix run` to run the site locally)
Markdown
3
star
76

idris-js-template

Idris template for JavaScript projects
Nix
3
star
77

nixid

Like `ghcid -T` but for Nix
Nix
3
star
78

home.nix

KISS Nix configuration
Nix
3
star
79

tox-bootstrap

OUTDATED REPO; see http://code.google.com/p/pytox/source/browse/toxbootstrap.py
Python
3
star
80

cis194

My cis194 Haskell course work
Haskell
2
star
81

shell-completion-dump

Use Haskell to dump the gnarly mess that are shell completions (bash, zsh, fish)
Nix
2
star
82

windicss-nix

WindiCSS packaged up in Nix (and Docker)
Nix
2
star
83

tagtree

Haskell library for representing hierarchical tags
Haskell
2
star
84

idris-template

Like https://github.com/srid/haskell-template but for Idris 2
Nix
2
star
85

cardano-here

Nix
2
star
86

algebraic-graphs-patch

Patch data structure and algorithms for algebraic-graphs
Haskell
2
star
87

obelisk-skeleton

Haskell
2
star
88

deux

Something something mind maps
Haskell
2
star
89

learning-fsharp

ongoing mind map of me learning F#
Markdown
2
star
90

haskell-playground

This repo is retired; See https://github.com/srid/haskell-template instead
Nix
2
star
91

lvar

TMVar with change notification
Haskell
2
star
92

commonmark-simple

Simple interface to https://github.com/jgm/commonmark-hs
Haskell
2
star
93

readability-service

nothing here, move along
CoffeeScript
2
star
94

I

[WIP] A mood tracker based on the "noting" technique.
Haskell
2
star
95

papers

2
star
96

guide.cerveau.app

Markdown
2
star
97

gro

WIP: Exploring single file org-mode visualization
Haskell
2
star
98

heist-extra

Extra utilities for working with Heist
Haskell
2
star
99

url-slug

Encoding and decoding of URL slugs
Nix
1
star
100

spoj-haskell

My SPOJ solutions in Haskell
Haskell
1
star