summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-01-05 15:06:43 +0100
committerandromeda <andromeda@lenovo>2026-01-05 15:06:43 +0100
commit0e9398212541480361c7c4da98728f00b033d35e (patch)
tree3f8a294f9ac45a120051156d00eea800cc0b62a0 /modules
parentb0da60cdab0ebc6715dcdca22e73a2ef19fd042f (diff)
merge new secrets
Diffstat (limited to 'modules')
-rw-r--r--modules/nixos/zulip.nix52
-rw-r--r--modules/template.nix11
2 files changed, 63 insertions, 0 deletions
diff --git a/modules/nixos/zulip.nix b/modules/nixos/zulip.nix
new file mode 100644
index 0000000..cc74179
--- /dev/null
+++ b/modules/nixos/zulip.nix
@@ -0,0 +1,52 @@
+{
+ config,
+ lib,
+ pkgs,
+ modulesPath,
+ ...
+}: {
+ imports = [];
+ options.x = {
+ zulip = {
+ enable = true;
+ admin_email = lib.mkOption {
+ type = lib.types.str;
+ default = "admin+zulip@${config.networking.domain}";
+ };
+ integration = {
+ persistance.enable = lib.mkOption {
+ type = lib.types.bool;
+ description = "whether persistance is enabled";
+ default = lib.mkDefault false;
+ };
+ mailserver.enable = lib.mkOption {
+ type = lib.types.bool;
+ description = "creates simple-nixos-mailserver login automatically for admin user";
+ };
+ };
+ };
+ };
+ config = let
+ cfg = config.x.zulip;
+ in
+ lib.mkIf cfg.enable {
+ services.zulip = {
+ enable = true;
+ host = "zulip.${config.networking.domain}";
+ camoKeyFile = builtins.toString config.age.secrets.zulip-camoKey.path;
+ rabbitmqPasswordFile = builtins.toString config.age.secrets.zulip-rabbitmqPassword.path;
+ secretKeyFile = builtins.toString config.age.secrets.zulip-secretKey.path;
+ sharedSecretKeyFile = builtins.toString config.age.secrets.zulip-sharedSecretKey.path;
+ avatarSaltKeyFile = builtins.toString config.age.secrets.zulip-avatarSaltKey.path;
+ zulipSettings = {
+ ZULIP_ADMINISTRATOR = cfg.admin_email;
+ EXTERNAL_HOST = "chat.${config.networking.domain}";
+ };
+ };
+ services.mailserver.loginAccounts = lib.mkIf cfg.integration.mailserver.enable {
+ "admin+zulip@${config.networking.domain}" = {
+ hashedPasswordFile = builtins.toString config.age.secrets.secret3.path;
+ };
+ };
+ };
+}
diff --git a/modules/template.nix b/modules/template.nix
new file mode 100644
index 0000000..a6c210c
--- /dev/null
+++ b/modules/template.nix
@@ -0,0 +1,11 @@
+{
+ config,
+ lib,
+ pkgs,
+ modulesPath,
+ ...
+}: {
+ imports = [];
+ options = {};
+ config = {};
+}