introduce haskell.nix

This commit is contained in:
nek0 2021-06-10 00:14:39 +02:00
parent 1c09cc0d13
commit 36f36d4e9f
6 changed files with 775 additions and 0 deletions

116
nix/.plan.nix/mateamt.nix Normal file
View file

@ -0,0 +1,116 @@
{ system
, compiler
, flags
, pkgs
, hsPkgs
, pkgconfPkgs
, errorHandler
, config
, ... }:
{
flags = { develop = false; };
package = {
specVersion = "3.0";
identifier = { name = "mateamt"; version = "0.0.0.0"; };
license = "AGPL-3.0-or-later";
copyright = "";
maintainer = "nek0@nek0.eu";
author = "nek0";
homepage = "https://gitea.nek0.eu/nek0/mateamt/";
url = "";
synopsis = "A whole new matemat";
description = "";
buildType = "Simple";
isLocal = true;
};
components = {
"library" = {
depends = [
(hsPkgs."base" or (errorHandler.buildDepError "base"))
(hsPkgs."text" or (errorHandler.buildDepError "text"))
(hsPkgs."time" or (errorHandler.buildDepError "time"))
(hsPkgs."mtl" or (errorHandler.buildDepError "mtl"))
(hsPkgs."containers" or (errorHandler.buildDepError "containers"))
(hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring"))
(hsPkgs."base16-bytestring" or (errorHandler.buildDepError "base16-bytestring"))
(hsPkgs."base64-bytestring" or (errorHandler.buildDepError "base64-bytestring"))
(hsPkgs."random-bytestring" or (errorHandler.buildDepError "random-bytestring"))
(hsPkgs."servant" or (errorHandler.buildDepError "servant"))
(hsPkgs."servant-server" or (errorHandler.buildDepError "servant-server"))
(hsPkgs."servant-rawm" or (errorHandler.buildDepError "servant-rawm"))
(hsPkgs."servant-rawm-server" or (errorHandler.buildDepError "servant-rawm-server"))
(hsPkgs."opaleye" or (errorHandler.buildDepError "opaleye"))
(hsPkgs."aeson" or (errorHandler.buildDepError "aeson"))
(hsPkgs."profunctors" or (errorHandler.buildDepError "profunctors"))
(hsPkgs."product-profunctors" or (errorHandler.buildDepError "product-profunctors"))
(hsPkgs."postgresql-simple" or (errorHandler.buildDepError "postgresql-simple"))
(hsPkgs."warp" or (errorHandler.buildDepError "warp"))
(hsPkgs."wai" or (errorHandler.buildDepError "wai"))
(hsPkgs."wai-logger" or (errorHandler.buildDepError "wai-logger"))
(hsPkgs."http-types" or (errorHandler.buildDepError "http-types"))
(hsPkgs."http-api-data" or (errorHandler.buildDepError "http-api-data"))
(hsPkgs."stm" or (errorHandler.buildDepError "stm"))
(hsPkgs."pureMD5" or (errorHandler.buildDepError "pureMD5"))
(hsPkgs."extra" or (errorHandler.buildDepError "extra"))
];
buildable = true;
};
exes = {
"mateamt" = {
depends = [
(hsPkgs."base" or (errorHandler.buildDepError "base"))
(hsPkgs."mateamt" or (errorHandler.buildDepError "mateamt"))
(hsPkgs."text" or (errorHandler.buildDepError "text"))
(hsPkgs."time" or (errorHandler.buildDepError "time"))
(hsPkgs."mtl" or (errorHandler.buildDepError "mtl"))
(hsPkgs."containers" or (errorHandler.buildDepError "containers"))
(hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring"))
(hsPkgs."base16-bytestring" or (errorHandler.buildDepError "base16-bytestring"))
(hsPkgs."opaleye" or (errorHandler.buildDepError "opaleye"))
(hsPkgs."postgresql-simple" or (errorHandler.buildDepError "postgresql-simple"))
(hsPkgs."postgresql-simple-migration" or (errorHandler.buildDepError "postgresql-simple-migration"))
(hsPkgs."stm" or (errorHandler.buildDepError "stm"))
(hsPkgs."network" or (errorHandler.buildDepError "network"))
(hsPkgs."servant" or (errorHandler.buildDepError "servant"))
(hsPkgs."servant-server" or (errorHandler.buildDepError "servant-server"))
(hsPkgs."warp" or (errorHandler.buildDepError "warp"))
(hsPkgs."wai" or (errorHandler.buildDepError "wai"))
(hsPkgs."wai-logger" or (errorHandler.buildDepError "wai-logger"))
(hsPkgs."wai-middleware-throttle" or (errorHandler.buildDepError "wai-middleware-throttle"))
(hsPkgs."HsYAML" or (errorHandler.buildDepError "HsYAML"))
(hsPkgs."optparse-applicative" or (errorHandler.buildDepError "optparse-applicative"))
(hsPkgs."case-insensitive" or (errorHandler.buildDepError "case-insensitive"))
(hsPkgs."iproute" or (errorHandler.buildDepError "iproute"))
(hsPkgs."clock" or (errorHandler.buildDepError "clock"))
];
buildable = true;
};
};
tests = {
"mateamt-test" = {
depends = [
(hsPkgs."base" or (errorHandler.buildDepError "base"))
(hsPkgs."mateamt" or (errorHandler.buildDepError "mateamt"))
(hsPkgs."text" or (errorHandler.buildDepError "text"))
(hsPkgs."time" or (errorHandler.buildDepError "time"))
(hsPkgs."mtl" or (errorHandler.buildDepError "mtl"))
(hsPkgs."containers" or (errorHandler.buildDepError "containers"))
(hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring"))
(hsPkgs."hspec" or (errorHandler.buildDepError "hspec"))
(hsPkgs."hspec-wai" or (errorHandler.buildDepError "hspec-wai"))
(hsPkgs."hspec-wai-json" or (errorHandler.buildDepError "hspec-wai-json"))
(hsPkgs."warp" or (errorHandler.buildDepError "warp"))
(hsPkgs."wai" or (errorHandler.buildDepError "wai"))
(hsPkgs."pg-transact" or (errorHandler.buildDepError "pg-transact"))
(hsPkgs."tmp-postgres" or (errorHandler.buildDepError "tmp-postgres"))
(hsPkgs."resource-pool" or (errorHandler.buildDepError "resource-pool"))
(hsPkgs."postgresql-simple" or (errorHandler.buildDepError "postgresql-simple"))
];
build-tools = [
(hsPkgs.buildPackages.hspec-discover.components.exes.hspec-discover or (pkgs.buildPackages.hspec-discover or (errorHandler.buildToolDepError "hspec-discover:hspec-discover")))
];
buildable = true;
};
};
};
} // rec { src = (pkgs.lib).mkDefault .././../.; }

15
nix/default.nix Normal file
View file

@ -0,0 +1,15 @@
{ haskellNixSrc ? builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz
, haskellNix ? import haskellNixSrc {}
, nixpkgs ? haskellNix.sources.nixpkgs }:
let
pkgs = import nixpkgs haskellNix.nixpkgsArgs;
pkgSet = pkgs.haskell-nix.mkCabalProjectPkgSet {
plan-pkgs = import ./pkgs.nix;
pkg-def-extras = [];
modules = [];
};
in
pkgSet.config.hsPkgs

395
nix/pkgs.nix Normal file
View file

@ -0,0 +1,395 @@
{
pkgs = hackage:
{
packages = {
"warp".revision = (((hackage."warp")."3.3.13").revisions).default;
"postgresql-simple-migration".revision = (((hackage."postgresql-simple-migration")."0.1.15.0").revisions).default;
"cookie".revision = (((hackage."cookie")."0.4.5").revisions).default;
"void".revision = (((hackage."void")."0.7.3").revisions).default;
"byteorder".revision = (((hackage."byteorder")."1.0.4").revisions).default;
"singleton-bool".revision = (((hackage."singleton-bool")."0.1.5").revisions).default;
"tf-random".revision = (((hackage."tf-random")."0.5").revisions).default;
"Only".revision = (((hackage."Only")."0.1").revisions).default;
"cereal".revision = (((hackage."cereal")."0.5.8.1").revisions).default;
"exceptions".revision = (((hackage."exceptions")."0.10.4").revisions).default;
"binary".revision = (((hackage."binary")."0.8.8.0").revisions).default;
"attoparsec-iso8601".revision = (((hackage."attoparsec-iso8601")."1.0.2.0").revisions).default;
"product-profunctors".revision = (((hackage."product-profunctors")."0.11.0.1").revisions).default;
"ghc-prim".revision = (((hackage."ghc-prim")."0.6.1").revisions).default;
"utf8-string".revision = (((hackage."utf8-string")."1.0.2").revisions).default;
"hspec-wai".revision = (((hackage."hspec-wai")."0.11.0").revisions).default;
"old-time".revision = (((hackage."old-time")."1.1.0.3").revisions).default;
"bifunctors".revision = (((hackage."bifunctors")."5.5.10").revisions).default;
"hspec-wai-json".revision = (((hackage."hspec-wai-json")."0.11.0").revisions).default;
"extra".revision = (((hackage."extra")."1.7.9").revisions).default;
"split".revision = (((hackage."split")."0.2.3.4").revisions).default;
"data-fix".revision = (((hackage."data-fix")."0.3.0").revisions).default;
"stm".revision = (((hackage."stm")."2.5.0.0").revisions).default;
"dec".revision = (((hackage."dec")."0.0.3").revisions).default;
"unix-time".revision = (((hackage."unix-time")."0.4.7").revisions).default;
"http2".revision = (((hackage."http2")."2.0.5").revisions).default;
"base-compat-batteries".revision = (((hackage."base-compat-batteries")."0.11.2").revisions).default;
"appar".revision = (((hackage."appar")."0.1.8").revisions).default;
"hourglass".revision = (((hackage."hourglass")."0.2.12").revisions).default;
"case-insensitive".revision = (((hackage."case-insensitive")."1.2.1.0").revisions).default;
"network-byte-order".revision = (((hackage."network-byte-order")."0.1.6").revisions).default;
"sop-core".revision = (((hackage."sop-core")."0.5.0.1").revisions).default;
"unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
"mtl".revision = (((hackage."mtl")."2.2.2").revisions).default;
"network-uri".revision = (((hackage."network-uri")."2.6.3.0").revisions).default;
"network-info".revision = (((hackage."network-info")."0.2.0.10").revisions).default;
"asn1-parse".revision = (((hackage."asn1-parse")."0.9.5").revisions).default;
"servant-rawm-server".revision = (((hackage."servant-rawm-server")."1.0.0.1").revisions).default;
"zlib".revision = (((hackage."zlib")."0.6.2.2").revisions).default;
"rts".revision = (((hackage."rts")."1.0").revisions).default;
"mmorph".revision = (((hackage."mmorph")."1.1.3").revisions).default;
"easy-file".revision = (((hackage."easy-file")."0.2.2").revisions).default;
"servant-rawm".revision = (((hackage."servant-rawm")."1.0.0.0").revisions).default;
"th-expand-syns".revision = (((hackage."th-expand-syns")."0.4.6.0").revisions).default;
"cryptonite".revision = (((hackage."cryptonite")."0.28").revisions).default;
"postgresql-simple".revision = (((hackage."postgresql-simple")."0.6.4").revisions).default;
"clock".revision = (((hackage."clock")."0.8.2").revisions).default;
"safe-exceptions".revision = (((hackage."safe-exceptions")."0.1.7.1").revisions).default;
"cryptohash-md5".revision = (((hackage."cryptohash-md5")."0.11.100.1").revisions).default;
"th-orphans".revision = (((hackage."th-orphans")."0.13.11").revisions).default;
"pem".revision = (((hackage."pem")."0.2.4").revisions).default;
"http-api-data".revision = (((hackage."http-api-data")."0.4.2").revisions).default;
"syb".revision = (((hackage."syb")."0.7.2.1").revisions).default;
"token-bucket".revision = (((hackage."token-bucket")."0.1.0.1").revisions).default;
"distributive".revision = (((hackage."distributive")."0.6.2.1").revisions).default;
"asn1-encoding".revision = (((hackage."asn1-encoding")."0.9.6").revisions).default;
"bytestring-builder".revision = (((hackage."bytestring-builder")."0.10.8.2.0").revisions).default;
"QuickCheck".revision = (((hackage."QuickCheck")."2.14.2").revisions).default;
"scientific".revision = (((hackage."scientific")."0.3.6.2").revisions).default;
"time-manager".revision = (((hackage."time-manager")."0.0.0").revisions).default;
"hspec-discover".revision = (((hackage."hspec-discover")."2.7.8").revisions).default;
"aeson-qq".revision = (((hackage."aeson-qq")."0.8.3").revisions).default;
"deepseq".revision = (((hackage."deepseq")."1.4.4.0").revisions).default;
"haskell-src-meta".revision = (((hackage."haskell-src-meta")."0.8.5").revisions).default;
"random".revision = (((hackage."random")."1.1").revisions).default;
"temporary".revision = (((hackage."temporary")."1.3").revisions).default;
"opaleye".revision = (((hackage."opaleye")."0.7.1.0").revisions).default;
"uuid-types".revision = (((hackage."uuid-types")."1.0.3").revisions).default;
"string-conversions".revision = (((hackage."string-conversions")."0.4.0.1").revisions).default;
"optparse-applicative".revision = (((hackage."optparse-applicative")."0.16.1.0").revisions).default;
"network".revision = (((hackage."network")."3.1.2.1").revisions).default;
"word8".revision = (((hackage."word8")."0.1.3").revisions).default;
"crypto-api".revision = (((hackage."crypto-api")."0.13.3").revisions).default;
"splitmix".revision = (((hackage."splitmix")."0.1.0.3").revisions).default;
"async".revision = (((hackage."async")."2.2.2").revisions).default;
"dlist".revision = (((hackage."dlist")."1.0").revisions).default;
"postgres-options".revision = (((hackage."postgres-options")."0.2.0.0").revisions).default;
"semigroups".revision = (((hackage."semigroups")."0.19.1").revisions).default;
"HUnit".revision = (((hackage."HUnit")."1.6.2.0").revisions).default;
"pureMD5".revision = (((hackage."pureMD5")."2.1.3").revisions).default;
"parsec".revision = (((hackage."parsec")."3.1.14.0").revisions).default;
"th-reify-many".revision = (((hackage."th-reify-many")."0.1.9").revisions).default;
"http-media".revision = (((hackage."http-media")."0.8.0.0").revisions).default;
"directory".revision = (((hackage."directory")."1.3.6.0").revisions).default;
"transformers-compat".revision = (((hackage."transformers-compat")."0.6.6").revisions).default;
"template-haskell".revision = (((hackage."template-haskell")."2.16.0.0").revisions).default;
"hspec-expectations".revision = (((hackage."hspec-expectations")."0.8.2").revisions).default;
"psqueues".revision = (((hackage."psqueues")."0.2.7.2").revisions).default;
"vector".revision = (((hackage."vector")."0.12.2.0").revisions).default;
"call-stack".revision = (((hackage."call-stack")."0.3.0").revisions).default;
"primitive".revision = (((hackage."primitive")."0.7.1.0").revisions).default;
"cryptohash".revision = (((hackage."cryptohash")."0.11.9").revisions).default;
"profunctors".revision = (((hackage."profunctors")."5.6.1").revisions).default;
"time-locale-compat".revision = (((hackage."time-locale-compat")."0.1.1.5").revisions).default;
"safe".revision = (((hackage."safe")."0.3.19").revisions).default;
"blaze-builder".revision = (((hackage."blaze-builder")."0.4.2.1").revisions).default;
"base-compat".revision = (((hackage."base-compat")."0.11.2").revisions).default;
"math-functions".revision = (((hackage."math-functions")."0.3.4.1").revisions).default;
"uri-bytestring".revision = (((hackage."uri-bytestring")."0.3.3.0").revisions).default;
"time-compat".revision = (((hackage."time-compat")."1.9.5").revisions).default;
"cache".revision = (((hackage."cache")."0.1.3.0").revisions).default;
"ansi-terminal".revision = (((hackage."ansi-terminal")."0.11").revisions).default;
"tagged".revision = (((hackage."tagged")."0.8.6.1").revisions).default;
"x509".revision = (((hackage."x509")."1.7.5").revisions).default;
"haskell-src-exts".revision = (((hackage."haskell-src-exts")."1.23.1").revisions).default;
"unliftio-core".revision = (((hackage."unliftio-core")."0.2.0.1").revisions).default;
"containers".revision = (((hackage."containers")."0.6.2.1").revisions).default;
"integer-logarithms".revision = (((hackage."integer-logarithms")."1.0.3.1").revisions).default;
"these".revision = (((hackage."these")."1.1.1.1").revisions).default;
"tmp-postgres".revision = (((hackage."tmp-postgres")."1.34.1.0").revisions).default;
"streaming-commons".revision = (((hackage."streaming-commons")."0.2.2.1").revisions).default;
"bytestring".revision = (((hackage."bytestring")."0.10.12.0").revisions).default;
"ansi-wl-pprint".revision = (((hackage."ansi-wl-pprint")."0.6.9").revisions).default;
"mwc-random".revision = (((hackage."mwc-random")."0.14.0.0").revisions).default;
"wai".revision = (((hackage."wai")."3.2.3").revisions).default;
"basement".revision = (((hackage."basement")."0.0.11").revisions).default;
"setenv".revision = (((hackage."setenv")."0.1.1.3").revisions).default;
"cryptohash-sha1".revision = (((hackage."cryptohash-sha1")."0.11.100.1").revisions).default;
"old-locale".revision = (((hackage."old-locale")."1.0.0.7").revisions).default;
"StateVar".revision = (((hackage."StateVar")."1.2.1").revisions).default;
"vault".revision = (((hackage."vault")."0.3.1.4").revisions).default;
"mime-types".revision = (((hackage."mime-types")."0.1.0.9").revisions).default;
"pcg-random".revision = (((hackage."pcg-random")."0.1.3.7").revisions).default;
"contravariant".revision = (((hackage."contravariant")."1.5.3").revisions).default;
"generic-monoid".revision = (((hackage."generic-monoid")."0.1.0.1").revisions).default;
"HsYAML".revision = (((hackage."HsYAML")."0.2.1.0").revisions).default;
"indexed-traversable".revision = (((hackage."indexed-traversable")."0.1.1").revisions).default;
"blaze-markup".revision = (((hackage."blaze-markup")."0.8.2.7").revisions).default;
"postgresql-libpq".revision = (((hackage."postgresql-libpq")."0.9.4.3").revisions).default;
"uuid".revision = (((hackage."uuid")."1.3.13").revisions).default;
"text".revision = (((hackage."text")."1.2.4.1").revisions).default;
"assoc".revision = (((hackage."assoc")."1.0.2").revisions).default;
"unordered-containers".revision = (((hackage."unordered-containers")."0.2.13.0").revisions).default;
"base64-bytestring".revision = (((hackage."base64-bytestring")."1.0.0.3").revisions).default;
"base".revision = (((hackage."base")."4.14.1.0").revisions).default;
"comonad".revision = (((hackage."comonad")."5.0.8").revisions).default;
"hspec".revision = (((hackage."hspec")."2.7.8").revisions).default;
"time".revision = (((hackage."time")."1.9.3").revisions).default;
"th-compat".revision = (((hackage."th-compat")."0.1").revisions).default;
"data-default-class".revision = (((hackage."data-default-class")."0.1.2.0").revisions).default;
"base16-bytestring".revision = (((hackage."base16-bytestring")."1.0.1.0").revisions).default;
"iproute".revision = (((hackage."iproute")."1.7.10").revisions).default;
"transformers".revision = (((hackage."transformers")."0.5.6.2").revisions).default;
"hashable".revision = (((hackage."hashable")."1.3.0.0").revisions).default;
"quickcheck-io".revision = (((hackage."quickcheck-io")."0.2.0").revisions).default;
"wai-extra".revision = (((hackage."wai-extra")."3.1.6").revisions).default;
"attoparsec".revision = (((hackage."attoparsec")."0.13.2.4").revisions).default;
"blaze-html".revision = (((hackage."blaze-html")."0.9.1.2").revisions).default;
"colour".revision = (((hackage."colour")."2.3.5").revisions).default;
"transformers-base".revision = (((hackage."transformers-base")."0.4.5.2").revisions).default;
"file-embed".revision = (((hackage."file-embed")."0.0.13.0").revisions).default;
"byteable".revision = (((hackage."byteable")."0.1.1").revisions).default;
"strict".revision = (((hackage."strict")."0.4.0.1").revisions).default;
"entropy".revision = (((hackage."entropy")."0.4.1.6").revisions).default;
"wai-middleware-throttle".revision = (((hackage."wai-middleware-throttle")."0.3.0.1").revisions).default;
"filepath".revision = (((hackage."filepath")."1.4.2.1").revisions).default;
"auto-update".revision = (((hackage."auto-update")."0.1.6").revisions).default;
"resource-pool".revision = (((hackage."resource-pool")."0.2.3.2").revisions).default;
"asn1-types".revision = (((hackage."asn1-types")."0.3.4").revisions).default;
"port-utils".revision = (((hackage."port-utils")."0.2.1.0").revisions).default;
"hspec-core".revision = (((hackage."hspec-core")."2.7.8").revisions).default;
"unix-compat".revision = (((hackage."unix-compat")."0.5.3").revisions).default;
"monad-control".revision = (((hackage."monad-control")."1.0.2.3").revisions).default;
"process".revision = (((hackage."process")."1.6.9.0").revisions).default;
"pg-transact".revision = (((hackage."pg-transact")."0.3.1.1").revisions).default;
"wai-logger".revision = (((hackage."wai-logger")."2.3.6").revisions).default;
"th-lift".revision = (((hackage."th-lift")."0.8.2").revisions).default;
"resourcet".revision = (((hackage."resourcet")."1.2.4.2").revisions).default;
"pretty".revision = (((hackage."pretty")."1.1.3.6").revisions).default;
"aeson".revision = (((hackage."aeson")."1.5.5.1").revisions).default;
"wai-app-static".revision = (((hackage."wai-app-static")."3.1.7.2").revisions).default;
"http-types".revision = (((hackage."http-types")."0.12.3").revisions).default;
"ghc-boot-th".revision = (((hackage."ghc-boot-th")."8.10.3").revisions).default;
"th-lift-instances".revision = (((hackage."th-lift-instances")."0.1.18").revisions).default;
"servant-server".revision = (((hackage."servant-server")."0.18.2").revisions).default;
"base-orphans".revision = (((hackage."base-orphans")."0.8.4").revisions).default;
"http-date".revision = (((hackage."http-date")."0.0.10").revisions).default;
"random-bytestring".revision = (((hackage."random-bytestring")."0.1.3.2").revisions).default;
"servant".revision = (((hackage."servant")."0.18.2").revisions).default;
"th-abstraction".revision = (((hackage."th-abstraction")."0.4.2.0").revisions).default;
"memory".revision = (((hackage."memory")."0.15.0").revisions).default;
"fast-logger".revision = (((hackage."fast-logger")."3.0.2").revisions).default;
"bsb-http-chunked".revision = (((hackage."bsb-http-chunked")."0.0.0.4").revisions).default;
"array".revision = (((hackage."array")."0.5.4.0").revisions).default;
"simple-sendfile".revision = (((hackage."simple-sendfile")."0.2.30").revisions).default;
"integer-gmp".revision = (((hackage."integer-gmp")."1.0.3.0").revisions).default;
};
compiler = {
version = "8.10.3";
nix-name = "ghc8103";
packages = {
"warp" = "3.3.13";
"postgresql-simple-migration" = "0.1.15.0";
"cookie" = "0.4.5";
"void" = "0.7.3";
"byteorder" = "1.0.4";
"singleton-bool" = "0.1.5";
"tf-random" = "0.5";
"Only" = "0.1";
"cereal" = "0.5.8.1";
"exceptions" = "0.10.4";
"binary" = "0.8.8.0";
"attoparsec-iso8601" = "1.0.2.0";
"product-profunctors" = "0.11.0.1";
"ghc-prim" = "0.6.1";
"utf8-string" = "1.0.2";
"hspec-wai" = "0.11.0";
"old-time" = "1.1.0.3";
"bifunctors" = "5.5.10";
"hspec-wai-json" = "0.11.0";
"extra" = "1.7.9";
"split" = "0.2.3.4";
"data-fix" = "0.3.0";
"stm" = "2.5.0.0";
"dec" = "0.0.3";
"unix-time" = "0.4.7";
"http2" = "2.0.5";
"base-compat-batteries" = "0.11.2";
"appar" = "0.1.8";
"hourglass" = "0.2.12";
"case-insensitive" = "1.2.1.0";
"network-byte-order" = "0.1.6";
"sop-core" = "0.5.0.1";
"unix" = "2.7.2.2";
"mtl" = "2.2.2";
"network-uri" = "2.6.3.0";
"network-info" = "0.2.0.10";
"asn1-parse" = "0.9.5";
"servant-rawm-server" = "1.0.0.1";
"zlib" = "0.6.2.2";
"rts" = "1.0";
"mmorph" = "1.1.3";
"easy-file" = "0.2.2";
"servant-rawm" = "1.0.0.0";
"th-expand-syns" = "0.4.6.0";
"cryptonite" = "0.28";
"postgresql-simple" = "0.6.4";
"clock" = "0.8.2";
"safe-exceptions" = "0.1.7.1";
"cryptohash-md5" = "0.11.100.1";
"th-orphans" = "0.13.11";
"pem" = "0.2.4";
"http-api-data" = "0.4.2";
"syb" = "0.7.2.1";
"token-bucket" = "0.1.0.1";
"distributive" = "0.6.2.1";
"asn1-encoding" = "0.9.6";
"bytestring-builder" = "0.10.8.2.0";
"QuickCheck" = "2.14.2";
"scientific" = "0.3.6.2";
"time-manager" = "0.0.0";
"hspec-discover" = "2.7.8";
"aeson-qq" = "0.8.3";
"deepseq" = "1.4.4.0";
"haskell-src-meta" = "0.8.5";
"random" = "1.1";
"temporary" = "1.3";
"opaleye" = "0.7.1.0";
"uuid-types" = "1.0.3";
"string-conversions" = "0.4.0.1";
"optparse-applicative" = "0.16.1.0";
"network" = "3.1.2.1";
"word8" = "0.1.3";
"crypto-api" = "0.13.3";
"splitmix" = "0.1.0.3";
"async" = "2.2.2";
"dlist" = "1.0";
"postgres-options" = "0.2.0.0";
"semigroups" = "0.19.1";
"HUnit" = "1.6.2.0";
"pureMD5" = "2.1.3";
"parsec" = "3.1.14.0";
"th-reify-many" = "0.1.9";
"http-media" = "0.8.0.0";
"directory" = "1.3.6.0";
"transformers-compat" = "0.6.6";
"template-haskell" = "2.16.0.0";
"hspec-expectations" = "0.8.2";
"psqueues" = "0.2.7.2";
"vector" = "0.12.2.0";
"call-stack" = "0.3.0";
"primitive" = "0.7.1.0";
"cryptohash" = "0.11.9";
"profunctors" = "5.6.1";
"time-locale-compat" = "0.1.1.5";
"safe" = "0.3.19";
"blaze-builder" = "0.4.2.1";
"base-compat" = "0.11.2";
"math-functions" = "0.3.4.1";
"uri-bytestring" = "0.3.3.0";
"time-compat" = "1.9.5";
"cache" = "0.1.3.0";
"ansi-terminal" = "0.11";
"tagged" = "0.8.6.1";
"x509" = "1.7.5";
"haskell-src-exts" = "1.23.1";
"unliftio-core" = "0.2.0.1";
"containers" = "0.6.2.1";
"integer-logarithms" = "1.0.3.1";
"these" = "1.1.1.1";
"tmp-postgres" = "1.34.1.0";
"streaming-commons" = "0.2.2.1";
"bytestring" = "0.10.12.0";
"ansi-wl-pprint" = "0.6.9";
"mwc-random" = "0.14.0.0";
"wai" = "3.2.3";
"basement" = "0.0.11";
"setenv" = "0.1.1.3";
"cryptohash-sha1" = "0.11.100.1";
"old-locale" = "1.0.0.7";
"StateVar" = "1.2.1";
"vault" = "0.3.1.4";
"mime-types" = "0.1.0.9";
"pcg-random" = "0.1.3.7";
"contravariant" = "1.5.3";
"generic-monoid" = "0.1.0.1";
"HsYAML" = "0.2.1.0";
"indexed-traversable" = "0.1.1";
"blaze-markup" = "0.8.2.7";
"postgresql-libpq" = "0.9.4.3";
"uuid" = "1.3.13";
"text" = "1.2.4.1";
"assoc" = "1.0.2";
"unordered-containers" = "0.2.13.0";
"base64-bytestring" = "1.0.0.3";
"base" = "4.14.1.0";
"comonad" = "5.0.8";
"hspec" = "2.7.8";
"time" = "1.9.3";
"th-compat" = "0.1";
"data-default-class" = "0.1.2.0";
"base16-bytestring" = "1.0.1.0";
"iproute" = "1.7.10";
"transformers" = "0.5.6.2";
"hashable" = "1.3.0.0";
"quickcheck-io" = "0.2.0";
"wai-extra" = "3.1.6";
"attoparsec" = "0.13.2.4";
"blaze-html" = "0.9.1.2";
"colour" = "2.3.5";
"transformers-base" = "0.4.5.2";
"file-embed" = "0.0.13.0";
"byteable" = "0.1.1";
"strict" = "0.4.0.1";
"entropy" = "0.4.1.6";
"wai-middleware-throttle" = "0.3.0.1";
"filepath" = "1.4.2.1";
"auto-update" = "0.1.6";
"resource-pool" = "0.2.3.2";
"asn1-types" = "0.3.4";
"port-utils" = "0.2.1.0";
"hspec-core" = "2.7.8";
"unix-compat" = "0.5.3";
"monad-control" = "1.0.2.3";
"process" = "1.6.9.0";
"pg-transact" = "0.3.1.1";
"wai-logger" = "2.3.6";
"th-lift" = "0.8.2";
"resourcet" = "1.2.4.2";
"pretty" = "1.1.3.6";
"aeson" = "1.5.5.1";
"wai-app-static" = "3.1.7.2";
"http-types" = "0.12.3";
"ghc-boot-th" = "8.10.3";
"th-lift-instances" = "0.1.18";
"servant-server" = "0.18.2";
"base-orphans" = "0.8.4";
"http-date" = "0.0.10";
"random-bytestring" = "0.1.3.2";
"servant" = "0.18.2";
"th-abstraction" = "0.4.2.0";
"memory" = "0.15.0";
"fast-logger" = "3.0.2";
"bsb-http-chunked" = "0.0.0.4";
"array" = "0.5.4.0";
"simple-sendfile" = "0.2.30";
"integer-gmp" = "1.0.3.0";
};
};
};
extras = hackage:
{ packages = { mateamt = ./.plan.nix/mateamt.nix; }; };
modules = [
({ lib, ... }:
{
packages = {
"mateamt" = { flags = { "develop" = lib.mkOverride 900 false; }; };
};
})
];
}

38
nix/sources.json Normal file
View file

@ -0,0 +1,38 @@
{
"haskellNix": {
"branch": "master",
"description": "Alternative Haskell Infrastructure for Nixpkgs",
"homepage": "https://input-output-hk.github.io/haskell.nix",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "70e3bc77ce844b59e235e5ae48364862f1b229b2",
"sha256": "0pmmr85xpx3ciwra8gxg6qh5vrg925wbwzgc820f3rn989xc1c72",
"type": "tarball",
"url": "https://github.com/input-output-hk/haskell.nix/archive/70e3bc77ce844b59e235e5ae48364862f1b229b2.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
"branch": "master",
"description": "Easy dependency management for Nix projects",
"homepage": "https://github.com/nmattia/niv",
"owner": "nmattia",
"repo": "niv",
"rev": "1819632b5823e0527da28ad82fecd6be5136c1e9",
"sha256": "08jz17756qchq0zrqmapcm33nr4ms9f630mycc06i6zkfwl5yh5i",
"type": "tarball",
"url": "https://github.com/nmattia/niv/archive/1819632b5823e0527da28ad82fecd6be5136c1e9.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-21.05",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "43e16aa54fd8d73553f210b1be3d63ec1ee43f2c",
"sha256": "026bcvkmnph9wsjjpb6bwllcf445310infwg61givhz0y5hjdxfx",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/43e16aa54fd8d73553f210b1be3d63ec1ee43f2c.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

174
nix/sources.nix Normal file
View file

@ -0,0 +1,174 @@
# This file has been generated by Niv.
let
#
# The fetchers. fetch_<type> fetches specs of type <type>.
#
fetch_file = pkgs: name: spec:
let
name' = sanitizeName name + "-src";
in
if spec.builtin or true then
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
else
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
fetch_tarball = pkgs: name: spec:
let
name' = sanitizeName name + "-src";
in
if spec.builtin or true then
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
else
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
fetch_git = name: spec:
let
ref =
if spec ? ref then spec.ref else
if spec ? branch then "refs/heads/${spec.branch}" else
if spec ? tag then "refs/tags/${spec.tag}" else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
in
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
fetch_local = spec: spec.path;
fetch_builtin-tarball = name: throw
''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
$ niv modify ${name} -a type=tarball -a builtin=true'';
fetch_builtin-url = name: throw
''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
$ niv modify ${name} -a type=file -a builtin=true'';
#
# Various helpers
#
# https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
sanitizeName = name:
(
concatMapStrings (s: if builtins.isList s then "-" else s)
(
builtins.split "[^[:alnum:]+._?=-]+"
((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
)
);
# The set of packages used when specs are fetched using non-builtins.
mkPkgs = sources: system:
let
sourcesNixpkgs =
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
in
if builtins.hasAttr "nixpkgs" sources
then sourcesNixpkgs
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
import <nixpkgs> {}
else
abort
''
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
add a package called "nixpkgs" to your sources.json.
'';
# The actual fetching function.
fetch = pkgs: name: spec:
if ! builtins.hasAttr "type" spec then
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
else if spec.type == "file" then fetch_file pkgs name spec
else if spec.type == "tarball" then fetch_tarball pkgs name spec
else if spec.type == "git" then fetch_git name spec
else if spec.type == "local" then fetch_local spec
else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
else if spec.type == "builtin-url" then fetch_builtin-url name
else
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
# If the environment variable NIV_OVERRIDE_${name} is set, then use
# the path directly as opposed to the fetched source.
replace = name: drv:
let
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
in
if ersatz == "" then drv else
# this turns the string into an actual Nix path (for both absolute and
# relative paths)
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
# Ports of functions for older nix versions
# a Nix version of mapAttrs if the built-in doesn't exist
mapAttrs = builtins.mapAttrs or (
f: set: with builtins;
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
concatMapStrings = f: list: concatStrings (map f list);
concatStrings = builtins.concatStringsSep "";
# https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
optionalAttrs = cond: as: if cond then as else {};
# fetchTarball version that is compatible between all the versions of Nix
builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
let
inherit (builtins) lessThan nixVersion fetchTarball;
in
if lessThan nixVersion "1.12" then
fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
else
fetchTarball attrs;
# fetchurl version that is compatible between all the versions of Nix
builtins_fetchurl = { url, name ? null, sha256 }@attrs:
let
inherit (builtins) lessThan nixVersion fetchurl;
in
if lessThan nixVersion "1.12" then
fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
else
fetchurl attrs;
# Create the final "sources" from the config
mkSources = config:
mapAttrs (
name: spec:
if builtins.hasAttr "outPath" spec
then abort
"The values in sources.json should not have an 'outPath' attribute"
else
spec // { outPath = replace name (fetch config.pkgs name spec); }
) config.sources;
# The "config" used by the fetchers
mkConfig =
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
, system ? builtins.currentSystem
, pkgs ? mkPkgs sources system
}: rec {
# The sources, i.e. the attribute set of spec name to spec
inherit sources;
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
inherit pkgs;
};
in
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }

37
shell.nix Normal file
View file

@ -0,0 +1,37 @@
let
project = import ./default.nix;
in
project.shellFor {
# ALL of these arguments are optional.
# List of packages from the project you want to work on in
# the shell (default is all the projects local packages).
#packages = ps: with ps; [
#];
# Builds a Hoogle documentation index of all dependencies,
# and provides a "hoogle" command to search the index.
withHoogle = true;
# Some common tools can be added with the `tools` argument
tools = {
cabal = "latest"; # Selects the latest version in the hackage.nix snapshot
hlint = "latest"; # Selects the latest version in the hackage.nix snapshot
haskell-language-server = "latest";
hspec-discover = "latest";
};
# See overlays/tools.nix for more details
# Some you may need to get some other way.
buildInputs = [ (import <nixpkgs> {}).git ];
# Sellect cross compilers to include.
crossPlatforms = ps: with ps; [
#ghcjs # Adds support for `js-unknown-ghcjs-cabal build` in the shell
# mingwW64 # Adds support for `x86_64-W64-mingw32-cabal build` in the shell
];
# Prevents cabal from choosing alternate plans, so that
# *all* dependencies are provided by Nix.
exactDeps = false;
}