Skip to content

Commit 1c019ec

Browse files
committed
Pass through all options in run
1 parent f0ee09d commit 1c019ec

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

nix/run.nix

+16-20
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
builtinStuff@{ pkgs, tools, isFlakes, pre-commit, git, runCommand, writeText, writeScript, lib, gitignore-nix-src }:
22

3-
{ src
4-
, settings ? { }
5-
, hooks ? { }
6-
, excludes ? [ ]
7-
, tools ? { }
8-
, default_stages ? [ "pre-commit" ]
9-
, addGcRoot ? true
3+
options@{ src
104
, imports ? [ ]
11-
, configPath ? ".pre-commit-config.yaml"
5+
, tools ? { }
6+
, ...
127
}:
138
let
9+
moduleOptions = builtins.removeAttrs options [ "imports" "tools" ];
10+
1411
project =
1512
lib.evalModules {
1613
modules =
1714
[
1815
../modules/all-modules.nix
1916
{
20-
config =
21-
{
22-
_module.args.pkgs = pkgs;
23-
_module.args.gitignore-nix-src = gitignore-nix-src;
24-
inherit hooks excludes default_stages settings addGcRoot configPath;
25-
tools = builtinStuff.tools // tools;
26-
package = pre-commit;
27-
} // (if isFlakes
28-
then { rootSrc = src; }
29-
else {
30-
rootSrc = gitignore-nix-src.lib.gitignoreSource src;
31-
});
17+
config = moduleOptions //
18+
{
19+
_module.args.pkgs = pkgs;
20+
_module.args.gitignore-nix-src = gitignore-nix-src;
21+
package = lib.mkDefault pre-commit;
22+
tools = lib.mkDefault (builtinStuff.tools // tools);
23+
} // (if isFlakes
24+
then { rootSrc = src; }
25+
else {
26+
rootSrc = gitignore-nix-src.lib.gitignoreSource src;
27+
});
3228
}
3329
] ++ imports;
3430
};

0 commit comments

Comments
 (0)