This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / nixos / 2configs / codimd.nix
1.7 kB 69 lines
1{ config, pkgs, lib, ... }: 2let 3 domain = "pad.lassul.us"; 4in 5{ 6 7 # redirect legacy domain to new one 8 services.nginx.virtualHosts."codi.lassul.us" = { 9 enableACME = true; 10 addSSL = true; 11 locations."/".return = "301 https://${domain}\$request_uri"; 12 }; 13 14 services.nginx.virtualHosts.${domain} = { 15 enableACME = true; 16 forceSSL = true; 17 locations."/" = { 18 proxyPass = "https://localhost:3091"; 19 proxyWebsockets = true; 20 }; 21 }; 22 23 security.acme.certs.${domain}.group = "hedgecert"; 24 users.groups.hedgecert.members = [ "hedgedoc" "nginx" ]; 25 26 security.dhparams = { 27 enable = true; 28 params.hedgedoc = { }; 29 }; 30 31 systemd.services.hedgedoc.environment = { 32 CMD_COOKIE_POLICY = "none"; 33 CMD_CSP_ALLOW_FRAMING = "true"; 34 }; 35 36 services.borgbackup.jobs.hetzner.paths = [ 37 "/var/backup" 38 "/var/lib/hedgedoc" 39 ]; 40 systemd.services.hedgedoc-backup = { 41 startAt = "daily"; 42 serviceConfig = { 43 ExecStart = ''${pkgs.sqlite}/bin/sqlite3 /var/lib/hedgedoc/db.hedgedoc.sqlite ".backup /var/backup/hedgedoc/backup.sq3"''; 44 Type = "oneshot"; 45 }; 46 }; 47 48 services.hedgedoc = { 49 enable = true; 50 configuration.allowOrigin = [ domain ]; 51 settings = { 52 db = { 53 dialect = "sqlite"; 54 storage = "/var/lib/hedgedoc/db.hedgedoc.sqlite"; 55 }; 56 useCDN = false; 57 port = 3091; 58 domain = domain; 59 allowFreeURL = true; 60 61 useSSL = true; 62 protocolUseSSL = true; 63 sslCAPath = [ "/etc/ssl/certs/ca-certificates.crt" ]; 64 sslCertPath = "/var/lib/acme/${domain}/cert.pem"; 65 sslKeyPath = "/var/lib/acme/${domain}/key.pem"; 66 dhParamPath = config.security.dhparams.params.hedgedoc.path; 67 }; 68 }; 69}