karlicoss/hpi/flake.nix
Anish Lakhwara 420fa36d15 hpi flake
2022-03-22 11:25:34 +10:00

64 lines
2.2 KiB
Nix

{
description = "Reproducible Environment for anish.lakhwara.com";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
hpi = pkgs.python39Packages.buildPythonPackage rec {
pname = "HPI";
version = "v0.3.20220202";
src = pkgs.fetchgit {
rev = "e750666e30e8987f3a4c46755857dc85dd64446c";
url = "https://github.com/karlicoss/HPI";
sha256 = "sha256-CHrlVG7H2Gzhc2gcAOwWNSivje9K3/tJYA7BQWvSyuQ=";
leaveDotGit = true;
};
nativeBuildInputs = [ python-with-my-packages pkgs.git ];
propagatedBuildInputs = [ python-with-my-packages ];
doCheck = false;
pythonImportsCheck = [ "my.core" ];
meta = with pkgs.lib; {
description = "";
homepage = "https://github.com/karlicoss/HPI";
# license = with licenses; [ mit ];
maintainers = with maintainers; [ chickensoupwithrice ];
};
};
python-with-my-packages = pkgs.python39.withPackages (p: with p; [
pytz # even though it's not needed by the core, it's so common anyway...
appdirs # very common, and makes it portable
more-itertools # it's just too useful and very common anyway
decorator # less pain in writing correct decorators. very mature and stable, so worth keeping in core
click
setuptools-scm
pytest
geopy
mypy
]);
in
{
devShell = pkgs.mkShell {
buildInputs = [
python-with-my-packages
hpi
];
shellHook = ''
PYTHONPATH=${python-with-my-packages}/${python-with-my-packages.sitePackages}
# This only works when you have ~/vimwiki locally, since I'm not putting my unfiltered kitaab online
alias build='python3 src/kitaab-public/main.py'
# maybe set more env-vars
'';
};
defaultPackage = hpi;
});
}