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 {
|
2023-06-11 00:01:20 +00:00
|
|
|
packages.${system} = {
|
2023-06-20 17:43:28 +00:00
|
|
|
default = pkgs.symlinkJoin {
|
|
|
|
name = "intake-sources";
|
|
|
|
paths = [
|
|
|
|
self.packages.${system}.intake-rss
|
|
|
|
self.packages.${system}.intake-reddit
|
|
|
|
self.packages.${system}.intake-hackernews
|
|
|
|
];
|
|
|
|
};
|
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-12 03:56:51 +00:00
|
|
|
intake-hackernews = pythonPackage "intake-hackernews" ./intake-hackernews [];
|
2023-06-11 00:01:20 +00:00
|
|
|
};
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|