rm mail
This commit is contained in:
parent
4d3cdd9c75
commit
f8138fcf67
7 changed files with 6 additions and 250 deletions
|
@ -1,47 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services = let
|
|
||||||
domain = lib.head config.mailserver.domains;
|
|
||||||
fqdn = config.mailserver.fqdn;
|
|
||||||
in {
|
|
||||||
caddy.virtualHosts = {
|
|
||||||
"autoconfig.${domain}" = {
|
|
||||||
serverAliases = ["autodiscover.${domain}"];
|
|
||||||
extraConfig = let
|
|
||||||
proxy = "reverse_proxy 127.0.0.1:${toString config.services.automx2.port}";
|
|
||||||
in ''
|
|
||||||
route {
|
|
||||||
handle_path /initdb* {
|
|
||||||
@not_local not remote_ip 127.0.0.1
|
|
||||||
abort @not_local
|
|
||||||
${proxy}
|
|
||||||
}
|
|
||||||
|
|
||||||
${proxy}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
automx2 = {
|
|
||||||
enable = true;
|
|
||||||
inherit domain;
|
|
||||||
settings = {
|
|
||||||
provider = "Federated Nexus";
|
|
||||||
domains = [domain];
|
|
||||||
servers = [
|
|
||||||
{
|
|
||||||
type = "imap";
|
|
||||||
name = fqdn;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "smtp";
|
|
||||||
name = fqdn;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,70 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
settings = {
|
|
||||||
backfill.enabled = true;
|
|
||||||
|
|
||||||
appservice = {
|
|
||||||
as_token = "$CUSTOM_AS_TOKEN";
|
|
||||||
hs_token = "$CUSTOM_HS_TOKEN";
|
|
||||||
};
|
|
||||||
|
|
||||||
homeserver = {
|
|
||||||
domain = config.services.grapevine.settings.server_name;
|
|
||||||
address = config.services.grapevine.settings.server_discovery.client.base_url;
|
|
||||||
};
|
|
||||||
|
|
||||||
bridge = {
|
|
||||||
encryption = {
|
|
||||||
allow = true;
|
|
||||||
default = true;
|
|
||||||
require = false;
|
|
||||||
};
|
|
||||||
permissions = {
|
|
||||||
"${config.services.grapevine.settings.server_name}" = "user";
|
|
||||||
"@quadradical:${config.services.grapevine.settings.server_name}" = "admin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
imports = [inputs.nix-matrix-appservices.nixosModule inputs.ooye.modules.default];
|
|
||||||
|
|
||||||
services = let
|
|
||||||
domain = "ooye.federated.nexus";
|
|
||||||
in {
|
|
||||||
matrix-appservices.services = builtins.mapAttrs (name: value:
|
|
||||||
value
|
|
||||||
// {
|
|
||||||
inherit settings;
|
|
||||||
format = "mautrix-go";
|
|
||||||
port = 8000;
|
|
||||||
package = value.package.override {withGoolm = true;};
|
|
||||||
}) {
|
|
||||||
whatsapp = {
|
|
||||||
host = "127.0.0.4";
|
|
||||||
serviceConfig.EnvironmentFile = config.age.secrets."whatsapp.age".path;
|
|
||||||
package = pkgs.mautrix-whatsapp;
|
|
||||||
};
|
|
||||||
gmessages = {
|
|
||||||
host = "127.0.0.5";
|
|
||||||
serviceConfig.EnvironmentFile = config.age.secrets."gmessages.age".path;
|
|
||||||
package = inputs.nixpkgs-goolm.legacyPackages.${pkgs.system}.mautrix-gmessages;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
matrix-ooye = {
|
|
||||||
enable = true;
|
|
||||||
homeserver = config.services.grapevine.settings.server_discovery.client.base_url;
|
|
||||||
homeserverName = "federated.nexus";
|
|
||||||
discordTokenPath = config.age.secrets."discordToken.age".path;
|
|
||||||
discordClientSecretPath = config.age.secrets."discordClientSecret.age".path;
|
|
||||||
socket = "8081";
|
|
||||||
bridgeOrigin = "https://${domain}";
|
|
||||||
};
|
|
||||||
|
|
||||||
caddy.virtualHosts."${domain}".extraConfig = "reverse_proxy 127.0.0.1:8081";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
domain = "federated.nexus";
|
|
||||||
fqdn = "mail.${domain}";
|
|
||||||
certDir = "/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/${fqdn}";
|
|
||||||
in {
|
|
||||||
imports = [inputs.mailserver.nixosModule];
|
|
||||||
mailserver = {
|
|
||||||
enable = true;
|
|
||||||
stateVersion = 3;
|
|
||||||
|
|
||||||
inherit fqdn;
|
|
||||||
domains = [domain];
|
|
||||||
|
|
||||||
localDnsResolver = false;
|
|
||||||
|
|
||||||
certificateScheme = "manual";
|
|
||||||
certificateFile = "${certDir}/${fqdn}.crt";
|
|
||||||
keyFile = "${certDir}/${fqdn}.key";
|
|
||||||
|
|
||||||
oauth2 = let
|
|
||||||
auth = "https://auth.federated.nexus";
|
|
||||||
in {
|
|
||||||
enable = true;
|
|
||||||
introspection = {
|
|
||||||
url = "${auth}/introspect";
|
|
||||||
mode = "post";
|
|
||||||
};
|
|
||||||
oidc.configuration_url = "${auth}/.well-known/openid-configuration";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.dovecot2.group = config.services.caddy.group;
|
|
||||||
}
|
|
|
@ -1,60 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services = {
|
|
||||||
phpfpm.pools.roundcube.settings = {
|
|
||||||
"listen.owner" = "caddy";
|
|
||||||
"listen.group" = "caddy";
|
|
||||||
};
|
|
||||||
roundcube = {
|
|
||||||
enable = true;
|
|
||||||
configureNginx = false;
|
|
||||||
|
|
||||||
package = pkgs.roundcube.overrideAttrs (oldAttrs: {
|
|
||||||
version = "1.7-beta";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://github.com/roundcube/roundcubemail/releases/download/1.7-beta/roundcubemail-1.7-beta-complete.tar.gz";
|
|
||||||
sha256 = "sha256-gYY+tyR1aPAo43oH3Prgwd0A7XmiFASZ7KWxXuf4vpk=";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [./update.patch];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir $out
|
|
||||||
cp -r * $out/
|
|
||||||
ln -sf /etc/roundcube/config.inc.php $out/config/config.inc.php
|
|
||||||
rm -rf $out/installer
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
|
|
||||||
extraConfig = ''
|
|
||||||
// General
|
|
||||||
$config["skin_logo"] = "https://federated.nexus/images/icon.svg";
|
|
||||||
$config["use_https"] = true;
|
|
||||||
|
|
||||||
// OAuth
|
|
||||||
$config["oauth_provider"] = "generic";
|
|
||||||
$config["oauth_provider_name"] = "Federated Nexus";
|
|
||||||
$config["oauth_login_redirect"] = true;
|
|
||||||
|
|
||||||
$config["oauth_config_uri"] = "https://auth.federated.nexus/.well-known/openid-configuration";
|
|
||||||
|
|
||||||
$config["oauth_client_id"] = "roundcube";
|
|
||||||
$config["oauth_client_secret"] = "secret";
|
|
||||||
|
|
||||||
$config["oauth_scope"] = "";
|
|
||||||
$config["oauth_scope"] = "";
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
caddy.virtualHosts."mail.federated.nexus".extraConfig = ''
|
|
||||||
root * ${config.services.roundcube.package}/public_html
|
|
||||||
|
|
||||||
php_fastcgi unix/${config.services.phpfpm.pools.roundcube.socket}
|
|
||||||
file_server
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
From c0a516b09316a8bb73c872d9da2f584e5ed5b112 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Henry Hiles <henry@henryhiles.com>
|
|
||||||
Date: Mon, 21 Jul 2025 21:27:10 -0400
|
|
||||||
Subject: [PATCH] Fix update script for nix
|
|
||||||
|
|
||||||
---
|
|
||||||
bin/update.sh | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/bin/update.sh b/bin/update.sh
|
|
||||||
index 5058f33f16..41361d9481 100755
|
|
||||||
--- a/bin/update.sh
|
|
||||||
+++ b/bin/update.sh
|
|
||||||
@@ -19,7 +19,7 @@
|
|
||||||
+-----------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/');
|
|
||||||
+define('INSTALL_PATH', dirname(dirname($argv[0])).'/');
|
|
||||||
|
|
||||||
require_once INSTALL_PATH . 'program/include/clisetup.php';
|
|
||||||
|
|
12
flake.lock
generated
12
flake.lock
generated
|
@ -668,11 +668,11 @@
|
||||||
"firefox-gnome-theme": {
|
"firefox-gnome-theme": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752677629,
|
"lastModified": 1753208071,
|
||||||
"narHash": "sha256-ze2bcq5RSasEwvT6PR8EMedF4o8RoBtVB5ny6Jd9tA4=",
|
"narHash": "sha256-0q4HUdFy/dzOm0pD/TzcpkFAfA/JTaRq9oXy05yg0EE=",
|
||||||
"owner": "rafaelmardojai",
|
"owner": "rafaelmardojai",
|
||||||
"repo": "firefox-gnome-theme",
|
"repo": "firefox-gnome-theme",
|
||||||
"rev": "15ac3dfeaf828a9336e7e199123f8020cf04f440",
|
"rev": "2615749a60ad731a2a2bbbe45d8b468bf1d8cdf8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -2641,11 +2641,11 @@
|
||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1753182975,
|
"lastModified": 1753212822,
|
||||||
"narHash": "sha256-DYa27iNM4GBMLgcX6s6ix5tux8a/sjmrC8gRmDb9bvI=",
|
"narHash": "sha256-l+xtl7MlXGthEVomOCCmAxnatPfcQcf++8D0WBpNlxU=",
|
||||||
"owner": "wamserma",
|
"owner": "wamserma",
|
||||||
"repo": "flake-programs-sqlite",
|
"repo": "flake-programs-sqlite",
|
||||||
"rev": "a79f1edd18cc601501831336f82feb65b09a0185",
|
"rev": "44129ce7e322055bdd3383bba6f4a67da25cd63f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -9,14 +9,6 @@
|
||||||
url = "github:nix-community/disko";
|
url = "github:nix-community/disko";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
# mailserver = {
|
|
||||||
# url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
|
||||||
# inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
# };
|
|
||||||
mailserver = {
|
|
||||||
url = "git+file:///home/quadradical/Documents/Code/nixos-mailserver";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
run0-sudo-shim = {
|
run0-sudo-shim = {
|
||||||
url = "github:lordgrimmauld/run0-sudo-shim";
|
url = "github:lordgrimmauld/run0-sudo-shim";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue