mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 02:09:04 +02:00
Added mailserver and hedgedoc service
This commit is contained in:
parent
5e0aeec052
commit
8b47b55ecf
7 changed files with 201 additions and 4 deletions
55
modules/docs/default.nix
Normal file
55
modules/docs/default.nix
Normal file
|
@ -0,0 +1,55 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.luj.docs;
|
||||
port = 3013;
|
||||
in
|
||||
{
|
||||
|
||||
options.luj.docs = {
|
||||
|
||||
enable = mkEnableOption "activate hedgedoc service";
|
||||
nginx.enable = mkEnableOption "activate nginx";
|
||||
nginx.subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge [{
|
||||
services.hedgedoc = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
port = port;
|
||||
db = {
|
||||
dialect = "postgres";
|
||||
host = "/run/postgresql";
|
||||
};
|
||||
domain = "docs.julienmalka.me";
|
||||
protocolUseSSL = true;
|
||||
allowFreeURL = true;
|
||||
allowEmailRegister = false;
|
||||
allowAnonymous = false;
|
||||
allowAnonymousEdits = true;
|
||||
allowGravatar = true;
|
||||
};
|
||||
};
|
||||
services.postgresql = {
|
||||
ensureDatabases = [ "hedgedoc" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "hedgedoc";
|
||||
ensurePermissions."DATABASE hedgedoc" = "ALL PRIVILEGES";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf cfg.nginx.enable (mkSubdomain cfg.nginx.subdomain port))]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue