Files
hearth/nixos/module/generic/matrix-cluster-users.nix

49 lines
1006 B
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
inputs,
flake,
self,
}: {
lib,
config,
...
}: let
userNames = [
"yukkop"
"liquiz"
"vismajor"
"lvgkcfjl"
"MrAlex0O"
"Антоша"
"snuff"
];
adminNames = [ "yukkop" ];
matrixClusterSopsFile = flake + "/sus/matrix-cluster.yaml";
cfg = config.hectic.generic.matrix-cluster;
in {
config = lib.mkIf cfg.enable {
hectic.generic.matrix-cluster.users = builtins.listToAttrs (
map (name: {
inherit name;
value = {
passwordFile = config.sops.secrets."matrix/users/${name}/password".path;
} // lib.optionalAttrs (builtins.elem name adminNames) {
admin = true;
};
}) userNames
);
sops.secrets = builtins.listToAttrs (
map (name: {
name = "matrix/users/${name}/password";
value = {
key = "matrix/users/${name}/password";
owner = "matrix-synapse";
sopsFile = matrixClusterSopsFile;
};
}) userNames
);
};
}