Commit c8673ea 1 parent 872b09a commit c8673ea Copy full SHA for c8673ea
File tree 2 files changed +47
-23
lines changed
2 files changed +47
-23
lines changed Original file line number Diff line number Diff line change 60
60
systems = import inputs . systems ;
61
61
62
62
imports = [
63
+ ./modules
63
64
inputs . lite-config . flakeModule
64
65
inputs . treefmt-nix . flakeModule
65
66
] ;
149
150
nixosTests-hydra = pkgs . nixosTests . hydra . hydra ;
150
151
} ;
151
152
} ;
152
-
153
- flake . darwinModules = {
154
- builder = ./modules/darwin/builder.nix ;
155
- community-builder = ./modules/darwin/community-builder ;
156
- hercules-ci = ./modules/darwin/hercules-ci.nix ;
157
- remote-builder = ./modules/darwin/remote-builder.nix ;
158
- } ;
159
-
160
- flake . nixosModules = {
161
- backup = ./modules/nixos/backup.nix ;
162
- buildbot = ./modules/nixos/buildbot.nix ;
163
- builder = ./modules/nixos/builder.nix ;
164
- community-builder = ./modules/nixos/community-builder ;
165
- disko-zfs = ./modules/nixos/disko-zfs.nix ;
166
- github-org-backup = ./modules/nixos/github-org-backup.nix ;
167
- hercules-ci = ./modules/nixos/hercules-ci.nix ;
168
- hydra = ./modules/nixos/hydra.nix ;
169
- monitoring = ./modules/nixos/monitoring ;
170
- nginx = ./modules/nixos/nginx.nix ;
171
- nur-update = ./modules/nixos/nur-update.nix ;
172
- remote-builder = ./modules/nixos/remote-builder.nix ;
173
- watch-store = ./modules/nixos/watch-store.nix ;
174
- } ;
175
153
} ;
176
154
}
Original file line number Diff line number Diff line change
1
+ { inputs , lib , ... } :
2
+ # https://github.com/numtide/blueprint/blob/19df68dde6fe1aeaf15c747b16708136b40d2ab7/lib/default.nix
3
+ let
4
+ importDir =
5
+ path : fn :
6
+ let
7
+ entries = builtins . readDir path ;
8
+
9
+ onlyDirs = lib . filterAttrs (
10
+ name : type :
11
+ type == "directory"
12
+ &&
13
+ # filter `common` dir
14
+ ( name != "common" )
15
+ ) entries ;
16
+ dirPaths = lib . mapAttrs ( name : type : {
17
+ path = path + "/${ name } " ;
18
+ inherit type ;
19
+ } ) onlyDirs ;
20
+
21
+ nixPaths = builtins . removeAttrs ( lib . mapAttrs' (
22
+ name : type :
23
+ let
24
+ nixName = builtins . match "(.*)\\ .nix" name ;
25
+ in
26
+ {
27
+ name = if type == "directory" || nixName == null then "__junk" else ( builtins . head nixName ) ;
28
+ value = {
29
+ path = path + "/${ name } " ;
30
+ inherit type ;
31
+ } ;
32
+ }
33
+ ) entries ) [ "__junk" ] ;
34
+
35
+ combined = dirPaths // nixPaths ;
36
+ in
37
+ lib . optionalAttrs ( builtins . pathExists path ) ( fn combined ) ;
38
+
39
+ modules = path : importDir path ( lib . mapAttrs ( _name : { path , type } : path ) ) ;
40
+ in
41
+ {
42
+ flake = {
43
+ darwinModules = modules "${ inputs . self } /modules/darwin" ;
44
+ nixosModules = modules "${ inputs . self } /modules/nixos" ;
45
+ } ;
46
+ }
You can’t perform that action at this time.
0 commit comments