-
Notifications
You must be signed in to change notification settings - Fork 6
/
per-system.nix
93 lines (80 loc) · 2.55 KB
/
per-system.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
({ self, inputs, ... }:
{
perSystem = { self', config, system, pkgs, lib, ... }:
let
mkNixpkgs = nixpkgs:
import nixpkgs {
inherit system;
overlays = [
inputs.nix-extra.overlays.default
(final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(_: pythonPrev: {
"fractopo" = pythonPrev.fractopo.overridePythonAttrs
# Test with local source
(_: { src = self.outPath; });
})
];
inherit (final.python3Packages) fractopo;
})
];
config = { allowUnfree = true; };
};
in {
_module.args.pkgs = mkNixpkgs inputs.nixpkgs;
devShells = let
devShellPackages = with pkgs; [
pre-commit
pandoc
poetry-with-c-tooling
];
in {
default = pkgs.mkShell {
packages = devShellPackages;
shellHook = config.pre-commit.installationScript + ''
export PROJECT_DIR="$PWD"
'';
};
};
pre-commit = {
check.enable = true;
settings.hooks = {
nixfmt.enable = true;
black.enable = true;
black-nb.enable = true;
nbstripout.enable = true;
isort = { enable = true; };
shellcheck.enable = true;
statix.enable = true;
deadnix.enable = true;
rstcheck.enable = true;
trim-trailing-whitespace.enable = true;
check-added-large-files.enable = true;
sync-git-tag-with-poetry.enable = false;
editorconfig-checker.enable = true;
cogapp = {
enable = true;
raw = { args = [ "docs_src/index.rst" ]; };
};
yamllint = {
enable = false;
raw = { args = lib.mkBefore [ "-d" "relaxed" ]; };
};
commitizen.enable = true;
ruff = { enable = true; };
prettier = {
enable = true;
files = "\\.(geojson)$";
};
};
};
packages = {
inherit (pkgs) fractopo poetry-run;
fractopo-documentation =
self'.packages.fractopo.passthru.documentation.doc;
default = self'.packages.fractopo;
};
checks = self'.packages;
legacyPackages = pkgs;
};
})