diff --git a/.gitlab-ci.dhall b/.gitlab-ci.dhall new file mode 100644 index 0000000000000000000000000000000000000000..a5367abe8ed5c35d875ddb571073af839ec5d92a --- /dev/null +++ b/.gitlab-ci.dhall @@ -0,0 +1,47 @@ +let Prelude = + env:DHALL_PRELUDE + ? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v20.1.0/Prelude/package.dhall + sha256:26b0ef498663d269e4dc6a82b0ee289ec565d683ef4c00d0ebdd25333a5a3c98 + +let HsSrc = + < FromHackage : { name : Text, version : Text } + | FromGit : + { url : Text, revision : Optional Text, subdir : Optional Text } + > + +let Modifiers = + { Type = { doJailbreak : Bool, doCheck : Bool } + , default = { doJailbreak = True, doCheck = False } + } + +let Attr = λ(a : Type) → { mapKey : Text, mapValue : a } + +let HsPkg = {source : HsSrc, modifiers : Modifiers.Type } + +let Attr + : ∀(x : Type) → Type + = λ(x : Type) → { mapKey : Text, mapValue : x } + +let Step = { script : List Text } + +let toStep + : ∀(id : Text) → ∀(prefix : Text) → ∀(x : Text) → Attr Step + = λ(id : Text) → + λ(prefix : Text) → + λ(x : Text) → + { mapKey = id + , mapValue.script = [ "nix build -L .#${prefix}.${x}" ] + } + +let input = Prelude.Map.keys Text HsPkg ./manifest.dhall + +let packages = + Prelude.List.map + (Text) + (Attr Step) + ( λ(x : Text) → + toStep "Package ${x}" "packages.x86_64-linux" x + ) + (input : List Text) + +in packages diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3cb0d50f283c76377693b3c2be23904d8de583a7..b4eda7ea91a079ca824ac2388609072ebf09da1b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: generate-flake-ci: stage: generate - script: nix run "git+https://gitlab.homotopic.tech/haskell/flake-to-gitlab-ci" > flake-ci.yml + script: nix run ".#horizon-gen-gitlab-ci" > flake-ci.yml artifacts: paths: - flake-ci.yml diff --git a/flake.nix b/flake.nix index 035c02125b133a6fd34eb8089f4027a7533d83b8..f113f3eb0834cad59e55e32037e2e3365cb4273c 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,7 @@ && v.type == "derivation" && v.meta.broken == false) hp; + horizon-gen-gitlab-ci = pkgs.writers.writeBashBin "gen-gitlab-ci" "${pkgs.dhall-json}/bin/dhall-to-yaml --file .gitlab-ci.dhall"; in { apps = { @@ -26,6 +27,10 @@ type = "app"; program = "${hp.horizon-gen-nix}/bin/horizon-gen-nix"; }; + horizon-gen-gitlab-ci = { + type = "app"; + program = "${horizon-gen-gitlab-ci}/bin/gen-gitlab-ci"; + }; }; checks = { dhall-format = lint-utils.outputs.linters.x86_64-linux.dhall-format ./.; diff --git a/manifest.dhall b/manifest.dhall index 9dbbf1fa5699d158d4b820e8d04bdead40fb6bec..bf60fe8a8415732ceeb78470bf1b0cf32dd3ca6a 100644 --- a/manifest.dhall +++ b/manifest.dhall @@ -101,7 +101,11 @@ in [ callHackage "Cabal" "3.8.1.0" , callHackage "co-log-core" "0.3.1.0" , callHackage "comonad" "5.0.8" , callHackage "compact" "0.2.0.0" - , callHackage "compactable" "0.2.0.0" + , callCabal2nix + "compactable" + "https://gitlab.com/fresheyeball/Compactable" + (Some "f63927b1e438c267f0d12f36e5b3735cfaebeeb4") + (None Text) , callHackage "composite-base" "0.8.1.0" , callHackage "composite-cassava" "0.0.3.1" , callHackage "composite-dhall" "0.1.0.1" @@ -247,7 +251,7 @@ in [ callHackage "Cabal" "3.8.1.0" , callCabal2nix "polysemy-plugin" "https://github.com/locallycompact/polysemy" - (Some "5942a398ef02bbbe94bedd68f8628390ed223107") + (Some "bd944ca000c1ca69602d4723e3859af431b9d0c4") (Some "polysemy-plugin") , callHackage "polysemy-several" "0.1.1.0" , callHackage "polysemy-time" "0.5.1.0" @@ -297,9 +301,15 @@ in [ callHackage "Cabal" "3.8.1.0" "https://github.com/TeofilC/servant" (Some "76fc90a51f915230bbe1e0d1dbe9727fcdc7a0fc") (Some "servant-foreign") + , callHackage "servant-lucid" "0.9.0.5" , callHackage "servant-multipart" "0.12.1" , callHackage "servant-multipart-api" "0.12.1" + , callCabal2nix + "servant-server" + "https://github.com/TeofilC/servant" + (Some "76fc90a51f915230bbe1e0d1dbe9727fcdc7a0fc") + (Some "servant-server") , callHackage "shake" "0.19.6" , callHackage "shelly" "1.10.0" , callHackage "singleton-bool" "0.1.6" diff --git a/overlay.nix b/overlay.nix index f0d74d3a60472641e4d349de702f9861ec82bdc4..92cc865ab44d864f34086d7538cc11930077a8f6 100644 --- a/overlay.nix +++ b/overlay.nix @@ -371,6 +371,8 @@ final: prev: with pkgs.haskell.lib; { servant-multipart-api = prev.callPackage (./pkgs/servant-multipart-api.nix) { }; + servant-server = prev.callPackage (./pkgs/servant-server.nix) { }; + shake = prev.callPackage (./pkgs/shake.nix) { }; shelly = prev.callPackage (./pkgs/shelly.nix) { }; diff --git a/pkgs/compactable.nix b/pkgs/compactable.nix index d632014a1a01e5aa555b8d98756521dfaaafc2a5..cf683dea3826136b6e55712c0f217f8d896d707a 100644 --- a/pkgs/compactable.nix +++ b/pkgs/compactable.nix @@ -1,64 +1,26 @@ -{ mkDerivation -, aeson -, base -, base-compat -, bifunctors -, containers -, contravariant -, data-default-class -, deepseq -, genvalidity -, genvalidity-sydtest -, hashable -, keys -, lens -, lib -, QuickCheck -, semigroupoids -, sydtest -, sydtest-discover -, these -, transformers -, transformers-compat -, unordered-containers -, vector -, vector-instances +{ mkDerivation, aeson, base, base-compat, bifunctors, containers +, contravariant, data-default-class, deepseq, fetchgit, hashable +, keys, lens, lib, QuickCheck, semigroupoids, sydtest +, sydtest-discover, these, transformers, transformers-compat +, unordered-containers, vector, vector-instances }: mkDerivation { pname = "compactable"; - version = "0.2.0.0"; - sha256 = "871c6e5a6d0b9a27624a3393a0b048358cf9289b8e35535bb11c469f56cdec59"; + version = "0.2.0.1"; + src = fetchgit { + url = "https://gitlab.com/fresheyeball/Compactable"; + sha256 = "19nqdzaj8x5bnj1h7qng659c3cs9dm4s54bvgvvkgjqq6hs04hjr"; + rev = "f63927b1e438c267f0d12f36e5b3735cfaebeeb4"; + fetchSubmodules = true; + }; libraryHaskellDepends = [ - aeson - base - base-compat - bifunctors - containers - contravariant - data-default-class - deepseq - hashable - keys - lens - QuickCheck - semigroupoids - these - transformers - transformers-compat - unordered-containers - vector - vector-instances + aeson base base-compat bifunctors containers contravariant + data-default-class deepseq hashable keys lens QuickCheck + semigroupoids these transformers transformers-compat + unordered-containers vector vector-instances ]; testHaskellDepends = [ - base - containers - genvalidity - genvalidity-sydtest - QuickCheck - sydtest - sydtest-discover - these - vector + base containers QuickCheck sydtest sydtest-discover these vector ]; doHaddock = false; jailbreak = true; @@ -66,4 +28,4 @@ mkDerivation { hyperlinkSource = false; description = "A typeclass for structures which can be catMaybed, filtered, and partitioned"; license = lib.licenses.bsd3; -} +} \ No newline at end of file diff --git a/pkgs/polysemy-plugin.nix b/pkgs/polysemy-plugin.nix index cd26b0b8773d4aba6527263eb1256d53ce84cf3e..d46efadb9946053b870ab439921f0c1b8d1cf51a 100644 --- a/pkgs/polysemy-plugin.nix +++ b/pkgs/polysemy-plugin.nix @@ -1,53 +1,25 @@ -{ mkDerivation -, base -, Cabal -, cabal-doctest -, containers -, doctest -, fetchgit -, ghc -, ghc-tcplugins-extra -, hspec -, hspec-discover -, inspection-testing -, lib -, polysemy -, should-not-typecheck -, syb +{ mkDerivation, base, Cabal, cabal-doctest, containers, doctest +, fetchgit, ghc, ghc-tcplugins-extra, hspec, hspec-discover +, inspection-testing, lib, polysemy, should-not-typecheck, syb , transformers }: mkDerivation { pname = "polysemy-plugin"; - version = "0.4.0.0"; + version = "0.4.3.1"; src = fetchgit { url = "https://github.com/locallycompact/polysemy"; - sha256 = "0g75az24xc0694hakmkfwxmwd6bm79v48j42yjibiixy14dj1d5g"; - rev = "5942a398ef02bbbe94bedd68f8628390ed223107"; + sha256 = "1sy2jmwcg9aw4a6rji36djhkxhxnh50pqhaa3jhjfv2dsw652bcz"; + rev = "bd944ca000c1ca69602d4723e3859af431b9d0c4"; fetchSubmodules = true; }; postUnpack = "sourceRoot+=/polysemy-plugin/; echo source root reset to $sourceRoot"; setupHaskellDepends = [ base Cabal cabal-doctest ]; libraryHaskellDepends = [ - base - containers - ghc - ghc-tcplugins-extra - polysemy - syb - transformers + base containers ghc ghc-tcplugins-extra polysemy syb transformers ]; testHaskellDepends = [ - base - containers - doctest - ghc - ghc-tcplugins-extra - hspec - inspection-testing - polysemy - should-not-typecheck - syb - transformers + base containers doctest ghc ghc-tcplugins-extra hspec + inspection-testing polysemy should-not-typecheck syb transformers ]; testToolDepends = [ hspec-discover ]; doHaddock = false; @@ -57,4 +29,4 @@ mkDerivation { homepage = "https://github.com/polysemy-research/polysemy#readme"; description = "Disambiguate obvious uses of effects"; license = lib.licenses.bsd3; -} +} \ No newline at end of file diff --git a/pkgs/servant-server.nix b/pkgs/servant-server.nix new file mode 100644 index 0000000000000000000000000000000000000000..ce1b1603e134ba1342ac2d9531f26157cadec4f0 --- /dev/null +++ b/pkgs/servant-server.nix @@ -0,0 +1,47 @@ +{ mkDerivation, aeson, base, base-compat, base64-bytestring +, bytestring, constraints, containers, directory, exceptions +, fetchgit, filepath, hspec, hspec-discover, hspec-wai +, http-api-data, http-media, http-types, lib, monad-control, mtl +, network, network-uri, QuickCheck, resourcet, safe, servant +, should-not-typecheck, sop-core, string-conversions, tagged +, temporary, text, transformers, transformers-base +, transformers-compat, wai, wai-app-static, wai-extra, warp, word8 +}: +mkDerivation { + pname = "servant-server"; + version = "0.19.1"; + src = fetchgit { + url = "https://github.com/TeofilC/servant"; + sha256 = "0f6vkm44p93ln63plk4vfavadcgxjiqr8xncxrjqzp2mcql6qdmh"; + rev = "76fc90a51f915230bbe1e0d1dbe9727fcdc7a0fc"; + fetchSubmodules = true; + }; + postUnpack = "sourceRoot+=/servant-server/; echo source root reset to $sourceRoot"; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + base base-compat base64-bytestring bytestring constraints + containers exceptions filepath http-api-data http-media http-types + monad-control mtl network network-uri resourcet servant sop-core + string-conversions tagged text transformers transformers-base wai + wai-app-static word8 + ]; + executableHaskellDepends = [ + aeson base base-compat servant text wai warp + ]; + testHaskellDepends = [ + aeson base base-compat base64-bytestring bytestring directory hspec + hspec-wai http-types mtl QuickCheck resourcet safe servant + should-not-typecheck sop-core string-conversions temporary text + transformers transformers-compat wai wai-extra + ]; + testToolDepends = [ hspec-discover ]; + doHaddock = false; + jailbreak = true; + doCheck = false; + hyperlinkSource = false; + homepage = "http://docs.servant.dev/"; + description = "A family of combinators for defining webservices APIs and serving them"; + license = lib.licenses.bsd3; + mainProgram = "greet"; +} \ No newline at end of file