Initial commit

This commit is contained in:
Kiana Sheibani 2022-03-12 18:39:23 -05:00
commit b4a4a6bca3
6 changed files with 135 additions and 0 deletions

3
.envrc Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
use flake

31
.gitignore vendored Normal file
View file

@ -0,0 +1,31 @@
# standard haskell gitignore
dist
dist-*
cabal-dev
*.o
*.hi
*.hie
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
# ignore vscodium's local config
.vscode/
# ignore nix build system
result*
.direnv

4
Main.hs Normal file
View file

@ -0,0 +1,4 @@
module Main where
main :: IO ()
main = undefined

37
flake.lock Normal file
View file

@ -0,0 +1,37 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
"id": "flake-utils",
"type": "indirect"
}
},
"nixpkgs": {
"locked": {
"narHash": "sha256-4va4MvJ076XyPp5h8sm5eMQvCrJ6yZAbBmyw95dGyw4=",
"path": "/nix/store/d9wpzgyjlpw1424kw2lyilah6690fnk3-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

48
flake.nix Normal file
View file

@ -0,0 +1,48 @@
{
description = "A snake game in Haskell using Yampa";
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [];
pkgs = import nixpkgs { inherit system overlays; config.allowBroken = true; };
# package/executable name
packageName = "snake";
execName = packageName;
# version of ghc used
hp = pkgs.haskellPackages;
project = returnShellEnv:
hp.developPackage {
inherit returnShellEnv;
name = packageName;
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.
]);
};
in
{
# Used by `nix build` & `nix run` (prod exe)
defaultPackage = project false;
defaultApp = {
type = "app";
program = "${self.defaultPackage.${system}}/bin/${execName}";
};
# Used by `nix develop` (dev shell)
devShell = project true;
});
}

12
snake.cabal Normal file
View file

@ -0,0 +1,12 @@
cabal-version: 2.4
name: snake
version: 0.0
synopsis: A snake game using Yampa
author: Kiana Sheibani
license: MIT
build-type: Simple
executable snake
main-is: Main.hs
other-modules:
build-depends: