Hello-world haskell package.

This commit is contained in:
Benjamin Summers 2019-04-25 14:02:19 -07:00
parent 0a0d7e0e57
commit 4b6509e7a3
4 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,37 @@
{ pkgs ? import ../../nixpkgs.nix }:
let
compiler = "default";
doBenchmark = false;
run-hpack =
"${pkgs.haskellPackages.hpack}/bin/hpack";
f = { mkDerivation, stdenv,
base, classy-prelude, lens, hpack, megaparsec }:
mkDerivation {
pname = "uterm";
version = "0.1.0.0";
src = ../../../pkg/uterm;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
base classy-prelude lens hpack megaparsec
];
license = stdenv.lib.licenses.lgpl3;
preConfigure = ''
${run-hpack}
'';
};
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
drv = variant (haskellPackages.callPackage f {});
in
if pkgs.lib.inNixShell then drv.env else drv

9
pkg/uterm/Main.hs Normal file
View File

@ -0,0 +1,9 @@
module Main where
import ClassyPrelude
import Control.Lens
--------------------------------------------------------------------------------
main :: IO ()
main = "Hello World" & putStrLn

27
pkg/uterm/package.dhall Normal file
View File

@ -0,0 +1,27 @@
{ name =
"uterm"
, version =
"0.1.0"
, license =
"AGPL-3.0-only"
, default-extensions =
[ "OverloadedStrings"
, "TypeApplications"
, "UnicodeSyntax"
, "FlexibleContexts"
, "TemplateHaskell"
, "QuasiQuotes"
, "LambdaCase"
, "NoImplicitPrelude"
, "ScopedTypeVariables"
, "DeriveAnyClass"
, "DeriveGeneric"
]
, dependencies =
[ "base"
, "classy-prelude"
, "lens"
]
, executables =
{ pomo = { main = "Main.hs" } }
}

1
pkg/uterm/shell.nix Normal file
View File

@ -0,0 +1 @@
import ../../nix/pkgs/uterm/default.nix