55 lines
1.5 KiB
Nix
55 lines
1.5 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;
|
||
|
ruff.enable = true;
|
||
|
pyright.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 {
|
||
|
inherit (pkgs)
|
||
|
hatch
|
||
|
;
|
||
|
};
|
||
|
buildInputs = builtins.attrValues {
|
||
|
inherit (pkgs)
|
||
|
autoflake
|
||
|
black
|
||
|
pyright
|
||
|
ruff
|
||
|
;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|