Files
665ca47169 fix(EN-979): remove earthly from payment (#697)
* fix(EN-979): remove earthly from payment

* fix: remove duplicate just URL

* fix: goreleaser step is required when running deploy-staging...

---------

Co-authored-by: fabrice guery <[email protected]>
2026-04-28 09:07:48 +00:00

120 lines
3.6 KiB
Nix

{
description = "A Nix-flake-based Go 1.26 development environment";
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2511";
nixpkgs-unstable.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixpkgs-unstable, nur }:
let
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 = [ nur.overlays.default ];
config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
"goreleaser-pro"
];
};
pkgs-unstable = import nixpkgs-unstable {
inherit system;
};
in
f { pkgs = pkgs; pkgs-unstable = pkgs-unstable; 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
{
packages = forEachSupportedSystem ({ pkgs, pkgs-unstable, 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, pkgs-unstable, system }:
let
stablePackages = with pkgs; [
argocd
ginkgo
go_1_26
gotools
jq
just
(mockgen.override { buildGoModule = buildGo126Module; })
nodejs_22
yq-go
];
unstablePackages = with pkgs-unstable; [
golangci-lint
];
otherPackages = [
pkgs.nur.repos.goreleaser.goreleaser-pro
self.packages.${system}.speakeasy
];
in
{
default = pkgs.mkShell {
packages = stablePackages ++ unstablePackages ++ otherPackages;
env = {
GOROOT = "${pkgs.go_1_26}/share/go";
};
};
}
);
};
}