From b4fe79fdcebffacb96febe2e48f27c61ef07ed32 Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Mon, 12 Feb 2024 19:58:24 +0400 Subject: [PATCH] devshell: add black, mypy and corresponding python-lsp-server plugins --- flake.nix | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index f1a317a..1dc3d80 100644 --- a/flake.nix +++ b/flake.nix @@ -7,8 +7,9 @@ let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; + pythonPackages = pkgs.python310Packages; selfprivacy-graphql-api = pkgs.callPackage ./default.nix { - pythonPackages = pkgs.python310Packages; + inherit pythonPackages; rev = self.shortRev or self.dirtyShortRev or "dirty"; }; python = self.packages.${system}.default.pythonModule; @@ -71,15 +72,26 @@ import ./nixos/module.nix self.packages.${system}.default; devShells.${system}.default = pkgs.mkShell { name = "SP API dev shell"; - packages = with pkgs; [ - python-env - rclone - redis - restic - self.packages.${system}.pytest-vm - # FIXME consider loading this explicitly only after ArchLinux issue is solved - self.checks.x86_64-linux.default.driverInteractive - ]; + packages = with pythonPackages; + [ + black + mypy + pylsp-mypy + python-lsp-black + python-lsp-server + ] ++ + (with pkgs; + [ + nixpkgs-fmt + rclone + redis + restic + self.packages.${system}.pytest-vm + # FIXME consider loading this explicitly only after ArchLinux issue is solved + self.checks.x86_64-linux.default.driverInteractive + # the target API application python environment + python-env + ]); shellHook = '' # envs set with export and as attributes are treated differently. # for example. printenv will not fetch the value of an attribute.