aboutsummaryrefslogtreecommitdiff
path: root/vps-configuration.nix
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-10-23 08:42:45 -0300
committerEuAndreh <eu@euandre.org>2020-10-23 08:43:14 -0300
commit42d440c542f10593f2f7f3b5556526db06305f35 (patch)
tree8e1a026abd580da92f9d9c059dbf0669b154caff /vps-configuration.nix
parentAdd bash scripts for tests instead of Nix (diff)
downloadserver-42d440c542f10593f2f7f3b5556526db06305f35.tar.gz
server-42d440c542f10593f2f7f3b5556526db06305f35.tar.xz
Run nixfmt
Diffstat (limited to 'vps-configuration.nix')
-rw-r--r--vps-configuration.nix122
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" ];
};
};