matrix-media-expanded/flake.nix
Sridhar Ratnakumar 1127faaba2
Delegate most Nix to srid/haskell-flake (a flake-parts module for Haskell dev) (#22)
* Move Haskell stuff into separate module

cf. https://github.com/hercules-ci/flake-parts/blob/main/modules/apps.nix

* Parametrize the haskell part

* Allow user to override default attrs

* Add baseBuildTools (so they can be overriden)

* Don't hardcode non-essential build tools

* Avoid types.anything

* Merge into one buildTools, using sets

* getExe and type are redundant

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>

* Use docstring wherever possible

* Use ${self} as default for root

* Allow defining multiple Haskell packages

The downside: the user is forced to define 'default' flake outputs.

* Automatically create 'default' attr if a singleton projects set

* Make haskell.nix its own repo

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-05-30 09:16:38 -04:00

33 lines
1 KiB
Nix

{
description = "srid/haskell-template: Nix template for Haskell projects";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
flake-compat.inputs.nixpkgs.follows = "nixpkgs";
haskell-flake.url = "github:srid/haskell-flake";
};
outputs = { self, nixpkgs, flake-parts, haskell-flake, ... }:
flake-parts.lib.mkFlake { inherit self; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [
haskell-flake.flakeModule
];
perSystem = { self', pkgs, ... }: {
haskellProjects.haskell-template = {
buildTools = hp: {
# TODO: Use https://github.com/numtide/treefmt/pull/169
inherit (pkgs)
treefmt
nixpkgs-fmt;
inherit (hp)
cabal-fmt
fourmolu;
};
};
};
};
}