From f36147e2c9bcf16331c86b007532c5e921a4a09e Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Mon, 24 Feb 2025 15:26:01 +0000 Subject: [PATCH 1/7] Update dependencies Commands used: `niv update` followed by `niv init`. --- nix/sources.json | 24 +++++----- nix/sources.nix | 118 ++++++++++++++++++++++++++++------------------- 2 files changed, 83 insertions(+), 59 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index 9952dcc..500bd14 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "https://input-output-hk.github.io/haskell.nix", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "4e01f345439c89bc2a5616ceda08a979a01bc15e", - "sha256": "02n3ag3zcig60x93hh9v2vnhyw6qmzr9qg8dpnr4ac4ym8cyifc9", + "rev": "c4e38ee5d48befdc89a2b0b78434f6d98e3458c6", + "sha256": "1186k1m3pwkirwv5fav1yx03nj7ic6jbl139370cdya15db36c1x", "type": "tarball", - "url": "https://github.com/input-output-hk/haskell.nix/archive/4e01f345439c89bc2a5616ceda08a979a01bc15e.tar.gz", + "url": "https://github.com/input-output-hk/haskell.nix/archive/c4e38ee5d48befdc89a2b0b78434f6d98e3458c6.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "libchallenge_bypass_ristretto_ffi": { @@ -17,10 +17,10 @@ "homepage": null, "owner": "leastauthority", "repo": "python-challenge-bypass-ristretto", - "rev": "6e25af8a721a9d8507745efad3d15dae75b78909", - "sha256": "0w5vpq9kqhdbbynbbky1ibx1im5582yacqnb9y2y3h114diywdyq", + "rev": "486775020a4b0a43e753065eacd72ccdbda8496a", + "sha256": "1fxbgiqvk3391lx4sfj908kvyk19hng9wlxy0sazwipyr1636qg4", "type": "tarball", - "url": "https://github.com/leastauthority/python-challenge-bypass-ristretto/archive/6e25af8a721a9d8507745efad3d15dae75b78909.tar.gz", + "url": "https://github.com/leastauthority/python-challenge-bypass-ristretto/archive/486775020a4b0a43e753065eacd72ccdbda8496a.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "niv": { @@ -29,10 +29,10 @@ "homepage": "https://github.com/nmattia/niv", "owner": "nmattia", "repo": "niv", - "rev": "e0ca65c81a2d7a4d82a189f1e23a48d59ad42070", - "sha256": "1pq9nh1d8nn3xvbdny8fafzw87mj7gsmp6pxkdl65w2g18rmcmzx", + "rev": "e2f66fe558481d6b569358d27db06f7e972ed71b", + "sha256": "1xn822jajags6bigdr1ssxvfiyd7d3adhnmmrr9x3maphchkr0x0", "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/e0ca65c81a2d7a4d82a189f1e23a48d59ad42070.tar.gz", + "url": "https://github.com/nmattia/niv/archive/e2f66fe558481d6b569358d27db06f7e972ed71b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { @@ -41,10 +41,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "573095944e7c1d58d30fc679c81af63668b54056", - "sha256": "07s5cwhskqvy82b4rld9b14ljc0013pig23i3jx3l3f957rk95pg", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "sha256": "04ffwp2gzq0hhz7siskw6qh9ys8ragp7285vi1zh8xjksxn1msc5", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/573095944e7c1d58d30fc679c81af63668b54056.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/eabc38219184cc3e04a974fe31857d8e0eac098d.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/nix/sources.nix b/nix/sources.nix index 1938409..fe3dadf 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -10,29 +10,50 @@ let 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'; }; + 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; }; + 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 + spec.ref or ( 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`!"; + if spec ? tag then "refs/tags/${spec.tag}" else + abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!" + ); + submodules = spec.submodules or false; + submoduleArg = + let + nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; + emptyArgWithWarning = + if submodules + then + builtins.trace + ( + "The niv input \"${name}\" uses submodules " + + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " + + "does not support them" + ) + { } + else { }; + in + if nixSupportsSubmodules + then { inherit submodules; } + else emptyArgWithWarning; in - builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + builtins.fetchGit + ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); fetch_local = spec: spec.path; @@ -66,16 +87,16 @@ let hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; hasThisAsNixpkgsPath = == ./.; in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import {} - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import { } + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; # The actual fetching function. fetch = pkgs: name: spec: @@ -95,13 +116,13 @@ let # 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; + saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null 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}"; + 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 @@ -112,7 +133,7 @@ let ); # 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); + 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)); @@ -123,43 +144,46 @@ let concatStrings = builtins.concatStringsSep ""; # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else {}; + 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; + if lessThan nixVersion "1.12" then + fetchTarball ({ inherit url; } // (optionalAttrs (name != null) { 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; + if lessThan nixVersion "1.12" then + fetchurl ({ inherit url; } // (optionalAttrs (name != null) { 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; + 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) + , sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile) , system ? builtins.currentSystem , pkgs ? mkPkgs sources system }: rec { @@ -171,4 +195,4 @@ let }; in -mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } +mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); } From 48c544c96e43c406952f8893206237f2fd38676d Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Mon, 24 Feb 2025 15:29:22 +0000 Subject: [PATCH 2/7] Update nixpkgs to current stable channel nixos-24.11 is what PrivateStorageio uses. Command used: `niv modify nixpkgs --branch nixos-24.11`. --- nix/sources.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index 500bd14..d34d979 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -36,15 +36,15 @@ "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { - "branch": "nixos-21.11", + "branch": "nixos-24.11", "description": "Nix Packages collection", "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", - "sha256": "04ffwp2gzq0hhz7siskw6qh9ys8ragp7285vi1zh8xjksxn1msc5", + "rev": "04ef94c4c1582fd485bbfdb8c4a8ba250e359195", + "sha256": "0lc189m0s912qyzhqrd08rn7gvlxv9xlp8pfkr2wg18h93ng1fki", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eabc38219184cc3e04a974fe31857d8e0eac098d.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/04ef94c4c1582fd485bbfdb8c4a8ba250e359195.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } From f9b2f9705b0c3f268e89429a623342208b868478 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Mon, 24 Feb 2025 18:52:21 +0000 Subject: [PATCH 3/7] Use python-challenge-bypass-ristretto library before that was turned into a flake --- nix/sources.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index d34d979..02015d9 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -17,10 +17,10 @@ "homepage": null, "owner": "leastauthority", "repo": "python-challenge-bypass-ristretto", - "rev": "486775020a4b0a43e753065eacd72ccdbda8496a", - "sha256": "1fxbgiqvk3391lx4sfj908kvyk19hng9wlxy0sazwipyr1636qg4", + "rev": "6e25af8a721a9d8507745efad3d15dae75b78909", + "sha256": "0w5vpq9kqhdbbynbbky1ibx1im5582yacqnb9y2y3h114diywdyq", "type": "tarball", - "url": "https://github.com/leastauthority/python-challenge-bypass-ristretto/archive/486775020a4b0a43e753065eacd72ccdbda8496a.tar.gz", + "url": "https://github.com/leastauthority/python-challenge-bypass-ristretto/archive/6e25af8a721a9d8507745efad3d15dae75b78909.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "niv": { From e389f9e8065040cfcd07446c90a17d1404cd95fb Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Mon, 24 Feb 2025 18:58:26 +0000 Subject: [PATCH 4/7] Update nixpkgs to 24.11 --- nix/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/default.nix b/nix/default.nix index 9944107..1d1465a 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -24,7 +24,7 @@ let # haskell.nix provides access to the nixpkgs pins which are used by our CI, # hence you will be more likely to get cache hits when using these. # But you can also just use your own, e.g. ''. - haskellNix.sources.nixpkgs-2205 + haskellNix.sources.nixpkgs-2411 # These arguments passed to nixpkgs, include some patches and also # the haskell.nix functionality itself as an overlay. (haskellNix.nixpkgsArgs // { overlays = allOverlays; }); From 46706448bacbdf232d0ff6d61dee2da7140c017e Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Mon, 24 Feb 2025 18:58:58 +0000 Subject: [PATCH 5/7] Add extraPkgconfigMappings to provide the library Cabal expects - Cargo-culting off of https://github.com/input-output-hk/haskell.nix/blob/master/lib/pkgconf-nixpkgs-map.nix - Minding https://github.com/PrivateStorageio/PaymentServer/pull/118 - Fixing an issue reported by exarkun in https://github.com/input-output-hk/haskell.nix/issues/1664#issuecomment-1248481880 --- nix/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nix/default.nix b/nix/default.nix index 1d1465a..bc85f0b 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -14,7 +14,14 @@ let # Haskell.nix is delivery as an overlay. Add our own overlay, which # provides one of our crypto dependencies, in a non-destructive way. - allOverlays = moreOverlays ++ haskellNix.nixpkgsArgs.overlays; + allOverlays = moreOverlays ++ haskellNix.nixpkgsArgs.overlays ++ + [(final: prev: { + haskell-nix = prev.haskell-nix // { + extraPkgconfigMappings = prev.haskell-nix.extraPkgconfigMappings or {} // { + "libchallenge_bypass_ristretto_ffi" = [ "libchallenge_bypass_ristretto_ffi" ]; + }; + }; + })]; # Remove runtime dependency on GCC noGCC = { dontStrip = false; enableShared = false; }; From 161da49f50775852391d009eea3ebd7127fe9196 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Mon, 24 Feb 2025 19:01:54 +0000 Subject: [PATCH 6/7] Update materialized paymentserver --- .../.stack-to-nix.cache.0 | 20 +++++------ .../.stack-to-nix.cache.1 | 12 +++---- .../PaymentServer.nix | 34 +++++++++---------- nix/materialized.paymentserver/default.nix | 10 +++--- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/nix/materialized.paymentserver/.stack-to-nix.cache.0 b/nix/materialized.paymentserver/.stack-to-nix.cache.0 index 086ae74..a0dc7b3 100644 --- a/nix/materialized.paymentserver/.stack-to-nix.cache.0 +++ b/nix/materialized.paymentserver/.stack-to-nix.cache.0 @@ -21,7 +21,7 @@ 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 = [ @@ -34,9 +34,9 @@ (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 = [ @@ -49,10 +49,10 @@ (hsPkgs."wai" or (errorHandler.buildDepError "wai")) (hsPkgs."warp" or (errorHandler.buildDepError "warp")) (hsPkgs."process" or (errorHandler.buildDepError "process")) - ]; + ]; buildable = true; - }; }; + }; tests = { "spec" = { depends = [ @@ -70,11 +70,11 @@ (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/r537z0w0swb6calr6vkk2ppnqd2bgv8z-servant-prometheus-622eb77; - } + }; + } // rec { + src = pkgs.lib.mkDefault /nix/store/r537z0w0swb6calr6vkk2ppnqd2bgv8z-servant-prometheus-622eb77; + } diff --git a/nix/materialized.paymentserver/.stack-to-nix.cache.1 b/nix/materialized.paymentserver/.stack-to-nix.cache.1 index b1ccce5..9da9aa9 100644 --- a/nix/materialized.paymentserver/.stack-to-nix.cache.1 +++ b/nix/materialized.paymentserver/.stack-to-nix.cache.1 @@ -21,7 +21,7 @@ synopsis = "Stripe API for Haskell - Pure Core"; description = "\n<>\n\n[Pure API Wrapper]\n`stripe-core` provides a complete binding to the Stripe API. `stripe-core` provides pure wrappers around all the Stripe API objects and methods. `stripe-core` is pure and is not tied to any particular HTTP client library. End users will typically install the `stripe-haskell` package which pulls in the `stripe-http-client` library to obtain a complete set of functionality."; buildType = "Simple"; - }; + }; components = { "library" = { depends = [ @@ -33,10 +33,10 @@ (hsPkgs."time" or (errorHandler.buildDepError "time")) (hsPkgs."transformers" or (errorHandler.buildDepError "transformers")) (hsPkgs."unordered-containers" or (errorHandler.buildDepError "unordered-containers")) - ]; + ]; buildable = true; - }; }; - } // rec { - src = (pkgs.lib).mkDefault /nix/store/5np9iplqv5nqcawrwlng38ak0l847nid-stripe-6c340ee/stripe-core; - } + }; + } // rec { + src = pkgs.lib.mkDefault /nix/store/5np9iplqv5nqcawrwlng38ak0l847nid-stripe-6c340ee/stripe-core; + } diff --git a/nix/materialized.paymentserver/PaymentServer.nix b/nix/materialized.paymentserver/PaymentServer.nix index b884df1..bddc737 100644 --- a/nix/materialized.paymentserver/PaymentServer.nix +++ b/nix/materialized.paymentserver/PaymentServer.nix @@ -29,7 +29,7 @@ extraSrcFiles = [ "README.rst" ]; extraTmpFiles = []; extraDocFiles = []; - }; + }; components = { "library" = { depends = [ @@ -61,10 +61,10 @@ (hsPkgs."prometheus-client" or (errorHandler.buildDepError "prometheus-client")) (hsPkgs."servant-prometheus" or (errorHandler.buildDepError "servant-prometheus")) (hsPkgs."mtl" or (errorHandler.buildDepError "mtl")) - ]; + ]; pkgconfig = [ (pkgconfPkgs."libchallenge_bypass_ristretto_ffi" or (errorHandler.pkgConfDepError "libchallenge_bypass_ristretto_ffi")) - ]; + ]; buildable = true; modules = [ "PaymentServer/Processors/Stripe" @@ -75,40 +75,40 @@ "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" ]; - }; + }; "PaymentServer-get-public-key" = { depends = [ (hsPkgs."base" or (errorHandler.buildDepError "base")) (hsPkgs."text" or (errorHandler.buildDepError "text")) (hsPkgs."optparse-applicative" or (errorHandler.buildDepError "optparse-applicative")) (hsPkgs."PaymentServer" or (errorHandler.buildDepError "PaymentServer")) - ]; + ]; buildable = true; hsSourceDirs = [ "get-public-key" ]; mainPath = [ "Main.hs" ]; - }; + }; "PaymentServer-complete-payment" = { depends = [ (hsPkgs."base" or (errorHandler.buildDepError "base")) @@ -121,12 +121,12 @@ (hsPkgs."stripe-concepts" or (errorHandler.buildDepError "stripe-concepts")) (hsPkgs."raw-strings-qq" or (errorHandler.buildDepError "raw-strings-qq")) (hsPkgs."PaymentServer" or (errorHandler.buildDepError "PaymentServer")) - ]; + ]; buildable = true; hsSourceDirs = [ "complete-payment" ]; mainPath = [ "Main.hs" ]; - }; }; + }; tests = { "PaymentServer-tests" = { depends = [ @@ -153,7 +153,7 @@ (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" @@ -162,10 +162,10 @@ "Stripe" "FakeStripe" "Ristretto" - ]; + ]; hsSourceDirs = [ "test" ]; mainPath = [ "Spec.hs" ]; - }; }; }; - } // rec { src = (pkgs.lib).mkDefault ./.; } \ No newline at end of file + }; + } // rec { src = pkgs.lib.mkDefault ./.; } \ No newline at end of file diff --git a/nix/materialized.paymentserver/default.nix b/nix/materialized.paymentserver/default.nix index dd74a3c..f4b2321 100644 --- a/nix/materialized.paymentserver/default.nix +++ b/nix/materialized.paymentserver/default.nix @@ -2,13 +2,13 @@ extras = hackage: { packages = { - "network" = (((hackage.network)."3.1.2.7").revisions).default; - "stripe-signature" = (((hackage.stripe-signature)."1.0.0.14").revisions).default; + "network" = hackage.network."3.1.2.7".revisions.default; + "stripe-signature" = hackage.stripe-signature."1.0.0.14".revisions.default; PaymentServer = ./PaymentServer.nix; servant-prometheus = ./.stack-to-nix.cache.0; stripe-core = ./.stack-to-nix.cache.1; - }; }; + }; resolver = "lts-18.28"; modules = [ ({ lib, ... }: @@ -16,5 +16,5 @@ { packages = {}; } ({ lib, ... }: { planned = lib.mkOverride 900 true; }) - ]; - } \ No newline at end of file + ]; +} \ No newline at end of file From 8f5c3ede67c767545ba9527fc208b43603ce2ea9 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Mon, 24 Feb 2025 19:05:04 +0000 Subject: [PATCH 7/7] Oh my is this ugly, surely there would be a better place for this --- nix/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/default.nix b/nix/default.nix index bc85f0b..ea19347 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -15,6 +15,7 @@ let # Haskell.nix is delivery as an overlay. Add our own overlay, which # provides one of our crypto dependencies, in a non-destructive way. allOverlays = moreOverlays ++ haskellNix.nixpkgsArgs.overlays ++ + # And provide a mapping for haskell-nix to make our library available to Cabal. [(final: prev: { haskell-nix = prev.haskell-nix // { extraPkgconfigMappings = prev.haskell-nix.extraPkgconfigMappings or {} // {