diff options
Diffstat (limited to 'vps-configuration.nix')
-rw-r--r-- | vps-configuration.nix | 122 |
1 files changed, 54 insertions, 68 deletions
diff --git a/vps-configuration.nix b/vps-configuration.nix index 574d1d7..c167d29 100644 --- a/vps-configuration.nix +++ b/vps-configuration.nix @@ -73,18 +73,10 @@ in { ''; }; - environment = { - systemPackages = with pkgs; [ - vim - git - gitAndTools.git-annex - gotop - ]; + systemPackages = with pkgs; [ vim git gitAndTools.git-annex gotop ]; - shellAliases = { - l = "ls -lahF"; - }; + shellAliases = { l = "ls -lahF"; }; }; networking.firewall.allowedTCPPorts = [ @@ -115,66 +107,62 @@ in { recommendedProxySettings = true; recommendedTlsSettings = true; virtualHosts = - builtins.fold - (repo: acc: acc // static-site-from-repo repo) - {} - config.static-sites // - builtins.fold - (project: acc: acc // docs-site-for-project project) - {} - config.docs-projects // { - "${config.TLD}" = { - locations."= /.well-known/matrix/server".extraConfig = '' - add_header Content-Type application/json; - return 200 '${builtins.toJSON config.matrixServerJSON}'; - ''; - locations."= /.well-known/matrix/client".extraConfig = '' - add_header Content-Type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '${builtins.toJSON config.matrixClientJSON}'; - ''; - }; - "${config.matrixDomain}" = { - enableACME = true; - forceSSL = true; - locations."/_matrix" = { - proxyPass = "http://[::1]:${toString config.matrixPort}"; - }; + builtins.fold (repo: acc: acc // static-site-from-repo repo) { } + config.static-sites + // builtins.fold (project: acc: acc // docs-site-for-project project) + { } config.docs-projects // { + "${config.TLD}" = { + locations."= /.well-known/matrix/server".extraConfig = '' + add_header Content-Type application/json; + return 200 '${builtins.toJSON config.matrixServerJSON}'; + ''; + locations."= /.well-known/matrix/client".extraConfig = '' + add_header Content-Type application/json; + add_header Access-Control-Allow-Origin *; + return 200 '${builtins.toJSON config.matrixClientJSON}'; + ''; + }; + "${config.matrixDomain}" = { + enableACME = true; + forceSSL = true; + locations."/_matrix" = { + proxyPass = "http://[::1]:${toString config.matrixPort}"; }; - "${config.elementDomain}" = { - enableACME = true; - forceSSL = true; - root = pkgs.element-web.override { - conf = { - default_server_config."m.homeserver" = { - "base_url" = "https://${config.matrixDomain}"; - "server_name" = "https://${config.matrixDomain}"; - }; + }; + "${config.elementDomain}" = { + enableACME = true; + forceSSL = true; + root = pkgs.element-web.override { + conf = { + default_server_config."m.homeserver" = { + "base_url" = "https://${config.matrixDomain}"; + "server_name" = "https://${config.matrixDomain}"; }; }; }; - "${config.nextcloudDomain}" = { - forceSSL = true; - enableACME = true; - }; - "git.${config.TLD}" = { - forceSSL = true; - enableACME = true; - extraConfig = '' - location = /favicon.ico { - alias /data/favicons/git.ico; - } - location / { - proxy_pass http://localhost:${config.gitPort}; - } - ''; - }; - "ci.${config.TLD}" = { - forceSSL = true; - enableACME = true; - root = "/data/static/ci-logs/"; - }; }; + "${config.nextcloudDomain}" = { + forceSSL = true; + enableACME = true; + }; + "git.${config.TLD}" = { + forceSSL = true; + enableACME = true; + extraConfig = '' + location = /favicon.ico { + alias /data/favicons/git.ico; + } + location / { + proxy_pass http://localhost:${config.gitPort}; + } + ''; + }; + "ci.${config.TLD}" = { + forceSSL = true; + enableACME = true; + root = "/data/static/ci-logs/"; + }; + }; }; nextcloud = { @@ -259,9 +247,7 @@ in { cron = { enable = true; - systemCronJobs = [ - "0 12 * * * root /data/cron/borg.sh" - ]; + systemCronJobs = [ "0 12 * * * root /data/cron/borg.sh" ]; }; }; |