mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* Use formance-sdk-go/v3 to in connector uninstall e2e test * Compile API docs from openapi spec * Generate go SDK locally for use in integration tests * Get rid of unnecessary redirect in e2e tests now that SDK is generated * Omit generated SDK code from codecoverage checks * Add flake and envrc for nix * Run Dirty and Tests CI steps with nix * Run pre-commit using nix * Remove duplicated steps from Earthfile * Fixes for linter * Add go generate to Justfile pre-commit * Still run Deploy on ubuntu-latest * Address coderabbit feedback
108 lines
3.1 KiB
Nix
108 lines
3.1 KiB
Nix
{
|
|
description = "A Nix-flake-based Go 1.23 development environment";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
|
|
|
|
nur = {
|
|
url = "github:nix-community/NUR";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, nur }:
|
|
let
|
|
goVersion = 23;
|
|
|
|
supportedSystems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
];
|
|
|
|
forEachSupportedSystem = f:
|
|
nixpkgs.lib.genAttrs supportedSystems (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [ self.overlays.default nur.overlays.default ];
|
|
config.allowUnfree = true;
|
|
};
|
|
in
|
|
f { pkgs = pkgs; system = system; }
|
|
);
|
|
|
|
speakeasyVersion = "1.525.0";
|
|
speakeasyPlatforms = {
|
|
"x86_64-linux" = "linux_amd64";
|
|
"aarch64-linux" = "linux_arm64";
|
|
"x86_64-darwin" = "darwin_amd64";
|
|
"aarch64-darwin" = "darwin_arm64";
|
|
};
|
|
speakeasyHashes = {
|
|
"x86_64-linux" = "f17c88ae5fa2ffc15f4a3b23085fbf9faaeaee562450cc8a3f7cdda06c8c889f";
|
|
"aarch64-linux" = "e935ecf74a9bc9b380bec4ec9455d05cb83f258108a28f3e2e61f2f362c32553";
|
|
"x86_64-darwin" = "1904add9ff7ff0026245240f7bc7a4644b10dc4e6ef8620d6f4475bdc5b59f00";
|
|
"aarch64-darwin" = "0d6660931eea7d86ac1fdff0c001913d82139fd3c5e62cea818a3c559ca9cccc";
|
|
};
|
|
|
|
in
|
|
{
|
|
overlays.default = final: prev: {
|
|
go = final."go_1_${toString goVersion}";
|
|
};
|
|
|
|
packages = forEachSupportedSystem ({ pkgs, system }:
|
|
{
|
|
speakeasy = pkgs.stdenv.mkDerivation {
|
|
pname = "speakeasy";
|
|
version = speakeasyVersion;
|
|
|
|
src = pkgs.fetchurl {
|
|
url = "https://github.com/speakeasy-api/speakeasy/releases/download/v${speakeasyVersion}/speakeasy_${speakeasyPlatforms.${system}}.zip";
|
|
sha256 = speakeasyHashes.${system};
|
|
};
|
|
|
|
nativeBuildInputs = [ pkgs.unzip ];
|
|
dontUnpack = true;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
unzip $src
|
|
ls -al
|
|
install -m755 speakeasy $out/bin/
|
|
'';
|
|
|
|
name = "speakeasy";
|
|
};
|
|
}
|
|
);
|
|
|
|
defaultPackage.x86_64-linux = self.packages.x86_64-linux.speakeasy;
|
|
defaultPackage.aarch64-linux = self.packages.aarch64-linux.speakeasy;
|
|
defaultPackage.x86_64-darwin = self.packages.x86_64-darwin.speakeasy;
|
|
defaultPackage.aarch64-darwin = self.packages.aarch64-darwin.speakeasy;
|
|
|
|
devShells = forEachSupportedSystem ({ pkgs, system }:
|
|
{
|
|
default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
go
|
|
gotools
|
|
golangci-lint
|
|
mockgen
|
|
ginkgo
|
|
yq-go
|
|
jq
|
|
pkgs.nur.repos.goreleaser.goreleaser-pro
|
|
self.packages.${system}.speakeasy
|
|
just
|
|
nodejs_22
|
|
];
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|