1
1
mirror of https://github.com/srid/ema.git synced 2024-12-01 15:13:36 +03:00
ema/flake.nix
2021-04-26 13:36:34 -04:00

59 lines
1.6 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;
};
lvar = {
url = "github:srid/lvar";
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;
overrides = self: super: with pkgs.haskell.lib; {
lvar = self.callCabal2nix "lvar" inputs.lvar { };
};
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};
});
}