Refactor python package declarations

This commit is contained in:
Tim Van Baak 2023-06-11 20:55:27 -07:00
parent ef3a0b2881
commit a63fceceb4
1 changed files with 11 additions and 14 deletions

View File

@ -7,29 +7,26 @@
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
pypkgs = pkgs.python38Packages;
pythonPackage = name: path: deps: pypkgs.buildPythonPackage {
inherit name;
src = builtins.path { inherit name path; };
format = "pyproject";
propagatedBuildInputs = [ pypkgs.setuptools ] ++ deps;
};
in { in {
packages.${system} = { packages.${system} = {
intake-rss = pkgs.python38Packages.buildPythonPackage { intake-rss = pythonPackage "intake-rss" ./intake-rss [ pypkgs.feedparser ];
name = "intake-rss"; intake-reddit = pythonPackage "intake-reddit" ./intake-reddit [];
src = builtins.path { path = ./intake-rss; name = "intake-rss"; };
format = "pyproject";
propagatedBuildInputs = with pkgs.python38Packages; [ feedparser setuptools ];
};
intake-reddit = pkgs.python38Packages.buildPythonPackage {
name = "intake-reddit";
src = builtins.path { path = ./intake-reddit; name = "intake-reddit"; };
format = "pyproject";
propagatedBuildInputs = with pkgs.python38Packages; [ setuptools ];
};
}; };
devShells.${system} = { devShells.${system} = {
intake-rss = let python = let
pythonEnv = pkgs.python38.withPackages (pypkgs: with pypkgs; [ black feedparser ]); pythonEnv = pkgs.python38.withPackages (pypkgs: with pypkgs; [ black feedparser ]);
in pkgs.mkShell { in pkgs.mkShell {
packages = [ pythonEnv ]; packages = [ pythonEnv ];
shellHook = '' shellHook = ''
PS1="(intake-rss) $PS1" PS1="(python) $PS1"
''; '';
}; };
}; };