This commit is contained in:
Jeffrey C. Ollie 2023-08-29 21:25:39 -05:00
parent df62d68e15
commit 3278fd431f
Signed by: jeff
GPG key ID: 6F86035A6D97044E
3 changed files with 38 additions and 49 deletions

View file

@ -89,26 +89,40 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1693231525, "lastModified": 1693250523,
"narHash": "sha256-Zmh8m0HHcgGBDth6jdJPmc4UAAP0L4jQmqIztywF1Iw=", "narHash": "sha256-y3up5gXMTbnCsXrNEB5j+7TVantDLUYyQLu/ueiXuyg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c540061ac8d72d6e6d99345bd2d590c82b2f58c1", "rev": "3efb0f6f404ec8dae31bdb1a9b17705ce0d6986e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-23.05", "ref": "nixos-unstable",
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1693250523,
"narHash": "sha256-y3up5gXMTbnCsXrNEB5j+7TVantDLUYyQLu/ueiXuyg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3efb0f6f404ec8dae31bdb1a9b17705ce0d6986e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"poetry2nix": { "poetry2nix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"nix-github-actions": "nix-github-actions", "nix-github-actions": "nix-github-actions",
"nixpkgs": [ "nixpkgs": "nixpkgs_2"
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1693051011, "lastModified": 1693051011,
@ -119,9 +133,8 @@
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "id": "poetry2nix",
"repo": "poetry2nix", "type": "indirect"
"type": "github"
} }
}, },
"root": { "root": {

View file

@ -3,12 +3,12 @@
inputs = { inputs = {
nixpkgs = { nixpkgs = {
url = "nixpkgs/nixos-23.05"; url = "nixpkgs/nixos-unstable";
};
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
}; };
# poetry2nix = {
# url = "github:nix-community/poetry2nix";
# inputs.nixpkgs.follows = "nixpkgs";
# };
flake-utils = { flake-utils = {
url = "github:numtide/flake-utils"; url = "github:numtide/flake-utils";
}; };
@ -23,10 +23,13 @@
flake-utils.lib.eachDefaultSystem flake-utils.lib.eachDefaultSystem
(system: (system:
let let
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication overrides; # inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication overrides;
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
}; };
python = pkgs.python311.withPackages (ps: with ps; [
poetry-core
]);
in in
{ {
devShells.default = devShells.default =
@ -35,9 +38,6 @@
inherit system; inherit system;
pkgs = pkgs; pkgs = pkgs;
}; };
python = pkgs.python311.withPackages (ps: with ps; [
poetry-core
]);
project = "greendeck"; project = "greendeck";
prompt = ( prompt = (
bash.build_prompt bash.build_prompt
@ -64,9 +64,10 @@
''; '';
}; };
packages = { packages = {
greendeck = mkPoetryApplication { greendeck = pkgs.poetry2nix.mkPoetryApplication {
python = pkgs.python311; python = pkgs.python311;
projectDir = ./.; projectDir = ./.;
groups = [ ];
propagatedBuildInputs = [ propagatedBuildInputs = [
pkgs.hidapi pkgs.hidapi
]; ];
@ -76,7 +77,7 @@
'os.getenv("HIDAPI_LIBRARY")' \ 'os.getenv("HIDAPI_LIBRARY")' \
'"${pkgs.hidapi}/lib/libhidapi-libusb.so.0"' '"${pkgs.hidapi}/lib/libhidapi-libusb.so.0"'
''; '';
overrides = overrides.withDefaults overrides = pkgs.poetry2nix.overrides.withDefaults
( (
self: super: { self: super: {
wand = super.wand.overridePythonAttrs wand = super.wand.overridePythonAttrs
@ -91,41 +92,16 @@
propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.imagemagickBig ]; propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.imagemagickBig ];
} }
); );
# types-deprecated = super.types-deprecated.overridePythonAttrs (
# old: {
# buildInputs = old.buildInputs ++ [ pkgs.python3Packages.setuptools ];
# }
# );
pydantic-yaml = super.pydantic-yaml.overridePythonAttrs ( pydantic-yaml = super.pydantic-yaml.overridePythonAttrs (
old: { old: {
buildInputs = old.buildInputs ++ [ pkgs.python311Packages.setuptools ]; buildInputs = old.buildInputs ++ [ super.setuptools ];
} }
); );
# pydocstyle = super.pydocstyle.overridePythonAttrs (
# old: {
# buildInputs = old.buildInputs ++ [
# # pkgs.python3Packages.poetry-core
# ];
# }
# );
# pydocstringformatter = super.pydocstringformatter.overridePythonAttrs (
# old: {
# buildInputs = old.buildInputs ++ [
# pkgs.python3Packages.poetry-core
# pkgs.python3Packages.setuptools
# ];
# }
# );
asyncdbus = super.asyncdbus.overridePythonAttrs ( asyncdbus = super.asyncdbus.overridePythonAttrs (
old: { old: {
buildInputs = old.buildInputs ++ [ pkgs.python311Packages.setuptools-scm ]; buildInputs = old.buildInputs ++ [ super.setuptools-scm ];
} }
); );
# Pillow = super.Pillow.overridePythonAttrs (
# old: {
# buildInputs = old.buildInputs ++ [ pkgs.python311Packages.setuptools-scm ];
# }
# );
} }
); );
}; };

View file

@ -33,7 +33,7 @@ flake8-pyproject = "^1.2.3"
isort = "^5.12.0" isort = "^5.12.0"
[build-system] [build-system]
requires = ["poetry-core==1.6.1"] requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"
[tool.black] [tool.black]