intake-sources/flake.nix

64 lines
1.8 KiB
Nix
Raw Normal View History

2023-06-10 20:59:51 +00:00
{
description = "intake feed sources";
2024-06-28 15:45:02 +00:00
inputs.nixpkgs.url = "github:NixOS/nixpkgs/24.05";
2023-06-10 20:59:51 +00:00
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
in {
2023-06-20 18:46:41 +00:00
packages.${system} = let
pkgs = (import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
});
in {
default = pkgs.intakeSources;
2023-07-03 01:10:46 +00:00
inherit (pkgs) intake-rss intake-reddit intake-hackernews intake-echo intake-praw;
};
2023-06-10 20:59:51 +00:00
devShells.${system} = {
2023-06-12 03:55:27 +00:00
python = let
2023-06-20 18:46:41 +00:00
pkgs = nixpkgs.legacyPackages.${system};
2024-06-28 15:40:45 +00:00
pythonEnv = pkgs.python3.withPackages (pypkgs: with pypkgs; [ black feedparser praw ]);
2023-06-10 20:59:51 +00:00
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
'';
};
};
2023-06-20 18:46:41 +00:00
overlays.default = final: prev: let
2024-06-28 15:40:45 +00:00
pythonPackage = name: path: deps: final.python3Packages.buildPythonPackage {
2023-06-20 18:46:41 +00:00
inherit name;
src = builtins.path { inherit name path; };
format = "pyproject";
2024-06-28 15:40:45 +00:00
propagatedBuildInputs = [ final.python3Packages.setuptools ] ++ deps;
2023-06-20 18:46:41 +00:00
};
in
{
intakeSources = final.symlinkJoin {
name = "intake-sources";
paths = [
final.intake-rss
final.intake-reddit
final.intake-hackernews
2023-06-25 04:45:23 +00:00
final.intake-echo
2023-07-03 01:10:46 +00:00
final.intake-praw
2023-06-20 18:46:41 +00:00
];
};
2024-06-28 15:40:45 +00:00
intake-rss = pythonPackage "intake-rss" ./intake-rss [ final.python3Packages.feedparser ];
2023-06-20 18:46:41 +00:00
intake-reddit = pythonPackage "intake-reddit" ./intake-reddit [];
intake-hackernews = pythonPackage "intake-hackernews" ./intake-hackernews [];
2023-06-25 04:45:23 +00:00
intake-echo = pythonPackage "intake-echo" ./intake-echo [];
2024-06-28 15:40:45 +00:00
intake-praw = pythonPackage "intake-praw" ./intake-praw [ final.python3Packages.praw ];
2023-06-20 18:46:41 +00:00
};
nixosModules.default = {
nixpkgs.overlays = [ self.overlays.default ];
};
2023-06-10 20:59:51 +00:00
};
}