{config, lib, ...}: let alice = import ./alice; bob = import ./bob; mallory = import ./mallory; isSystemUser = _name: userConfig: userConfig.isSystemUser == true; in { users.users = { inherit alice; inherit bob; root = { openssh.authorizedKeys.keys = lib.lists.flatten (attrValues (lib.mapAttrs (_name: userConfig: userConfig.openssh.authorizedKeys.keys) (lib.filterAttrs isSystemUser config.users.users))) }; }; }