roll/flake.nix

62 lines
1.8 KiB
Nix
Raw Normal View History

2023-08-10 01:02:53 +00:00
{
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;
2023-08-13 18:54:11 +00:00
# mypy.enable = true;
2023-08-10 01:02:53 +00:00
ruff.enable = true;
};
packages.default = package;
devShells.default = pkgs.mkShell {
shellHook = ''
${config.pre-commit.installationScript}
echo "welcome to your python project >~(:)=====--" 1>&2
'';
nativeBuildInputs = builtins.attrValues {
2023-08-11 20:05:51 +00:00
inherit (pkgs.python311Packages)
hatchling
tomli
2023-08-10 01:02:53 +00:00
;
2023-08-11 20:05:51 +00:00
hatch = pkgs.hatch.override {
python3 = pkgs.python311;
};
2023-08-10 01:02:53 +00:00
};
buildInputs = builtins.attrValues {
inherit (pkgs)
autoflake
black
pyright
ruff
;
2023-08-11 20:05:51 +00:00
inherit (pkgs.python311Packages)
ipython
;
2023-08-10 01:02:53 +00:00
};
};
};
};
}