mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-01 19:46:36 +03:00
Hello-world haskell package.
This commit is contained in:
parent
0a0d7e0e57
commit
4b6509e7a3
37
nix/pkgs/uterm/default.nix
Normal file
37
nix/pkgs/uterm/default.nix
Normal 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
9
pkg/uterm/Main.hs
Normal 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
27
pkg/uterm/package.dhall
Normal 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
1
pkg/uterm/shell.nix
Normal file
@ -0,0 +1 @@
|
||||
import ../../nix/pkgs/uterm/default.nix
|
Loading…
Reference in New Issue
Block a user