Add support for "nix run"

This commit is contained in:
Kiana Sheibani 2021-12-28 22:55:42 -05:00
parent d323ca2988
commit 3cdb121ed3
2 changed files with 10 additions and 2 deletions

View file

@ -6,7 +6,7 @@ license: MIT
build-type: Simple
cabal-version: >= 1.8
executable main
executable gol
main-is: Main.hs
other-modules: GOL.Rule,
GOL.Space,

View file

@ -23,8 +23,9 @@
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
# DON'T FORGET TO PUT YOUR PACKAGE NAME HERE, REMOVING `throw`
packageName = "conways-game-of-life";
execName = "gol";
in {
packages.${packageName} =
haskellPackages.callCabal2nix packageName self rec {
@ -33,6 +34,13 @@
defaultPackage = self.packages.${system}.${packageName};
apps.${execName} = {
type = "app";
program = "${self.packages.${system}.${packageName}}/bin/${execName}";
};
defaultApp = self.apps.${system}.${execName};
devShell = pkgs.mkShell {
buildInputs = with haskellPackages; [
ghcid