1
1
mirror of https://github.com/srid/ema.git synced 2024-12-02 09:15:10 +03:00
ema/flake.nix

59 lines
1.6 KiB
Nix
Raw Normal View History

2021-04-19 18:07:52 +03:00
{
description = "Ema project";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/c5173fe20851def75a5676a69a0d09b9d24ae428";
2021-04-19 18:07:52 +03:00
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
#lvar = {
# url = "github:srid/lvar";
# flake = false;
#};
2021-04-19 18:07:52 +03:00
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
let
2021-04-24 19:04:16 +03:00
name = "ema";
2021-04-19 18:07:52 +03:00
overlays = [ ];
pkgs = import nixpkgs {
inherit system overlays;
};
2021-04-19 18:07:52 +03:00
emaProject = returnShellEnv:
pkgs.haskellPackages.developPackage {
2021-04-24 19:04:16 +03:00
inherit name returnShellEnv;
2021-04-19 18:07:52 +03:00
root = ./.;
withHoogle = false;
2021-04-26 20:36:34 +03:00
overrides = self: super: with pkgs.haskell.lib; {
# lvar = self.callCabal2nix "lvar" inputs.lvar { };
2021-04-26 20:36:34 +03:00
};
2021-04-19 18:07:52 +03:00
modifier = drv:
pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
[
cabal-install
cabal-fmt
pkgs.nixpkgs-fmt
ghcid
ormolu
haskell-language-server
]);
};
2021-04-24 19:04:16 +03:00
ema = emaProject false;
2021-04-19 18:07:52 +03:00
in
2021-04-24 19:04:16 +03:00
rec {
2021-04-19 18:36:51 +03:00
# Used by `nix build`
2021-04-24 19:04:16 +03:00
defaultPackage = ema;
2021-04-19 18:07:52 +03:00
2021-04-19 18:36:51 +03:00
# Used by `nix develop`
2021-04-19 18:07:52 +03:00
devShell = emaProject true;
2021-04-24 19:04:16 +03:00
# Used by `nix run` (for docs)
apps.${name} = flake-utils.lib.mkApp {
drv = ema;
exePath = "/bin/ema-docs";
};
defaultApp = apps.${name};
2021-04-19 18:07:52 +03:00
});
}