Skip to content

Commit 4e918e9

Browse files
committed
chore: Add more nix related pre-commit hooks
1 parent 2afb9c8 commit 4e918e9

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.pre-commit-config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ repos:
4040
- nix-command flakes
4141
- --accept-flake-config
4242
- fmt
43+
- id: statix
44+
name: Lint Nix (statix)
45+
types: [nix]
46+
pass_filenames: false
47+
language: system
48+
entry: bash -c 'command -v nix && statix fix "$@" || echo "skipping statix"'
49+
- id: deadnix
50+
name: Lint Nix (deadnix)
51+
types: [nix]
52+
language: system
53+
entry: bash -c 'command -v nix && deadnix --edit "$@" || echo "skipping deadnix"'
4354
- id: taplo-format
4455
name: Format TOML (taplo)
4556
language: system

flake.nix

+3
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@
109109
python3Packages.patchVenvShellHook
110110
python3Packages.autoPatchelfVenvShellHook
111111

112+
deadnix
113+
statix
114+
112115
cargo
113116
rustc
114117

package.nix

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
lib,
33
python3,
4-
fetchFromGitHub,
54
makeWrapper,
65
e2fsprogs-nofortify,
76
erofs-utils,
@@ -38,10 +37,10 @@ let
3837
zstd
3938
lz4
4039
];
41-
pyproject_toml = (builtins.fromTOML (builtins.readFile ./pyproject.toml));
42-
version = pyproject_toml.project.version;
40+
pyproject_toml = builtins.fromTOML (builtins.readFile ./pyproject.toml);
41+
inherit (pyproject_toml.project) version;
4342
in
44-
python3.pkgs.buildPythonApplication rec {
43+
python3.pkgs.buildPythonApplication {
4544
pname = "unblob";
4645
pyproject = true;
4746
disabled = python3.pkgs.pythonOlder "3.9";

0 commit comments

Comments
 (0)