Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial import from https://github.com/vaibhavsagar/experiments/tree/…
- Loading branch information
0 parents
commit 29ea62b
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
import Web.Scotty | ||
|
||
import Data.Monoid (mconcat) | ||
|
||
main = scotty 3000 $ do | ||
get "/:word" $ do | ||
beam <- param "word" | ||
html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: blank-me-up | ||
version: 0.1.0.0 | ||
license: BSD3 | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
|
||
executable blank-me-up | ||
main-is: Main.hs | ||
build-depends: base >=4.9 && <5 | ||
, scotty | ||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }: | ||
|
||
let | ||
|
||
inherit (nixpkgs) pkgs; | ||
|
||
f = { mkDerivation, base, scotty, stdenv }: | ||
mkDerivation { | ||
pname = "blank-me-up"; | ||
version = "0.1.0.0"; | ||
src = ./.; | ||
isLibrary = false; | ||
isExecutable = true; | ||
enableSharedExecutables = false; | ||
enableSharedLibraries = false; | ||
executableHaskellDepends = [ base scotty ]; | ||
license = stdenv.lib.licenses.bsd3; | ||
configureFlags = [ | ||
"--ghc-option=-optl=-static" | ||
"--ghc-option=-optl=-L${pkgs.gmp6.override { withStatic = true; }}/lib" | ||
"--ghc-option=-optl=-L${pkgs.zlib.static}/lib" | ||
"--ghc-option=-optl=-L${pkgs.glibc.static}/lib" | ||
]; | ||
}; | ||
|
||
haskellPackages = if compiler == "default" | ||
then pkgs.haskellPackages | ||
else pkgs.haskell.packages.${compiler}; | ||
|
||
drv = haskellPackages.callPackage f {}; | ||
|
||
in | ||
|
||
if pkgs.lib.inNixShell then drv.env else drv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
let | ||
pkgs = import <nixpkgs> {}; | ||
in pkgs.buildFHSUserEnv { | ||
name = "fhs"; | ||
targetPkgs = pkgs: [ | ||
(pkgs.haskellPackages.ghcWithPackages (p: with p; [ cabal-install ])) | ||
pkgs.gmp5.static | ||
pkgs.glibc.static | ||
pkgs.zlib.static | ||
pkgs.zlib.dev | ||
]; | ||
} |