]> Git — Sourcephile - sourcephile-nix.git/blob - modules.nix
public-inbox: test sur mermet
[sourcephile-nix.git] / modules.nix
1 { pkgs, lib, config, ... }:
2 # NOTE: list explicitely the modules loaded by defaults.nix,
3 # its clearer, safer and more flexible if not quicker.
4 {
5 imports = [
6 modules/services/networking/domains.nix
7 #modules/services/networking/knot.nix
8 modules/services/databases/openldap.nix
9 modules/services/mail/public-inbox.nix
10 ];
11 disabledModules = [
12 "services/mail/public-inbox.nix"
13 ];
14 }
15
16 /*
17 # NOTE: this modules.nix file is put in the imports of the configuration.nix,
18 # but using the lib.findFiles defined in the nixpkgs.overlays leads to an infinite recursion,
19 # hence it is redefined here:
20 let findFiles = pattern:
21 with builtins;
22 let go = curr:
23 let dir = readDir curr; in
24 let files = lib.filterAttrs (name: type:
25 type == "regular" &&
26 match pattern name != null) dir; in
27 let dirs = lib.filterAttrs (name: type: type == "directory") dir; in
28 map (name: "${curr}/${name}") (attrNames files) ++
29 lib.concatMap (name: go "${curr}/${name}") (attrNames dirs)
30 ;
31 in go ;
32 in
33 {
34 imports = findFiles ".*\\.nix" ./modules;
35 }
36 */