blob: 80eefe015ea290daaa9734c53a61f8abfeaa7f9f (
plain)
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
|
{ inputs, self, ... }:
{
perSystem =
{ pkgs, system, ... }:
{
devShells.common = pkgs.mkShellNoCC {
name = "common";
packages = [
pkgs.nixd
];
shellHook = ''
hooksdir="$(git rev-parse --show-toplevel)/root/hooks"
if [ ! -d "$hooksdir" ]; then
echo "error: hooks directory not found at $hooksdir"
exit 1
fi
git config set core.hooksPath "$hooksdir"
'';
};
devShells.root =
let
treefmt = pkgs.callPackage ./_treefmt.nix { treefmt-nix = inputs.treefmt-nix; };
in
pkgs.mkShellNoCC {
name = "root";
inputsFrom = [ self.devShells."${system}".common ];
packages = [
# keep-sorted start
(pkgs.python3.withPackages (ps: [ ps.git-filter-repo ]))
pkgs.ty
treefmt
# keep-sorted end
];
shellHook = ''
export TREEFMT_WORKING_DIR="$("${pkgs.git}/bin/git" rev-parse --show-toplevel)"
'';
};
};
}
|