mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
refactor: dynamic module generation
This commit is contained in:
parent
c5042ac840
commit
5753eb1e11
7 changed files with 14 additions and 110 deletions
|
|
@ -52,6 +52,7 @@
|
|||
mkHalfHostConfigs = hosts: type: pkgs: lib.foldl (acc: set: acc // set) { } (lib.map (host: lib.swarselsystems.mkHalfHost host type pkgs) hosts);
|
||||
|
||||
readHosts = type: lib.attrNames (builtins.readDir "${self}/hosts/${type}");
|
||||
readNix = type: lib.filter (name: name != "default.nix") (lib.attrNames (builtins.readDir "${self}/${type}"));
|
||||
|
||||
mkApps = system: names: self: builtins.listToAttrs (map
|
||||
(name: {
|
||||
|
|
@ -74,7 +75,7 @@
|
|||
mkModules = names: type: builtins.listToAttrs (map
|
||||
(name: {
|
||||
inherit name;
|
||||
value = import "${self}/modules/${type}/${name}.nix";
|
||||
value = import "${self}/modules/${type}/${name}";
|
||||
})
|
||||
names);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue