This repository has no description
0

Configure Feed

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

superconfig / 2configs / codimd.nix
2.0 kB 79 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 32 services.borgbackup.jobs.hetzner.paths = [ 33 "/var/backup" 34 "/var/lib/hedgedoc" 35 ]; 36 systemd.services.hedgedoc-backup = { 37 startAt = "daily"; 38 serviceConfig = { 39 ExecStart = pkgs.writers.writeDash "pad-backup" '' 40 until ${pkgs.sqlite}/bin/sqlite3 /var/lib/hedgedoc/db.hedgedoc.sqlite ".backup /var/backup/hedgedoc/backup.sq3"; do 41 sleep 1 42 done 43 ''; 44 Type = "oneshot"; 45 }; 46 }; 47 48 systemd.services.hedgedoc.environment = { 49 CMD_COOKIE_POLICY = "none"; 50 CMD_CSP_ALLOW_FRAMING = "true"; 51 }; 52 53 services.hedgedoc = { 54 enable = true; 55 configuration.allowOrigin = [ domain ]; 56 settings = { 57 db = { 58 dialect = "sqlite"; 59 storage = "/var/lib/hedgedoc/db.hedgedoc.sqlite"; 60 }; 61 useCDN = false; 62 port = 3091; 63 domain = domain; 64 allowFreeURL = true; 65 defaultPermission = "freely"; 66 67 useSSL = true; 68 protocolUseSSL = true; 69 sslCAPath = [ "/etc/ssl/certs/ca-certificates.crt" ]; 70 sslCertPath = "/var/lib/acme/${domain}/cert.pem"; 71 sslKeyPath = "/var/lib/acme/${domain}/key.pem"; 72 dhParamPath = config.security.dhparams.params.hedgedoc.path; 73 74 }; 75 76 # https://github.com/settings/applications/2352617 77 environmentFile = config.clanCore.secretsUploadDirectory + "/hedgedoc.env"; 78 }; 79}