From f7ba11a1cdb8b6b1b2de22931b81a5ab3c692339 Mon Sep 17 00:00:00 2001 From: Istvan Ruzman Date: Sun, 30 Aug 2020 14:52:25 +0200 Subject: [PATCH] update shell.nix and use poetry2nix in default.nix --- default.nix | 20 ++++++-------------- shell.nix | 34 ++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/default.nix b/default.nix index 5f81ad5..f47e21a 100644 --- a/default.nix +++ b/default.nix @@ -1,15 +1,7 @@ -{pkgs, python, ...}: - -python.pkgs.buildPythonPackage rec { - pname = "pyrad"; - version = "1.0-alpha"; - - buildInputs = with python.pkgs; [ ]; - - checkInputs = with python.pkgs; [ - black - pytest - # pytest-cov - ]; -} +{ pkgs ? import {} }: +let + app = pkgs.poetry2nix.mkPoetryApplication { + projectDir = ./.; + }; +in app.dependencyEnv diff --git a/shell.nix b/shell.nix index e509ebd..1029c5b 100644 --- a/shell.nix +++ b/shell.nix @@ -3,20 +3,26 @@ in pkgs.mkShell { buildInputs = with pkgs; [ git nixfmt - pkgs.python37 - pkgs.python38 - pkgs.python3 - pkgs.python3Packages.coveralls - pkgs.python3Packages.black - pkgs.python3Packages.poetry - pkgs.python3Packages.pytest - pkgs.python3Packages.pytest-black - pkgs.python3Packages.pytestcov - pkgs.python3Packages.pytest-flake8 - pkgs.python3Packages.pytest-isort - pkgs.python3Packages.pytest-mypy - pkgs.python3Packages.pytest-pylint - pkgs.python3Packages.tox + gnumake + python3 + python37 + python37Packages.virtualenv + python38 + python38Packages.virtualenv + python39 + python39Packages.virtualenv + python3Packages.black + python3Packages.coveralls + python3Packages.poetry + python3Packages.pytest + python3Packages.pytest-black + python3Packages.pytestcov + python3Packages.pytest-flake8 + python3Packages.pytest-isort + python3Packages.pytest-mypy + python3Packages.pytest-pylint + python3Packages.sphinx + python3Packages.tox ]; shellHook = ''