intake-sources/flake.nix

36 lines
957 B
Nix
Raw Normal View History

2023-06-10 20:59:51 +00:00
{
description = "intake feed sources";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/22.11";
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
2023-06-12 03:55:27 +00:00
pypkgs = pkgs.python38Packages;
pythonPackage = name: path: deps: pypkgs.buildPythonPackage {
inherit name;
src = builtins.path { inherit name path; };
format = "pyproject";
propagatedBuildInputs = [ pypkgs.setuptools ] ++ deps;
};
2023-06-10 20:59:51 +00:00
in {
packages.${system} = {
2023-06-12 03:55:27 +00:00
intake-rss = pythonPackage "intake-rss" ./intake-rss [ pypkgs.feedparser ];
intake-reddit = pythonPackage "intake-reddit" ./intake-reddit [];
};
2023-06-10 20:59:51 +00:00
devShells.${system} = {
2023-06-12 03:55:27 +00:00
python = let
2023-06-10 20:59:51 +00:00
pythonEnv = pkgs.python38.withPackages (pypkgs: with pypkgs; [ black feedparser ]);
in pkgs.mkShell {
packages = [ pythonEnv ];
shellHook = ''
2023-06-12 03:55:27 +00:00
PS1="(python) $PS1"
2023-06-10 20:59:51 +00:00
'';
};
};
};
}