diff --git a/NixSupport/haskell-packages/typerep-map.nix b/NixSupport/haskell-packages/typerep-map.nix new file mode 100644 index 000000000..5efd42887 --- /dev/null +++ b/NixSupport/haskell-packages/typerep-map.nix @@ -0,0 +1,28 @@ +{ mkDerivation, base, containers, criterion, deepseq, dependent-map +, dependent-sum, ghc-prim, ghc-typelits-knownnat, hedgehog, hspec +, hspec-hedgehog, lib, primitive, vector, fetchFromGitHub +}: +mkDerivation { + pname = "typerep-map"; + version = "0.6.0.0"; + libraryHaskellDepends = [ + base containers deepseq ghc-prim primitive vector + ]; + testHaskellDepends = [ + base ghc-typelits-knownnat hedgehog hspec hspec-hedgehog + ]; + benchmarkHaskellDepends = [ + base criterion deepseq dependent-map dependent-sum + ghc-typelits-knownnat + ]; + doHaddock = false; + homepage = "https://github.com/kowainik/typerep-map"; + description = "Efficient implementation of a dependent map with types as keys"; + license = lib.licenses.mpl20; + src = fetchFromGitHub { + owner = "alaendle"; + repo = "typerep-map"; + rev = "444d377fac1d0941721233737ee65b631ea3d056"; + sha256 = "sha256-BU/BvOI920QTW9MCfQyz+8zTRa0Ayx8i6R3matzRAIs"; + }; +} \ No newline at end of file diff --git a/NixSupport/haskell-packages/xconnection.nix b/NixSupport/haskell-packages/xconnection.nix new file mode 100644 index 000000000..2127ba5d3 --- /dev/null +++ b/NixSupport/haskell-packages/xconnection.nix @@ -0,0 +1,29 @@ +{ mkDerivation, base, basement, bytestring, containers +, data-default-class, lib, network, socks, tls, x509, x509-store +, x509-system, x509-validation, fetchFromGitHub +, crypton-x509-system +, crypton-x509-validation +, crypton-x509-store +, crypton-x509 +}: +mkDerivation { + pname = "connection"; + version = "0.4.1"; + libraryHaskellDepends = [ + base basement bytestring containers data-default-class network + socks tls x509 x509-store x509-system x509-validation + crypton-x509-system + crypton-x509-validation + crypton-x509-store + crypton-x509 + ]; + homepage = "https://github.com/vincenthz/hs-connection"; + description = "Simple and easy network connections API"; + license = lib.licenses.bsd3; + src = fetchFromGitHub { + owner = "vincenthz"; + repo = "hs-connection"; + rev = "1dc000d38963de0e4c3954b27d4fe0e5f1d9cee2"; + sha256 = "sha256-yyKmEYMdCmicz3jSe1UOD/t3Bsgukb9pWeY0NZPP39Q"; + }; +} \ No newline at end of file diff --git a/NixSupport/haskell-packages/xhttp-client-tls.nix b/NixSupport/haskell-packages/xhttp-client-tls.nix new file mode 100644 index 000000000..77ae01267 --- /dev/null +++ b/NixSupport/haskell-packages/xhttp-client-tls.nix @@ -0,0 +1,23 @@ +{ mkDerivation, base, bytestring, case-insensitive, containers +, crypton, crypton-connection, data-default-class, exceptions +, gauge, hspec, http-client, http-types, lib, memory, network +, network-uri, text, tls, transformers +}: +mkDerivation { + pname = "http-client-tls"; + version = "0.3.6.3"; + sha256 = "15chmlnq0nk2kxhk65r9xdjkzl94k0axcml89a5qkdiffwyzrp1q"; + libraryHaskellDepends = [ + base bytestring case-insensitive containers crypton + crypton-connection data-default-class exceptions http-client + http-types memory network network-uri text tls transformers + ]; + testHaskellDepends = [ + base crypton-connection hspec http-client http-types + ]; + benchmarkHaskellDepends = [ base gauge http-client ]; + doCheck = false; + homepage = "https://github.com/snoyberg/http-client"; + description = "http-client backend using the connection package and tls library"; + license = lib.licenses.mit; +} \ No newline at end of file diff --git a/NixSupport/haskell-packages/xtls.nix b/NixSupport/haskell-packages/xtls.nix new file mode 100644 index 000000000..e3e3a8a92 --- /dev/null +++ b/NixSupport/haskell-packages/xtls.nix @@ -0,0 +1,29 @@ +{ mkDerivation, asn1-encoding, asn1-types, async, base, bytestring +, cereal, crypton, crypton-x509, crypton-x509-store +, crypton-x509-validation, data-default-class, gauge, hourglass +, lib, memory, mtl, network, QuickCheck, tasty, tasty-quickcheck +, transformers, unix-time +}: +mkDerivation { + pname = "tls"; + version = "1.9.0"; + sha256 = "0gj3af9sqd0bw7dpcqfyvbslpxsk2ij00a77kl710fwhw35vj1an"; + libraryHaskellDepends = [ + asn1-encoding asn1-types async base bytestring cereal crypton + crypton-x509 crypton-x509-store crypton-x509-validation + data-default-class memory mtl network transformers unix-time + ]; + testHaskellDepends = [ + asn1-types async base bytestring crypton crypton-x509 + crypton-x509-validation data-default-class hourglass QuickCheck + tasty tasty-quickcheck + ]; + benchmarkHaskellDepends = [ + asn1-types async base bytestring crypton crypton-x509 + crypton-x509-validation data-default-class gauge hourglass + QuickCheck tasty-quickcheck + ]; + homepage = "https://github.com/haskell-tls/hs-tls"; + description = "TLS/SSL protocol native implementation (Server and Client)"; + license = lib.licenses.bsd3; +} \ No newline at end of file diff --git a/NixSupport/mkGhcCompiler.nix b/NixSupport/mkGhcCompiler.nix index da5c86b24..5930e7436 100644 --- a/NixSupport/mkGhcCompiler.nix +++ b/NixSupport/mkGhcCompiler.nix @@ -36,7 +36,7 @@ let builtins.listToAttrs (map toPackage names); ihpDontCheckPackages = [ "mmark" "mmark-ext" "mutable-containers" "hiedb" "hls-fourmolu-plugin" "relude" "inflections" ]; - ihpDoJailbreakPackages = [ "haskell-to-elm" "ip" "ghc-syntax-highlighter" "relude" "hs-brotli" "tuples" "singletons-th" "singletons-base" "inflections" "postgresql-simple" "with-utf8" "chell" "zigzag" "typerep-map" "relude" "bytebuild" ]; + ihpDoJailbreakPackages = [ "haskell-to-elm" "ip" "ghc-syntax-highlighter" "relude" "hs-brotli" "tuples" "singletons-th" "singletons-base" "inflections" "postgresql-simple" "with-utf8" "chell" "zigzag" "typerep-map" "relude" "bytebuild" "connection" "microlens" "microlens-th"]; ihpDontHaddockPackages = [ ]; in ghcCompiler.override { overrides = composeExtensionsList [ diff --git a/flake-module.nix b/flake-module.nix index cb881d45f..50a14e208 100644 --- a/flake-module.nix +++ b/flake-module.nix @@ -153,7 +153,10 @@ ihpFlake: }; devenv.shells.default = lib.mkIf cfg.enable { - packages = [ ghcCompiler.ihp pkgs.postgresql_13 pkgs.gnumake ] ++ cfg.packages; + packages = [ ghcCompiler.ihp pkgs.postgresql_13 pkgs.gnumake ] + ++ cfg.packages + ++ [pkgs.mktemp] # Without this 'make build/bin/RunUnoptimizedProdServer' fails on macOS + ; /* we currently don't use devenv containers, and they break nix flake show diff --git a/flake.lock b/flake.lock index 974eab1f5..e20c5f638 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1690831896, - "narHash": "sha256-k4Cb2/Yx2kL8TFuVejwEk4R0J+5sxbydAj2IZBKZg7o=", + "lastModified": 1694422554, + "narHash": "sha256-s5NTPzT66yIMmau+ZGP7q9z4NjgceDETL4xZ6HJ/TBg=", "owner": "cachix", "repo": "devenv", - "rev": "e91205acb792f6a49ea53ab04c04fbc2a85039cd", + "rev": "63d20fe09aa09060ea9ec9bb6d582c025402ba15", "type": "github" }, "original": { @@ -85,11 +85,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1690933134, - "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", "type": "github" }, "original": { @@ -331,11 +331,11 @@ }, "nix-filter": { "locked": { - "lastModified": 1687178632, - "narHash": "sha256-HS7YR5erss0JCaUijPeyg2XrisEb959FIct3n2TMGbE=", + "lastModified": 1694434370, + "narHash": "sha256-7yfdTR4mCvWZ39Q6HUcsa18tr0mg+fJZSaHE/63rwoo=", "owner": "numtide", "repo": "nix-filter", - "rev": "d90c75e8319d0dd9be67d933d8eb9d0894ec9174", + "rev": "d6381c442f79f2f1fdfde00521c3d15d6c21218e", "type": "github" }, "original": { @@ -372,28 +372,28 @@ }, "nixpkgs": { "locked": { - "lastModified": 1690257924, - "narHash": "sha256-ciSZqliNLDattmjR/1yQ0mJHZSkXWZlnIR6TcdDGFMQ=", + "lastModified": 1681488673, + "narHash": "sha256-PmojOyePBNvbY3snYE7NAQHTLB53t7Ro+pgiJ4wPCuk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "277bf961c323b6cde46932cc9308135d0687af95", + "rev": "a95ed9fe764c3ba2bf2d2fa223012c379cd6b32e", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "277bf961c323b6cde46932cc9308135d0687af95", + "rev": "a95ed9fe764c3ba2bf2d2fa223012c379cd6b32e", "type": "github" } }, "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1690881714, - "narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e1960bc196baf6881340d53dccb203a951745a2", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", "type": "github" }, "original": { @@ -488,17 +488,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1681488673, - "narHash": "sha256-PmojOyePBNvbY3snYE7NAQHTLB53t7Ro+pgiJ4wPCuk=", + "lastModified": 1694477507, + "narHash": "sha256-RtUmM5s6vnx1W+tnrGzXArVScJ/IoGmqCLM177k5O5A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a95ed9fe764c3ba2bf2d2fa223012c379cd6b32e", + "rev": "ff303118b2ec262eb342eab88ae79318fac66d52", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "a95ed9fe764c3ba2bf2d2fa223012c379cd6b32e", + "rev": "ff303118b2ec262eb342eab88ae79318fac66d52", "type": "github" } }, diff --git a/flake.nix b/flake.nix index a48c9f8b8..8e3bed93b 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { # TODO use nixpkgs-unstable and just .lock a version? - nixpkgs.url = "github:NixOS/nixpkgs?rev=277bf961c323b6cde46932cc9308135d0687af95"; + nixpkgs.url = "github:NixOS/nixpkgs?rev=ff303118b2ec262eb342eab88ae79318fac66d52"; # pre-defined set of default target systems systems.url = "github:nix-systems/default"; diff --git a/ihp-graphql/Test/GraphQL/CompilerSpec.hs b/ihp-graphql/Test/GraphQL/CompilerSpec.hs index a67865b91..9c8e30b52 100644 --- a/ihp-graphql/Test/GraphQL/CompilerSpec.hs +++ b/ihp-graphql/Test/GraphQL/CompilerSpec.hs @@ -77,7 +77,7 @@ tests = do |] } ] compileGQL mutation arguments `shouldBe` [trimming| - INSERT INTO projects (user_id, title) VALUES ('dc984c2f-d91c-4143-9091-400ad2333f83', 'Hello World') RETURNING json_build_object('id', projects.id, 'title', projects.title) + INSERT INTO projects (title, user_id) VALUES ('Hello World', 'dc984c2f-d91c-4143-9091-400ad2333f83') RETURNING json_build_object('id', projects.id, 'title', projects.title) |] it "should compile a delete mutation" do let mutation = [trimming| @@ -118,7 +118,7 @@ tests = do , argumentValue = parseValue [trimming|"df1f54d5-ced6-4f65-8aea-fcd5ea6b9df1"|] } ] compileGQL mutation arguments `shouldBe` [trimming| - UPDATE projects SET user_id = 'dc984c2f-d91c-4143-9091-400ad2333f83', title = 'Hello World' WHERE id = 'df1f54d5-ced6-4f65-8aea-fcd5ea6b9df1' RETURNING json_build_object('id', projects.id, 'title', projects.title) + UPDATE projects SET title = 'Hello World', user_id = 'dc984c2f-d91c-4143-9091-400ad2333f83' WHERE id = 'df1f54d5-ced6-4f65-8aea-fcd5ea6b9df1' RETURNING json_build_object('id', projects.id, 'title', projects.title) |] compileGQL gql arguments = gql