From d20824cbe341c5cdb2ba3b8d3de2004d54178bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Sun, 1 Feb 2026 19:47:18 -0300 Subject: [PATCH 1/4] feat: add flake.nix for Nix support --- flake.nix | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1606314 --- /dev/null +++ b/flake.nix @@ -0,0 +1,85 @@ +{ + description = "agentmail - Python SDK"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + python = pkgs.python3; + + agentmail = python.pkgs.buildPythonPackage { + pname = "agentmail"; + version = "0.2.10"; + format = "pyproject"; + src = ./.; + + nativeBuildInputs = [ + python.pkgs.poetry-core + ]; + + propagatedBuildInputs = with python.pkgs; [ + httpx + pydantic + pydantic-core + typing-extensions + websockets + ]; + + pythonImportsCheck = [ "agentmail" ]; + + # Tests require network access / API keys + doCheck = false; + }; + in + { + packages.default = agentmail; + + devShells.default = pkgs.mkShell { + packages = [ + (python.withPackages (ps: [ + agentmail + ps.pytest + ps.pytest-asyncio + ps.pytest-xdist + ps.python-dateutil + ps.mypy + ps.ruff + ])) + ]; + }; + } + ) // { + overlays.default = final: prev: { + pythonPackagesExtensions = (prev.pythonPackagesExtensions or []) ++ [ + (python-final: python-prev: { + agentmail = python-final.buildPythonPackage { + pname = "agentmail"; + version = "0.2.10"; + format = "pyproject"; + src = self; + + nativeBuildInputs = [ + python-final.poetry-core + ]; + + propagatedBuildInputs = with python-final; [ + httpx + pydantic + pydantic-core + typing-extensions + websockets + ]; + + pythonImportsCheck = [ "agentmail" ]; + doCheck = false; + }; + }) + ]; + }; + }; +} From 58af4a382a60aeca9d9311bb7d719289fe75bfe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Sun, 1 Feb 2026 19:49:06 -0300 Subject: [PATCH 2/4] feat: add legacy nix-env support via flake-compat --- default.nix | 10 +++++++ flake.lock | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 2 ++ 3 files changed, 90 insertions(+) create mode 100644 default.nix create mode 100644 flake.lock diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..cfffe6b --- /dev/null +++ b/default.nix @@ -0,0 +1,10 @@ +(import + ( + let lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { src = ./.; } +).defaultNix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b935bf4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,78 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1769789167, + "narHash": "sha256-kKB3bqYJU5nzYeIROI82Ef9VtTbu4uA3YydSk/Bioa8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "62c8382960464ceb98ea593cb8321a2cf8f9e3e5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 1606314..52d99e5 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,8 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; + flake-compat.url = "github:edolstra/flake-compat"; + flake-compat.flake = false; }; outputs = { self, nixpkgs, flake-utils }: From 651168e37a6d58086c26144646ef62f6b6022635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Sun, 1 Feb 2026 19:50:57 -0300 Subject: [PATCH 3/4] fix: use nixos-25.11 stable channel --- flake.lock | 8 ++++---- flake.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index b935bf4..cb9b0a4 100644 --- a/flake.lock +++ b/flake.lock @@ -36,16 +36,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1769789167, - "narHash": "sha256-kKB3bqYJU5nzYeIROI82Ef9VtTbu4uA3YydSk/Bioa8=", + "lastModified": 1769900590, + "narHash": "sha256-I7Lmgj3owOTBGuauy9FL6qdpeK2umDoe07lM4V+PnyA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "62c8382960464ceb98ea593cb8321a2cf8f9e3e5", + "rev": "41e216c0ca66c83b12ab7a98cc326b5db01db646", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 52d99e5..fdaa795 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "agentmail - Python SDK"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; flake-utils.url = "github:numtide/flake-utils"; flake-compat.url = "github:edolstra/flake-compat"; flake-compat.flake = false; From 34a2912b95003d4433b1ad514bd3b57295c048c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Sun, 1 Feb 2026 19:54:08 -0300 Subject: [PATCH 4/4] fix: accept flake-compat input in outputs function --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index fdaa795..76a4308 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ flake-compat.flake = false; }; - outputs = { self, nixpkgs, flake-utils }: + outputs = { self, nixpkgs, flake-utils, flake-compat, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system};