A Python port of the Invisible Internet Project (I2P)
at main 76 lines 1.9 kB view raw
1{ 2 description = "I2P anonymous network router Python implementation"; 3 4 inputs = { 5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 flake-utils.url = "github:numtide/flake-utils"; 7 }; 8 9 outputs = { self, nixpkgs, flake-utils }: 10 flake-utils.lib.eachDefaultSystem (system: 11 let 12 pkgs = import nixpkgs { inherit system; }; 13 python = pkgs.python3; 14 15 i2p-python = python.pkgs.buildPythonApplication { 16 pname = "i2p-python"; 17 version = "0.1.0"; 18 pyproject = true; 19 20 src = ./.; 21 22 build-system = [ python.pkgs.hatchling ]; 23 24 dependencies = with python.pkgs; [ 25 cryptography 26 pynacl 27 flask 28 ]; 29 30 nativeCheckInputs = with python.pkgs; [ 31 pytestCheckHook 32 pytest-asyncio 33 pytest-timeout 34 ]; 35 36 # Skip tests that need network or containers 37 disabledTestPaths = [ 38 "tests/test_integration" 39 ]; 40 41 pythonImportsCheck = [ 42 "i2p_router" 43 "i2p_sam" 44 "i2p_data" 45 "i2p_crypto" 46 "i2p_transport" 47 "i2p_apps" 48 ]; 49 50 meta = with pkgs.lib; { 51 description = "Complete I2P anonymous network implementation in Python"; 52 license = licenses.mit; 53 mainProgram = "i2p-router"; 54 }; 55 }; 56 in 57 { 58 packages = { 59 default = i2p-python; 60 inherit i2p-python; 61 }; 62 63 devShells.default = pkgs.mkShell { 64 inputsFrom = [ i2p-python ]; 65 packages = with python.pkgs; [ 66 pytest 67 pytest-cov 68 pytest-asyncio 69 pytest-timeout 70 ]; 71 }; 72 } 73 ) // { 74 nixosModules.default = import ./nix/module.nix self; 75 }; 76}