2021-12-20 00:58:35 -05:00
|
|
|
{
|
2022-03-10 10:10:10 -05:00
|
|
|
description = "Conway's Game of Life in Haskell";
|
2021-12-20 00:58:35 -05:00
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils, ... }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
2022-03-11 23:01:32 -05:00
|
|
|
overlays = [ ];
|
|
|
|
pkgs = import nixpkgs { inherit system overlays; config.allowBroken = true; };
|
2021-12-28 22:55:42 -05:00
|
|
|
execName = "gol";
|
2022-03-11 23:01:32 -05:00
|
|
|
hp = pkgs.haskellPackages; # pkgs.haskell.packages.ghc921;
|
|
|
|
project = returnShellEnv:
|
|
|
|
hp.developPackage {
|
|
|
|
inherit returnShellEnv;
|
|
|
|
name = "conways-game-of-life";
|
|
|
|
root = ./.;
|
|
|
|
withHoogle = false;
|
|
|
|
overrides = self: super: with pkgs.haskell.lib; {
|
|
|
|
# Use callCabal2nix to override Haskell dependencies here
|
|
|
|
# cf. https://tek.brick.do/K3VXJd8mEKO7
|
|
|
|
# Example:
|
|
|
|
# > NanoID = self.callCabal2nix "NanoID" inputs.NanoID { };
|
|
|
|
# Assumes that you have the 'NanoID' flake input defined.
|
|
|
|
};
|
|
|
|
modifier = drv:
|
|
|
|
pkgs.haskell.lib.addBuildTools drv (with hp; [
|
|
|
|
# Specify your build/dev dependencies here.
|
|
|
|
ghc
|
|
|
|
cabal-install
|
|
|
|
hlint
|
|
|
|
haskell-language-server
|
|
|
|
ormolu
|
|
|
|
|
|
|
|
pkgs.mesa
|
|
|
|
pkgs.mesa_glu
|
|
|
|
pkgs.freeglut
|
|
|
|
]);
|
2021-12-20 00:58:35 -05:00
|
|
|
};
|
2022-03-11 23:01:32 -05:00
|
|
|
in
|
|
|
|
{
|
|
|
|
# Used by `nix build` & `nix run` (prod exe)
|
|
|
|
defaultPackage = project false;
|
2021-12-20 00:58:35 -05:00
|
|
|
|
2022-03-11 23:01:32 -05:00
|
|
|
defaultApp = {
|
2021-12-28 22:55:42 -05:00
|
|
|
type = "app";
|
2022-03-11 23:01:32 -05:00
|
|
|
program = "${self.defaultPackage.${system}}/bin/${execName}";
|
2021-12-28 22:55:42 -05:00
|
|
|
};
|
|
|
|
|
2022-03-11 23:01:32 -05:00
|
|
|
# Used by `nix develop` (dev shell)
|
|
|
|
devShell = project true;
|
2021-12-20 00:58:35 -05:00
|
|
|
});
|
2022-03-09 13:49:35 -05:00
|
|
|
}
|