-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdefault.nix
35 lines (29 loc) · 848 Bytes
/
default.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
{ nixpkgs ? null
, system ? null
, pkgs ? nixpkgs.legacyPackages.${system}
, config ? { }
, extraModules ? [ ]
, checkFiles ? [ ]
}:
assert pkgs != null;
let
toolsModules = builtins.filter (pkgs.lib.hasSuffix ".nix") (pkgs.lib.filesystem.listFilesRecursive ./tools);
modules = [
{ _module.args = { inherit pkgs; }; }
./module.nix
"${pkgs.path}/nixos/modules/misc/assertions.nix"
config
]
++ toolsModules
++ extraModules;
evaluatedModules = pkgs.lib.evalModules { inherit modules; };
check = pkgs.runCommand "nix-formatter-pack-check" { } ''
${evaluatedModules.config.script}/bin/nix-formatter-pack --check ${pkgs.lib.concatStringsSep " " checkFiles}
touch ${placeholder "out"}
'';
in
{
inherit (evaluatedModules.config) script;
inherit (evaluatedModules) config options;
inherit check modules;
}