templates/python/flake.nix

25 lines
793 B
Nix
Raw Normal View History

2023-12-06 20:07:52 +01:00
{
description = "A bare python flake";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (sys:
let pkgs = nixpkgs.legacyPackages.${sys};
python = pkgs.python310.withPackages (ps: with ps; [
ipython
2024-01-06 19:29:52 +01:00
pylsp-mypy
2023-12-06 20:07:52 +01:00
]);
2024-01-06 19:29:52 +01:00
cfg = ./mypy-config.ini;
2023-12-06 20:07:52 +01:00
in rec {
packages.tychk-watch = pkgs.writeScriptBin "tychk" "echo 'running mypy on change...' ; ${pkgs.watchexec}/bin/watchexec -e py ${python}/bin/mypy --config ${cfg} .";
2024-01-06 19:29:52 +01:00
packages.tychk = pkgs.writeScriptBin "tychk" "${python}/bin/mypy ${./.} --config ${cfg}";
devShells.default = pkgs.mkShell {
packages = [ python ];
};
2023-12-06 20:07:52 +01:00
}
);
}