mirror of
https://github.com/srid/ema.git
synced 2024-11-29 17:46:08 +03:00
52 lines
1.4 KiB
Nix
52 lines
1.4 KiB
Nix
{
|
|
description = "Ema project";
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/8389dcb67d934ee72c1d1e7228d92be9b3f71bad";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
flake-compat = {
|
|
url = "github:edolstra/flake-compat";
|
|
flake = false;
|
|
};
|
|
};
|
|
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
|
|
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
|
|
let
|
|
name = "ema";
|
|
overlays = [ ];
|
|
pkgs = import nixpkgs {
|
|
inherit system overlays;
|
|
};
|
|
emaProject = returnShellEnv:
|
|
pkgs.haskellPackages.developPackage {
|
|
inherit name returnShellEnv;
|
|
root = ./.;
|
|
withHoogle = false;
|
|
modifier = drv:
|
|
pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
|
|
[
|
|
cabal-install
|
|
cabal-fmt
|
|
pkgs.nixpkgs-fmt
|
|
ghcid
|
|
ormolu
|
|
haskell-language-server
|
|
]);
|
|
};
|
|
ema = emaProject false;
|
|
in
|
|
rec {
|
|
# Used by `nix build`
|
|
defaultPackage = ema;
|
|
|
|
# Used by `nix develop`
|
|
devShell = emaProject true;
|
|
|
|
# Used by `nix run` (for docs)
|
|
apps.${name} = flake-utils.lib.mkApp {
|
|
drv = ema;
|
|
exePath = "/bin/ema-docs";
|
|
};
|
|
defaultApp = apps.${name};
|
|
});
|
|
}
|