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