This commit is contained in:
Jeffrey C. Ollie 2023-10-30 15:48:40 -05:00
parent 7d70e72516
commit a68a8dee5b
Signed by: jeff
GPG key ID: 6F86035A6D97044E
4 changed files with 147 additions and 3 deletions

View file

@ -18,6 +18,24 @@
"type": "github" "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": { "make-shell": {
"locked": { "locked": {
"lastModified": 1634940815, "lastModified": 1634940815,
@ -33,6 +51,27 @@
"type": "github" "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1698318101, "lastModified": 1698318101,
@ -49,11 +88,36 @@
"type": "github" "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": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"make-shell": "make-shell", "make-shell": "make-shell",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"poetry2nix": "poetry2nix"
} }
}, },
"systems": { "systems": {
@ -70,6 +134,56 @@
"repo": "default", "repo": "default",
"type": "github" "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", "root": "root",

View file

@ -4,6 +4,10 @@
nixpkgs = { nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable"; url = "github:nixos/nixpkgs/nixos-unstable";
}; };
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils = { flake-utils = {
url = "github:numtide/flake-utils"; url = "github:numtide/flake-utils";
}; };
@ -14,6 +18,7 @@
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
poetry2nix,
flake-utils, flake-utils,
make-shell, make-shell,
} @ inputs: } @ inputs:
@ -23,12 +28,17 @@
version = self.lastModifiedDate; version = self.lastModifiedDate;
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
config.permittedInsecurePackages = [
"python3.11-requests-2.29.0"
"python3.11-cryptography-40.0.2"
];
}; };
make-shell = import inputs.make-shell { make-shell = import inputs.make-shell {
inherit system pkgs; inherit system pkgs;
}; };
inherit (poetry2nix.lib.mkPoetry2Nix {inherit pkgs;}) mkPoetryApplication overrides;
in { in {
packages.hostapps = pkgs.poetry2nix.mkPoetryApplication { packages.hostapps = mkPoetryApplication {
python = pkgs.python311; python = pkgs.python311;
projectDir = ./.; projectDir = ./.;
propagatedBuildInputs = [ propagatedBuildInputs = [
@ -36,6 +46,25 @@
pkgs.openssh pkgs.openssh
pkgs.sshpass 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; defaultPackage = self.packages.${system}.hostapps;
devShells.default = let devShells.default = let

2
poetry.lock generated
View file

@ -530,4 +530,4 @@ zstd = ["zstandard (>=0.18.0)"]
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = "^3.11" python-versions = "^3.11"
content-hash = "2d06966ec1ddefe7a4f702a51528bb21612209b0f6d31ca23e7fd6969000c34a" content-hash = "0f00fce7b8e9105d105a1f4eb94ed491a60930d94b988175ab3843df6e900fff"

View file

@ -11,6 +11,7 @@ click = "^8.1.7"
pydantic = "^2.4.2" pydantic = "^2.4.2"
pyansi = { git = "https://git.ocjtech.us/jeff/pyansi" } pyansi = { git = "https://git.ocjtech.us/jeff/pyansi" }
#pyansi = { path = "/home/jeff/dev/pyansi", develop = true } #pyansi = { path = "/home/jeff/dev/pyansi", develop = true }
requests = "^2.31.0"
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
black = "^23.3.0" black = "^23.3.0"