2022-10-21 18:38:19 +00:00
|
|
|
{ lib, fetchFromGitHub, python3 }:
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
self = py;
|
|
|
|
|
|
|
|
# not compatible with prompt_toolkit >=2.0
|
2021-08-05 21:33:18 +00:00
|
|
|
prompt-toolkit = super.prompt-toolkit.overridePythonAttrs (oldAttrs: rec {
|
2020-11-06 00:33:48 +00:00
|
|
|
name = "${oldAttrs.pname}-${version}";
|
|
|
|
version = "1.0.18";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-3U/KAsgGlJetkxotCZFMaw0bUBUc6Ha8Fb3kx0cJASY=";
|
2020-11-06 00:33:48 +00:00
|
|
|
};
|
|
|
|
});
|
2022-01-19 23:45:15 +00:00
|
|
|
# Use click 7
|
2022-06-16 17:23:12 +00:00
|
|
|
click = super.click.overridePythonAttrs (old: rec {
|
|
|
|
version = "7.1.2";
|
|
|
|
src = old.src.override {
|
|
|
|
inherit version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-0rUlXHxjSbwb0eWeCM0SrLvWPOZJ8liHVXg6qU37axo=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
});
|
2020-11-06 00:33:48 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
with py.pkgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "haxor-news";
|
2020-11-06 00:33:48 +00:00
|
|
|
version = "unstable-2020-10-20";
|
|
|
|
|
|
|
|
# haven't done a stable release in 3+ years, but actively developed
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "donnemartin";
|
|
|
|
repo = pname;
|
|
|
|
rev = "811a5804c09406465b2b02eab638c08bf5c4fa7f";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-5v61b49ttwqPOvtoykJBBzwVSi7S8ARlakccMr12bbw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
|
|
|
colorama
|
|
|
|
requests
|
|
|
|
pygments
|
2021-08-05 21:33:18 +00:00
|
|
|
prompt-toolkit
|
2020-04-24 23:36:52 +00:00
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
# will fail without pre-seeded config files
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ unittestCheckHook mock ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
unittestFlagsArray = [ "-s" "tests" "-v" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/donnemartin/haxor-news";
|
|
|
|
description = "Browse Hacker News like a haxor";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|