Skip to content

A `flake-parts` Nix module for Haskell development

License

Notifications You must be signed in to change notification settings

HariAmoor-professional/haskell-flake

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

haskell-flake

A flake-parts Nix module for Haskell development.

Why?

To keep flake.nix smaller (eg.: going from this 91-line flake.nix to the 31-line one) and declarative (what vs how) by bringing NixOS module system to flakes.

Usage

To use haskell-flake in your Haskell projects, create a flake.nix containing the following:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    haskell-flake.url = "github:srid/haskell-flake";
  };
  outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
    flake-parts.lib.mkFlake { inherit self; } {
      systems = nixpkgs.lib.systems.flakeExposed;
      imports = [ inputs.haskell-flake.flakeModule ];
      perSystem = { self', pkgs, ... }: {
        haskellProjects.default = {
          root = ./.;
          # buildTools = hp: { fourmolu = hp.fourmolu; };
          # source-overrides = { };
          # overrides = self: super: { };
          # modifier = drv: drv;
        };
      };
    };
}

See flake-module.nix -> options for a list of options available. Uses callCabal2nixWithOptions under the hood. See #7 for future improvements.

Template

https://github.com/srid/haskell-template

Examples

About

A `flake-parts` Nix module for Haskell development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 100.0%