From 3278fd431f7e5d76753430219eb1b163c73dfff9 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Tue, 29 Aug 2023 21:25:39 -0500 Subject: [PATCH] update --- flake.lock | 33 ++++++++++++++++++++++---------- flake.nix | 52 ++++++++++++++------------------------------------ pyproject.toml | 2 +- 3 files changed, 38 insertions(+), 49 deletions(-) diff --git a/flake.lock b/flake.lock index 388ede5..b500eaa 100644 --- a/flake.lock +++ b/flake.lock @@ -89,26 +89,40 @@ }, "nixpkgs": { "locked": { - "lastModified": 1693231525, - "narHash": "sha256-Zmh8m0HHcgGBDth6jdJPmc4UAAP0L4jQmqIztywF1Iw=", + "lastModified": 1693250523, + "narHash": "sha256-y3up5gXMTbnCsXrNEB5j+7TVantDLUYyQLu/ueiXuyg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c540061ac8d72d6e6d99345bd2d590c82b2f58c1", + "rev": "3efb0f6f404ec8dae31bdb1a9b17705ce0d6986e", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-23.05", + "ref": "nixos-unstable", "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": { "inputs": { "flake-utils": "flake-utils_2", "nix-github-actions": "nix-github-actions", - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1693051011, @@ -119,9 +133,8 @@ "type": "github" }, "original": { - "owner": "nix-community", - "repo": "poetry2nix", - "type": "github" + "id": "poetry2nix", + "type": "indirect" } }, "root": { diff --git a/flake.nix b/flake.nix index e47c2b4..e9b7a4d 100644 --- a/flake.nix +++ b/flake.nix @@ -3,12 +3,12 @@ inputs = { nixpkgs = { - url = "nixpkgs/nixos-23.05"; - }; - poetry2nix = { - url = "github:nix-community/poetry2nix"; - inputs.nixpkgs.follows = "nixpkgs"; + url = "nixpkgs/nixos-unstable"; }; + # poetry2nix = { + # url = "github:nix-community/poetry2nix"; + # inputs.nixpkgs.follows = "nixpkgs"; + # }; flake-utils = { url = "github:numtide/flake-utils"; }; @@ -23,10 +23,13 @@ flake-utils.lib.eachDefaultSystem (system: let - inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication overrides; + # inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication overrides; pkgs = import nixpkgs { inherit system; }; + python = pkgs.python311.withPackages (ps: with ps; [ + poetry-core + ]); in { devShells.default = @@ -35,9 +38,6 @@ inherit system; pkgs = pkgs; }; - python = pkgs.python311.withPackages (ps: with ps; [ - poetry-core - ]); project = "greendeck"; prompt = ( bash.build_prompt @@ -64,9 +64,10 @@ ''; }; packages = { - greendeck = mkPoetryApplication { + greendeck = pkgs.poetry2nix.mkPoetryApplication { python = pkgs.python311; projectDir = ./.; + groups = [ ]; propagatedBuildInputs = [ pkgs.hidapi ]; @@ -76,7 +77,7 @@ 'os.getenv("HIDAPI_LIBRARY")' \ '"${pkgs.hidapi}/lib/libhidapi-libusb.so.0"' ''; - overrides = overrides.withDefaults + overrides = pkgs.poetry2nix.overrides.withDefaults ( self: super: { wand = super.wand.overridePythonAttrs @@ -91,41 +92,16 @@ propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.imagemagickBig ]; } ); - # types-deprecated = super.types-deprecated.overridePythonAttrs ( - # old: { - # buildInputs = old.buildInputs ++ [ pkgs.python3Packages.setuptools ]; - # } - # ); pydantic-yaml = super.pydantic-yaml.overridePythonAttrs ( 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 ( 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 ]; - # } - # ); } ); }; diff --git a/pyproject.toml b/pyproject.toml index c96a690..8a16844 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ flake8-pyproject = "^1.2.3" isort = "^5.12.0" [build-system] -requires = ["poetry-core==1.6.1"] +requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.black]