]> Git — Sourcephile - sourcephile-nix.git/blob - nixos/modules.nix
dovecot: enable multi-domains
[sourcephile-nix.git] / nixos / 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/databases/openldap.nix
8 ];
9 }
10
11 /*
12 # NOTE: this modules.nix file is put in the imports of the configuration.nix,
13 # but using the lib.findFiles defined in the nixpkgs.overlays leads to an infinite recursion,
14 # hence it is redefined here:
15 let findFiles = pattern:
16 with builtins;
17 let go = curr:
18 let dir = readDir curr; in
19 let files = lib.filterAttrs (name: type:
20 type == "regular" &&
21 match pattern name != null) dir; in
22 let dirs = lib.filterAttrs (name: type: type == "directory") dir; in
23 map (name: "${curr}/${name}") (attrNames files) ++
24 lib.concatMap (name: go "${curr}/${name}") (attrNames dirs)
25 ;
26 in go ;
27 in
28 {
29 imports = findFiles ".*\\.nix" ./modules;
30 }
31 */