diff --git a/.gitignore b/.gitignore index 7345251..9bbe995 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,7 @@ devenv.local.nix config.ini *.pfx *.crt -*.pem \ No newline at end of file +*.pem + +# nix +result \ No newline at end of file diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..f9190fb --- /dev/null +++ b/default.nix @@ -0,0 +1,31 @@ +{ pkgs ? import { } +, lib ? pkgs.lib +, +}: + +pkgs.python3Packages.buildPythonPackage rec { + pname = "smtprd-ng"; + version = "git"; + pyproject = true; + + src = lib.cleanSource ./.; + + build-system = [ pkgs.python3Packages.setuptools ]; + + dependencies = with pkgs.python3Packages; [ + aiosmtpd + aiosmtplib + m2crypto + cryptography + ]; + + pythonImportsCheck = [ "smtprd_ng" ]; + + meta = { + description = "SMTP forwarding relay daemon with signing and encryption"; + homepage = "https://app.radicle.xyz/nodes/seed.radicle.garden/rad:z3gWc1qgaeZaoGwL4WTstLNoqjayM"; + license = lib.licenses.agpl3Only; + maintainers = [ lib.maintainers.gador ]; + }; + +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ff108a8 --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1720087678, + "narHash": "sha256-uOhYJU3ldDKXYV+mFaXcPtyjq/UIMh/6SCuoVNU9rxM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1afc5440469f94e7ed26e8648820971b102afdc3", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixpkgs-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "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 new file mode 100644 index 0000000..03ca8eb --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + description = "SMTP forwarding relay daemon with signing and encryption"; + + inputs = { + nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { self + , nixpkgs + , flake-utils + , + }: + let + supportedSystems = [ + "x86_64-linux" + "aarch64-darwin" + ]; + in + { + overlays.default = import ./overlay.nix { inherit self; }; + } + // flake-utils.lib.eachSystem supportedSystems ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + packages = { + smtprd-ng = pkgs.callPackage ./. { }; + }; + + packages.default = self.packages.${system}.smtprd-ng; + + apps.default = { + type = "app"; + program = "${self.packages.${system}.smtprd-ng}/bin/smtprd-ng"; + }; + } + ); +} diff --git a/overlay.nix b/overlay.nix new file mode 100644 index 0000000..633c971 --- /dev/null +++ b/overlay.nix @@ -0,0 +1,4 @@ +{ self }: +_final: prev: { + smtprd-ng = self.packages.${prev.system}.smtprd-ng; +}