diff options
-rw-r--r-- | LICENSE | 20 | ||||
-rw-r--r-- | Setup.hs | 2 | ||||
-rw-r--r-- | default.nix | 8 | ||||
-rw-r--r-- | sequence.cabal | 24 | ||||
-rw-r--r-- | sequence.nix | 10 | ||||
-rw-r--r-- | shell.nix | 17 | ||||
-rw-r--r-- | src/Main.hs | 2 |
7 files changed, 83 insertions, 0 deletions
@@ -0,0 +1,20 @@ | |||
1 | Copyright (c) 2016 Gregor Kleen | ||
2 | |||
3 | Permission is hereby granted, free of charge, to any person obtaining | ||
4 | a copy of this software and associated documentation files (the | ||
5 | "Software"), to deal in the Software without restriction, including | ||
6 | without limitation the rights to use, copy, modify, merge, publish, | ||
7 | distribute, sublicense, and/or sell copies of the Software, and to | ||
8 | permit persons to whom the Software is furnished to do so, subject to | ||
9 | the following conditions: | ||
10 | |||
11 | The above copyright notice and this permission notice shall be included | ||
12 | in all copies or substantial portions of the Software. | ||
13 | |||
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/Setup.hs | |||
@@ -0,0 +1,2 @@ | |||
1 | import Distribution.Simple | ||
2 | main = defaultMain | ||
diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..ac19354 --- /dev/null +++ b/default.nix | |||
@@ -0,0 +1,8 @@ | |||
1 | { pkgs ? (import <nixpkgs> {}) | ||
2 | , compilerName ? "ghc7103" | ||
3 | }: | ||
4 | |||
5 | rec { | ||
6 | haskellPackages = pkgs.haskell.packages."${compilerName}"; | ||
7 | sequence = haskellPackages.callPackage ./sequence.nix {}; | ||
8 | } | ||
diff --git a/sequence.cabal b/sequence.cabal new file mode 100644 index 0000000..0cea160 --- /dev/null +++ b/sequence.cabal | |||
@@ -0,0 +1,24 @@ | |||
1 | -- Initial sequence.cabal generated by cabal init. For further | ||
2 | -- documentation, see http://haskell.org/cabal/users-guide/ | ||
3 | |||
4 | name: sequence | ||
5 | version: 0.0.0 | ||
6 | -- synopsis: | ||
7 | -- description: | ||
8 | license: MIT | ||
9 | license-file: LICENSE | ||
10 | author: Gregor Kleen | ||
11 | maintainer: gkleen@yggdrasil.li | ||
12 | -- copyright: | ||
13 | category: Game | ||
14 | build-type: Simple | ||
15 | -- extra-source-files: | ||
16 | cabal-version: >=1.10 | ||
17 | |||
18 | executable sequence | ||
19 | main-is: Main.hs | ||
20 | -- other-modules: | ||
21 | -- other-extensions: | ||
22 | build-depends: base >=4.8 && <4.9 | ||
23 | hs-source-dirs: src | ||
24 | default-language: Haskell2010 \ No newline at end of file | ||
diff --git a/sequence.nix b/sequence.nix new file mode 100644 index 0000000..612eb30 --- /dev/null +++ b/sequence.nix | |||
@@ -0,0 +1,10 @@ | |||
1 | { mkDerivation, base, stdenv }: | ||
2 | mkDerivation { | ||
3 | pname = "sequence"; | ||
4 | version = "0.0.0"; | ||
5 | src = ./.; | ||
6 | isLibrary = false; | ||
7 | isExecutable = true; | ||
8 | executableHaskellDepends = [ base ]; | ||
9 | license = stdenv.lib.licenses.mit; | ||
10 | } | ||
diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..294fea0 --- /dev/null +++ b/shell.nix | |||
@@ -0,0 +1,17 @@ | |||
1 | { pkgs ? (import <nixpkgs> {}) | ||
2 | , haskellPackages ? (import ./default.nix { inherit pkgs; }).haskellPackages | ||
3 | }: | ||
4 | |||
5 | let | ||
6 | ghc = (haskellPackages.ghcWithPackages (ps: (payload ++ depends ++ (with ps; [ hlint cabal2nix cabal-install ])))).override { ignoreCollisions = true; }; | ||
7 | payload = builtins.attrValues (import ./default.nix {}); | ||
8 | depends = builtins.concatLists (builtins.map (x: if builtins.hasAttr "nativeBuildInputs" x then x.nativeBuildInputs else []) (builtins.attrValues (import ./default.nix {}))); | ||
9 | in pkgs.stdenv.mkDerivation rec { | ||
10 | bareName = "sequence"; | ||
11 | name = "${bareName}-env"; | ||
12 | buildInputs = [ ghc ]; | ||
13 | shellHook = '' | ||
14 | eval $(egrep ^export ${ghc}/bin/ghc) | ||
15 | export PROMPT_INFO="${name}" | ||
16 | ''; | ||
17 | } | ||
diff --git a/src/Main.hs b/src/Main.hs new file mode 100644 index 0000000..e9e1deb --- /dev/null +++ b/src/Main.hs | |||
@@ -0,0 +1,2 @@ | |||
1 | main :: IO () | ||
2 | main = undefined | ||