nixFilesIn = dir:
    { filterRule ? (name: _: name) }:
    with inputs.nixpkgs;
    builtins.attrValues (builtins.mapAttrs (name: _: name)
      (lib.filterAttrs filterRule (builtins.readDir dir)));


 modules = with inputs.nixpkgs;
          # import modules from hosts/<name>
            (builtins.map (file: (./. + "${hostDir}/${file}"))
              ((nixFilesIn (./. + "${hostDir}") {
                filterRule = (name: _:
                  (lib.hasSuffix ".nix" name)
                  && !(lib.hasPrefix "sysinfo" name));
              })))