diff --git a/flake.lock b/flake.lock index 40dbe30..8985762 100644 --- a/flake.lock +++ b/flake.lock @@ -18,6 +18,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "make-shell": { "locked": { "lastModified": 1634940815, @@ -33,6 +51,27 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1693660503, + "narHash": "sha256-B/g2V4v6gjirFmy+I5mwB2bCYc0l3j5scVfwgl6WOl8=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "bd5bdbb52350e145c526108f4ef192eb8e554fa0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1698318101, @@ -49,11 +88,36 @@ "type": "github" } }, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_3", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1698640399, + "narHash": "sha256-mXzyx79/iFLZ0UDuSkqgFfejYRcSJfsCnJ9WlMusaI0=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "626111646fe236cb1ddc8191a48c75e072a82b7c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", "make-shell": "make-shell", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "poetry2nix": "poetry2nix" } }, "systems": { @@ -70,6 +134,56 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1697388351, + "narHash": "sha256-63N2eBpKaziIy4R44vjpUu8Nz5fCJY7okKrkixvDQmY=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "aae39f64f5ecbe89792d05eacea5cb241891292a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 53a25c6..77d9b23 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,10 @@ nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; }; + poetry2nix = { + url = "github:nix-community/poetry2nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; flake-utils = { url = "github:numtide/flake-utils"; }; @@ -14,6 +18,7 @@ outputs = { self, nixpkgs, + poetry2nix, flake-utils, make-shell, } @ inputs: @@ -23,12 +28,17 @@ version = self.lastModifiedDate; pkgs = import nixpkgs { inherit system; + config.permittedInsecurePackages = [ + "python3.11-requests-2.29.0" + "python3.11-cryptography-40.0.2" + ]; }; make-shell = import inputs.make-shell { inherit system pkgs; }; + inherit (poetry2nix.lib.mkPoetry2Nix {inherit pkgs;}) mkPoetryApplication overrides; in { - packages.hostapps = pkgs.poetry2nix.mkPoetryApplication { + packages.hostapps = mkPoetryApplication { python = pkgs.python311; projectDir = ./.; propagatedBuildInputs = [ @@ -36,6 +46,25 @@ pkgs.openssh pkgs.sshpass ]; + overrides = overrides.withDefaults ( + self: super: { + pyansi = super.pyansi.overridePythonAttrs ( + old: { + buildInputs = old.buildInputs ++ [self.poetry]; + } + ); + # annotated-types = super.annotated-types.overridePythonAttrs ( + # old: { + # buildInputs = old.buildInputs ++ [self.hatchling]; + # } + # ); + # pydantic-core = super.pydantic-core.overridePythonAttrs ( + # old: { + # buildInputs = old.buildInputs ++ [self.maturin]; + # } + # ); + } + ); }; defaultPackage = self.packages.${system}.hostapps; devShells.default = let diff --git a/poetry.lock b/poetry.lock index fdcff51..34d5ae6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -530,4 +530,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "2d06966ec1ddefe7a4f702a51528bb21612209b0f6d31ca23e7fd6969000c34a" +content-hash = "0f00fce7b8e9105d105a1f4eb94ed491a60930d94b988175ab3843df6e900fff" diff --git a/pyproject.toml b/pyproject.toml index 7cb9363..8281acd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ click = "^8.1.7" pydantic = "^2.4.2" pyansi = { git = "https://git.ocjtech.us/jeff/pyansi" } #pyansi = { path = "/home/jeff/dev/pyansi", develop = true } +requests = "^2.31.0" [tool.poetry.group.dev.dependencies] black = "^23.3.0"