Skip to content

Commit 70f5040

Browse files
authored
Merge pull request cachix#426 from cachix/fix-default-package
Set the default hook package to null
2 parents e35aed5 + 6c2316d commit 70f5040

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

modules/hook.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ in
4646

4747
package = mkOption {
4848
type = types.nullOr types.package;
49+
default = null;
4950
description = lib.mdDoc
5051
''
5152
An optional package that provides the hook.

modules/pre-commit.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ in
138138
Useful for including into the developer environment.
139139
'';
140140

141-
default = builtins.map (hook: hook.package) (lib.filter (hook: hook.enable) (builtins.attrValues config.hooks));
141+
default = builtins.map (hook: hook.package) (lib.filter (hook: hook.enable && hook.package != null) (builtins.attrValues config.hooks));
142142
};
143143

144144
hooks =

0 commit comments

Comments
 (0)