leonard: Add wiki-wackattack-eu
This commit is contained in:
		
							parent
							
								
									0c08f92444
								
							
						
					
					
						commit
						68950a4507
					
				@ -8,9 +8,11 @@
 | 
				
			|||||||
      ../../common/auto-upgrade.nix
 | 
					      ../../common/auto-upgrade.nix
 | 
				
			||||||
      ./hardware-configuration.nix
 | 
					      ./hardware-configuration.nix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      ./services/nginx.nix
 | 
					 | 
				
			||||||
      ./services/mysql.nix
 | 
					      ./services/mysql.nix
 | 
				
			||||||
 | 
					      ./services/nginx.nix
 | 
				
			||||||
 | 
					      ./services/postgresql.nix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      ./services/wiki-wackattack-eu.nix
 | 
				
			||||||
      ./services/www-feal-no
 | 
					      ./services/www-feal-no
 | 
				
			||||||
      ./services/www-kinealbrigtsen-no.nix
 | 
					      ./services/www-kinealbrigtsen-no.nix
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										20
									
								
								hosts/leonard/services/postgresql.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								hosts/leonard/services/postgresql.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					{ config, pkgs, lib, ... }:
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  services.postgresql = {
 | 
				
			||||||
 | 
					    enable = true;
 | 
				
			||||||
 | 
					    enableTCPIP = false;
 | 
				
			||||||
 | 
					    authentication = pkgs.lib.mkOverride 10 ''
 | 
				
			||||||
 | 
					      #type database  DBuser  auth-method
 | 
				
			||||||
 | 
					      local all       all     trust
 | 
				
			||||||
 | 
					    '';
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  services.postgresqlBackup = {
 | 
				
			||||||
 | 
					    enable = true;
 | 
				
			||||||
 | 
					    location = "/backup/postgresql/";
 | 
				
			||||||
 | 
					    startAt = "*-*-* 03:15:00";
 | 
				
			||||||
 | 
					    backupAll = true;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  environment.systemPackages = [ config.services.postgresql.package ];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										38
									
								
								hosts/leonard/services/wiki-wackattack-eu.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								hosts/leonard/services/wiki-wackattack-eu.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					{ config, ... }:
 | 
				
			||||||
 | 
					let
 | 
				
			||||||
 | 
					  bindIP = "127.0.1.2";
 | 
				
			||||||
 | 
					  port = 5051;
 | 
				
			||||||
 | 
					  cfg = config.services.wiki-js;
 | 
				
			||||||
 | 
					in {
 | 
				
			||||||
 | 
					  # sops.secrets."wikijs/envfile" = {
 | 
				
			||||||
 | 
					  #   restartUnits = [ "wiki-js.service" ];
 | 
				
			||||||
 | 
					  # };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  services.wiki-js = {
 | 
				
			||||||
 | 
					    enable = true;
 | 
				
			||||||
 | 
					    # environmentFile = config.sops.secrets."wikijs/envfile".path;
 | 
				
			||||||
 | 
					    settings = {
 | 
				
			||||||
 | 
					      inherit bindIP port;
 | 
				
			||||||
 | 
					      db = {
 | 
				
			||||||
 | 
					        type = "postgres";
 | 
				
			||||||
 | 
					        host = "/run/postgresql";
 | 
				
			||||||
 | 
					        db = "wiki-js";
 | 
				
			||||||
 | 
					        user = "wiki-js";
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  services.postgresql = {
 | 
				
			||||||
 | 
					    ensureDatabases = [ "wiki-js" ];
 | 
				
			||||||
 | 
					    ensureUsers = [{
 | 
				
			||||||
 | 
					      name = "wiki-js";
 | 
				
			||||||
 | 
					      ensureDBOwnership = true;
 | 
				
			||||||
 | 
					    }];
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  services.nginx.virtualHosts."wiki.wackattack.eu" = {
 | 
				
			||||||
 | 
					    locations."/" = {
 | 
				
			||||||
 | 
					      proxyPass = "http://${bindIP}:${toString port}";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user