-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
66 lines (65 loc) · 1.96 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# SPDX-License-Identifier: MPL-2.0-no-copyleft-exception
{
description = "Python version of I/O, Pyrox's Helper bot!";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.devenv.url = "github:cachix/devenv";
inputs.pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.devenv.flakeModule
inputs.pre-commit-hooks-nix.flakeModule
inputs.treefmt-nix.flakeModule
];
flake = {
# Put your original flake attributes here.
};
systems = [
# systems for which you want to build the `perSystem` attributes
"x86_64-linux"
# ...
];
perSystem = {
config,
pkgs,
...
}: {
devenv.shells.default = {
name = "io_bot-shell";
packages = [config.treefmt.build.wrapper pkgs.gcc pkgs.ruff];
languages.nix.enable = true;
languages.python.enable = true;
languages.python.package = pkgs.python311;
languages.python.poetry.enable = true;
languages.python.venv.enable = true;
pre-commit = {
hooks = {
black.enable = false;
ruff.enable = true;
};
};
};
pre-commit = {
check.enable = true;
};
treefmt = {
flakeFormatter = true;
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
black.enable = true;
deadnix.enable = true;
};
settings.formatter = {
ruff = {
command = pkgs.ruff;
includes = ["*.py"];
};
};
};
};
};
}