From 60a5da37a6f25d25963c9cbd2750ff16db2361a2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 5 Apr 2016 23:48:15 +0200 Subject: Framework --- .gitignore | 1 + default.nix | 8 ++++++++ events/LICENSE | 20 ++++++++++++++++++++ events/Setup.hs | 2 ++ events/events.cabal | 25 +++++++++++++++++++++++++ events/events.nix | 12 ++++++++++++ events/src/Main.hs | 2 ++ shell.nix | 16 ++++++++++++++++ 8 files changed, 86 insertions(+) create mode 100644 .gitignore create mode 100644 default.nix create mode 100644 events/LICENSE create mode 100644 events/Setup.hs create mode 100644 events/events.cabal create mode 100644 events/events.nix create mode 100644 events/src/Main.hs create mode 100644 shell.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4a847d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..6cb7da5 --- /dev/null +++ b/default.nix @@ -0,0 +1,8 @@ +{ pkgs ? (import {}) +, compilerName ? "ghc7103" +}: + +rec { + haskellPackages = pkgs.haskell.packages."${compilerName}"; + events = haskellPackages.callPackage ./events/events.nix {}; +} diff --git a/events/LICENSE b/events/LICENSE new file mode 100644 index 0000000..bef535c --- /dev/null +++ b/events/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2016 Gregor Kleen + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/events/Setup.hs b/events/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/events/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/events/events.cabal b/events/events.cabal new file mode 100644 index 0000000..bb5d59b --- /dev/null +++ b/events/events.cabal @@ -0,0 +1,25 @@ +-- Initial event.cabal generated by cabal init. For further documentation, +-- see http://haskell.org/cabal/users-guide/ + +name: events +version: 0.0.0 +synopsis: An appointment book +-- description: +homepage: https://git.yggdrasil.li/gkleen/pub/events +license: MIT +license-file: LICENSE +author: Gregor Kleen +maintainer: aethoago@141.li +-- copyright: +category: Organization +build-type: Simple +-- extra-source-files: +cabal-version: >=1.10 + +executable event + main-is: Main.hs + -- other-modules: + -- other-extensions: + build-depends: base >=4.8 && <4.9 + hs-source-dirs: src + default-language: Haskell2010 \ No newline at end of file diff --git a/events/events.nix b/events/events.nix new file mode 100644 index 0000000..dba4055 --- /dev/null +++ b/events/events.nix @@ -0,0 +1,12 @@ +{ mkDerivation, base, stdenv }: +mkDerivation { + pname = "events"; + version = "0.0.0"; + src = ./.; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ base ]; + homepage = "https://git.yggdrasil.li/gkleen/pub/events"; + description = "An appointment book"; + license = stdenv.lib.licenses.mit; +} diff --git a/events/src/Main.hs b/events/src/Main.hs new file mode 100644 index 0000000..e9e1deb --- /dev/null +++ b/events/src/Main.hs @@ -0,0 +1,2 @@ +main :: IO () +main = undefined diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..684f721 --- /dev/null +++ b/shell.nix @@ -0,0 +1,16 @@ +{ pkgs ? (import {}) +, haskellPackages ? (import ./default.nix { inherit pkgs; }).haskellPackages +}: + +let + ghc = haskellPackages.ghcWithPackages (ps: payload ++ (with ps; [ hlint cabal2nix cabal-install ])); + payload = builtins.attrValues (import ./default.nix {}); +in pkgs.stdenv.mkDerivation rec { + bareName = "event"; + name = "${bareName}-env"; + buildInputs = [ ghc ]; + shellHook = '' + eval $(egrep ^export ${ghc}/bin/ghc) + export PROMPT_INFO="${name}" + ''; +} -- cgit v1.2.3