Rearrange flake.nix to call mkPoetryEnv directly instead of with mkShell

This commit is contained in:
Jacob Hinkle 2022-09-30 20:13:49 -04:00
parent 1fd60cc4f7
commit 25ab58bcda

View File

@ -26,32 +26,26 @@
python = pkgs.python310; python = pkgs.python310;
in in
{ {
#apps = {
#nancy = pkgs.nancy;
#};
#defaultApp = pkgs.nancy;
defaultPackage = pkgs.nancy; defaultPackage = pkgs.nancy;
devShell =
devShell = pkgs.mkShell { let
e = pkgs.poetry2nix.mkPoetryEnv {
inherit python;
projectDir = ./.;
editablePackageSources = {
nancy = ./src;
};
};
in
e.env.overrideAttrs (oldAttrs: {
buildInputs = with pkgs; with python.pkgs; [ buildInputs = with pkgs; with python.pkgs; [
nixpkgs-fmt nixpkgs-fmt
black black
poetry poetry
pkgs.pre-commit pkgs.pre-commit
sqlite sqlite
(pkgs.poetry2nix.mkPoetryEnv {
inherit python;
projectDir = ./.;
pyproject = ./pyproject.toml;
poetrylock = ./poetry.lock;
editablePackageSources = {
nancy = ./src;
};
})
]; ];
shellHook = "echo 'Execute `poetry shell` to access an environment with an editable install.'"; });
};
})); }));
} }