Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
dettlaff | f9f20f79fb | |
dettlaff | 086cdd9bce | |
dettlaff | d3b1398c9d | |
dettlaff | 73cab37aa5 | |
dettlaff | a59b4b8944 | |
dettlaff | 63dcfcec4e | |
dettlaff | 0509ceb2af | |
dettlaff | 2938cfa33e |
14
flake.lock
14
flake.lock
|
@ -28,17 +28,17 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1709843377,
|
"lastModified": 1717701247,
|
||||||
"narHash": "sha256-lQGd4xtKWsIlD5vVurrA/xtNYxYFGfLGyev4oOUeMmY=",
|
"narHash": "sha256-MiP9/qgfxEFG0XrsNhKxKkct4g+ucNpxzUdN9c5Kklg=",
|
||||||
"ref": "master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "1f1fcc223be4c6ae65eef1d50918aed0826e5ad1",
|
"rev": "8c753730c41fe9f2ba281bcabc76808bf61754fc",
|
||||||
"revCount": 1259,
|
"revCount": 1306,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git"
|
"url": "https://git.selfprivacy.org/def/selfprivacy-rest-api.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git"
|
"url": "https://git.selfprivacy.org/def/selfprivacy-rest-api.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
nixpkgs.url = github:nixos/nixpkgs;
|
nixpkgs.url = github:nixos/nixpkgs;
|
||||||
|
|
||||||
selfprivacy-api.url =
|
selfprivacy-api.url =
|
||||||
git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git;
|
git+https://git.selfprivacy.org/def/selfprivacy-rest-api.git;
|
||||||
# make selfprivacy-api use the same shared nixpkgs
|
# make selfprivacy-api use the same shared nixpkgs
|
||||||
selfprivacy-api.inputs.nixpkgs.follows = "nixpkgs";
|
selfprivacy-api.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"selfprivacy",
|
||||||
|
"domain"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"selfprivacy",
|
||||||
|
"modules",
|
||||||
|
"roundcube"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"mailserver",
|
||||||
|
"fqdn"
|
||||||
|
]
|
||||||
|
]
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
description = "Roundcube is a web-based email client.";
|
||||||
|
|
||||||
|
outputs = { self }: {
|
||||||
|
nixosModules.default = import ./module.nix;
|
||||||
|
configPathsNeeded =
|
||||||
|
builtins.fromJSON (builtins.readFile ./config-paths-needed.json);
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
domain = config.selfprivacy.domain;
|
||||||
|
cfg = config.selfprivacy.modules.roundcube;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.selfprivacy.modules.roundcube = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
type = lib.types.bool;
|
||||||
|
};
|
||||||
|
subdomain = lib.mkOption {
|
||||||
|
default = "roundcube";
|
||||||
|
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9]";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
services.roundcube = {
|
||||||
|
enable = true;
|
||||||
|
# this is the url of the vhost, not necessarily the same as the fqdn of
|
||||||
|
# the mailserver
|
||||||
|
hostName = "${cfg.subdomain}.${config.selfprivacy.domain}";
|
||||||
|
extraConfig = ''
|
||||||
|
# starttls needed for authentication, so the fqdn required to match
|
||||||
|
# the certificate
|
||||||
|
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
|
||||||
|
$config['smtp_user'] = "%u";
|
||||||
|
$config['smtp_pass'] = "%p";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -89,4 +89,5 @@ lib.mkIf sp.modules.simple-nixos-mailserver.enable
|
||||||
|
|
||||||
virusScanning = false;
|
virusScanning = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue