Add support for "nix run"
This commit is contained in:
parent
d323ca2988
commit
3cdb121ed3
|
@ -6,7 +6,7 @@ license: MIT
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
cabal-version: >= 1.8
|
cabal-version: >= 1.8
|
||||||
|
|
||||||
executable main
|
executable gol
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
other-modules: GOL.Rule,
|
other-modules: GOL.Rule,
|
||||||
GOL.Space,
|
GOL.Space,
|
||||||
|
|
10
flake.nix
10
flake.nix
|
@ -23,8 +23,9 @@
|
||||||
jailbreakUnbreak = pkg:
|
jailbreakUnbreak = pkg:
|
||||||
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
|
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
|
||||||
|
|
||||||
# DON'T FORGET TO PUT YOUR PACKAGE NAME HERE, REMOVING `throw`
|
|
||||||
packageName = "conways-game-of-life";
|
packageName = "conways-game-of-life";
|
||||||
|
|
||||||
|
execName = "gol";
|
||||||
in {
|
in {
|
||||||
packages.${packageName} =
|
packages.${packageName} =
|
||||||
haskellPackages.callCabal2nix packageName self rec {
|
haskellPackages.callCabal2nix packageName self rec {
|
||||||
|
@ -33,6 +34,13 @@
|
||||||
|
|
||||||
defaultPackage = self.packages.${system}.${packageName};
|
defaultPackage = self.packages.${system}.${packageName};
|
||||||
|
|
||||||
|
apps.${execName} = {
|
||||||
|
type = "app";
|
||||||
|
program = "${self.packages.${system}.${packageName}}/bin/${execName}";
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultApp = self.apps.${system}.${execName};
|
||||||
|
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
buildInputs = with haskellPackages; [
|
buildInputs = with haskellPackages; [
|
||||||
ghcid
|
ghcid
|
||||||
|
|
Loading…
Reference in a new issue