63 lines
1.9 KiB
Nix
63 lines
1.9 KiB
Nix
{
|
|
description = "roll - for initiative!";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/master";
|
|
pre-commit.url = "github:cachix/pre-commit-hooks.nix";
|
|
pre-commit.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = inputs@{ flake-parts, ... }:
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
imports = [
|
|
inputs.pre-commit.flakeModule
|
|
];
|
|
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
|
|
perSystem = { config, self', inputs', pkgs, system, ... }:
|
|
let
|
|
package = pkgs.python3.pkgs.buildPythonApplication {
|
|
pname = "roll";
|
|
version = "0.1.0";
|
|
src = ./.;
|
|
format = "pyproject";
|
|
};
|
|
in
|
|
{
|
|
pre-commit.settings.hooks = {
|
|
autoflake.enable = true;
|
|
black.enable = true;
|
|
mypy.enable = true;
|
|
ruff.enable = true;
|
|
};
|
|
pre-commit.settings.settings.mypy.binPath = "${pkgs.python311Packages.mypy}/bin/mypy";
|
|
packages.default = package;
|
|
devShells.default = pkgs.mkShell {
|
|
shellHook = ''
|
|
${config.pre-commit.installationScript}
|
|
echo "welcome to your python project >~(:)=====--" 1>&2
|
|
'';
|
|
nativeBuildInputs = builtins.attrValues {
|
|
inherit (pkgs.python311Packages)
|
|
hatchling
|
|
tomli
|
|
;
|
|
hatch = pkgs.hatch.override {
|
|
python3 = pkgs.python311;
|
|
};
|
|
};
|
|
buildInputs = builtins.attrValues {
|
|
inherit (pkgs)
|
|
autoflake
|
|
black
|
|
pyright
|
|
ruff
|
|
;
|
|
inherit (pkgs.python311Packages)
|
|
ipython
|
|
;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|