From d8a4304395428f016b75158bfd8f44488c69e96b Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Mon, 12 Jul 2021 10:34:58 -0400 Subject: [PATCH] Materialize the haskell.nix Nix expression --- default.nix | 1 + .../.stack-to-nix.cache | 1 + .../.stack-to-nix.cache.0 | 80 +++++++++++ materialized.paymentserver/PaymentServer.nix | 128 ++++++++++++++++++ materialized.paymentserver/default.nix | 14 ++ 5 files changed, 224 insertions(+) create mode 100644 materialized.paymentserver/.stack-to-nix.cache create mode 100644 materialized.paymentserver/.stack-to-nix.cache.0 create mode 100644 materialized.paymentserver/PaymentServer.nix create mode 100644 materialized.paymentserver/default.nix diff --git a/default.nix b/default.nix index c144f27..a9c9f7e 100644 --- a/default.nix +++ b/default.nix @@ -30,4 +30,5 @@ in name = "PaymentServer"; src = ./.; }; + materialized = ./materialized.paymentserver; } diff --git a/materialized.paymentserver/.stack-to-nix.cache b/materialized.paymentserver/.stack-to-nix.cache new file mode 100644 index 0000000..36bb67c --- /dev/null +++ b/materialized.paymentserver/.stack-to-nix.cache @@ -0,0 +1 @@ +https://github.com/PrivateStorageio/servant-prometheus.git b9461cbf689b47506b2eee973136706092b74968 . 1gfslw670ri119bnq3szc8b08n504f8cnzs5cgk5qvfwvfmsr1xh servant-prometheus .stack-to-nix.cache.0 diff --git a/materialized.paymentserver/.stack-to-nix.cache.0 b/materialized.paymentserver/.stack-to-nix.cache.0 new file mode 100644 index 0000000..efa9d4c --- /dev/null +++ b/materialized.paymentserver/.stack-to-nix.cache.0 @@ -0,0 +1,80 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "servant-prometheus"; version = "0.2.0.0"; }; + license = "BSD-3-Clause"; + copyright = ""; + maintainer = "Alex Mason <axman6@gmail.com>, Jack Kelly <jack.kelly@data61.csiro.au>"; + author = "Alex Mason <axman6@gmail.com>, Anchor Engineering <engineering@lists.anchor.net.au>, Servant Contributors"; + homepage = ""; + url = ""; + synopsis = "Helpers for using prometheus with servant"; + description = "Helpers for using prometheus with servant. Each endpoint has its own metrics allowing more detailed monitoring than wai-middleware-prometheus allows"; + buildType = "Simple"; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."prometheus-client" or (errorHandler.buildDepError "prometheus-client")) + (hsPkgs."servant" or (errorHandler.buildDepError "servant")) + (hsPkgs."http-types" or (errorHandler.buildDepError "http-types")) + (hsPkgs."text" or (errorHandler.buildDepError "text")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + (hsPkgs."unordered-containers" or (errorHandler.buildDepError "unordered-containers")) + (hsPkgs."wai" or (errorHandler.buildDepError "wai")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + ]; + buildable = true; + }; + exes = { + "bench" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."aeson" or (errorHandler.buildDepError "aeson")) + (hsPkgs."servant-prometheus" or (errorHandler.buildDepError "servant-prometheus")) + (hsPkgs."servant-server" or (errorHandler.buildDepError "servant-server")) + (hsPkgs."prometheus-client" or (errorHandler.buildDepError "prometheus-client")) + (hsPkgs."text" or (errorHandler.buildDepError "text")) + (hsPkgs."wai" or (errorHandler.buildDepError "wai")) + (hsPkgs."warp" or (errorHandler.buildDepError "warp")) + (hsPkgs."process" or (errorHandler.buildDepError "process")) + ]; + buildable = true; + }; + }; + tests = { + "spec" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."aeson" or (errorHandler.buildDepError "aeson")) + (hsPkgs."servant-prometheus" or (errorHandler.buildDepError "servant-prometheus")) + (hsPkgs."servant-server" or (errorHandler.buildDepError "servant-server")) + (hsPkgs."servant-client" or (errorHandler.buildDepError "servant-client")) + (hsPkgs."servant" or (errorHandler.buildDepError "servant")) + (hsPkgs."prometheus-client" or (errorHandler.buildDepError "prometheus-client")) + (hsPkgs."http-client" or (errorHandler.buildDepError "http-client")) + (hsPkgs."text" or (errorHandler.buildDepError "text")) + (hsPkgs."wai" or (errorHandler.buildDepError "wai")) + (hsPkgs."warp" or (errorHandler.buildDepError "warp")) + (hsPkgs."hspec" or (errorHandler.buildDepError "hspec")) + (hsPkgs."unordered-containers" or (errorHandler.buildDepError "unordered-containers")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + ]; + buildable = true; + }; + }; + }; + } // rec { + src = (pkgs.lib).mkDefault /nix/store/zvvv6lxnqnva4302265x8wwbyb0mfy56-servant-prometheus-b9461cb; + } diff --git a/materialized.paymentserver/PaymentServer.nix b/materialized.paymentserver/PaymentServer.nix new file mode 100644 index 0000000..79c3cf6 --- /dev/null +++ b/materialized.paymentserver/PaymentServer.nix @@ -0,0 +1,128 @@ +{ system + , compiler + , flags + , pkgs + , hsPkgs + , pkgconfPkgs + , errorHandler + , config + , ... }: + { + flags = {}; + package = { + specVersion = "1.10"; + identifier = { name = "PaymentServer"; version = "0.1.1.0"; }; + license = "Apache-2.0"; + copyright = "2019 Private Storage.io, LLC."; + maintainer = "support@privatestorage.io"; + author = "Jean-Paul Calderone"; + homepage = "https://github.com/privatestorageio/PaymentServer#readme"; + url = ""; + synopsis = "Coordinate entities for the purchase of PrivateStorage.io vouchers."; + description = ""; + buildType = "Simple"; + isLocal = true; + detailLevel = "FullDetails"; + licenseFiles = [ "LICENSE" ]; + dataDir = "."; + dataFiles = []; + extraSrcFiles = [ "README.rst" ]; + extraTmpFiles = []; + extraDocFiles = []; + }; + components = { + "library" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."optparse-applicative" or (errorHandler.buildDepError "optparse-applicative")) + (hsPkgs."aeson" or (errorHandler.buildDepError "aeson")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."utf8-string" or (errorHandler.buildDepError "utf8-string")) + (hsPkgs."servant" or (errorHandler.buildDepError "servant")) + (hsPkgs."servant-server" or (errorHandler.buildDepError "servant-server")) + (hsPkgs."http-types" or (errorHandler.buildDepError "http-types")) + (hsPkgs."wai" or (errorHandler.buildDepError "wai")) + (hsPkgs."wai-extra" or (errorHandler.buildDepError "wai-extra")) + (hsPkgs."wai-cors" or (errorHandler.buildDepError "wai-cors")) + (hsPkgs."data-default" or (errorHandler.buildDepError "data-default")) + (hsPkgs."warp" or (errorHandler.buildDepError "warp")) + (hsPkgs."warp-tls" or (errorHandler.buildDepError "warp-tls")) + (hsPkgs."stripe-haskell" or (errorHandler.buildDepError "stripe-haskell")) + (hsPkgs."stripe-core" or (errorHandler.buildDepError "stripe-core")) + (hsPkgs."text" or (errorHandler.buildDepError "text")) + (hsPkgs."containers" or (errorHandler.buildDepError "containers")) + (hsPkgs."cryptonite" or (errorHandler.buildDepError "cryptonite")) + (hsPkgs."sqlite-simple" or (errorHandler.buildDepError "sqlite-simple")) + (hsPkgs."retry" or (errorHandler.buildDepError "retry")) + (hsPkgs."prometheus-client" or (errorHandler.buildDepError "prometheus-client")) + (hsPkgs."servant-prometheus" or (errorHandler.buildDepError "servant-prometheus")) + ]; + pkgconfig = [ + (pkgconfPkgs."libchallenge_bypass_ristretto_ffi" or (errorHandler.pkgConfDepError "libchallenge_bypass_ristretto_ffi")) + ]; + buildable = true; + modules = [ + "PaymentServer/Processors/Stripe" + "PaymentServer/Ristretto" + "PaymentServer/Issuer" + "PaymentServer/Persistence" + "PaymentServer/Redemption" + "PaymentServer/Metrics" + "PaymentServer/Server" + "PaymentServer/Main" + ]; + hsSourceDirs = [ "src" ]; + }; + exes = { + "PaymentServer-exe" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."PaymentServer" or (errorHandler.buildDepError "PaymentServer")) + ]; + buildable = true; + hsSourceDirs = [ "app" ]; + mainPath = [ "Main.hs" ]; + }; + "PaymentServer-generate-key" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."text" or (errorHandler.buildDepError "text")) + (hsPkgs."PaymentServer" or (errorHandler.buildDepError "PaymentServer")) + ]; + buildable = true; + hsSourceDirs = [ "generate-key" ]; + mainPath = [ "Main.hs" ]; + }; + }; + tests = { + "PaymentServer-tests" = { + depends = [ + (hsPkgs."base" or (errorHandler.buildDepError "base")) + (hsPkgs."bytestring" or (errorHandler.buildDepError "bytestring")) + (hsPkgs."text" or (errorHandler.buildDepError "text")) + (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) + (hsPkgs."raw-strings-qq" or (errorHandler.buildDepError "raw-strings-qq")) + (hsPkgs."time" or (errorHandler.buildDepError "time")) + (hsPkgs."tasty" or (errorHandler.buildDepError "tasty")) + (hsPkgs."tasty-hunit" or (errorHandler.buildDepError "tasty-hunit")) + (hsPkgs."directory" or (errorHandler.buildDepError "directory")) + (hsPkgs."async" or (errorHandler.buildDepError "async")) + (hsPkgs."sqlite-simple" or (errorHandler.buildDepError "sqlite-simple")) + (hsPkgs."http-types" or (errorHandler.buildDepError "http-types")) + (hsPkgs."wai" or (errorHandler.buildDepError "wai")) + (hsPkgs."wai-extra" or (errorHandler.buildDepError "wai-extra")) + (hsPkgs."warp" or (errorHandler.buildDepError "warp")) + (hsPkgs."http-types" or (errorHandler.buildDepError "http-types")) + (hsPkgs."servant-server" or (errorHandler.buildDepError "servant-server")) + (hsPkgs."prometheus-client" or (errorHandler.buildDepError "prometheus-client")) + (hsPkgs."stripe-core" or (errorHandler.buildDepError "stripe-core")) + (hsPkgs."PaymentServer" or (errorHandler.buildDepError "PaymentServer")) + ]; + buildable = true; + modules = [ "Persistence" "Metrics" "Stripe" "FakeStripe" ]; + hsSourceDirs = [ "test" ]; + mainPath = [ "Spec.hs" ]; + }; + }; + }; + } // rec { src = (pkgs.lib).mkDefault ./.; } \ No newline at end of file diff --git a/materialized.paymentserver/default.nix b/materialized.paymentserver/default.nix new file mode 100644 index 0000000..b7dc423 --- /dev/null +++ b/materialized.paymentserver/default.nix @@ -0,0 +1,14 @@ +{ + extras = hackage: + { + packages = { + "stripe-core" = (((hackage.stripe-core)."2.5.0").revisions).default; + "stripe-haskell" = (((hackage.stripe-haskell)."2.5.0").revisions).default; + "stripe-http-client" = (((hackage.stripe-http-client)."2.5.0").revisions).default; + PaymentServer = ./PaymentServer.nix; + servant-prometheus = ./.stack-to-nix.cache.0; + }; + }; + resolver = "lts-14.1"; + modules = [ ({ lib, ... }: { packages = {}; }) { packages = {}; } ]; + } \ No newline at end of file -- GitLab