mjolnir working
set up a janitor for compressing state
This commit is contained in:
		
							parent
							
								
									9394544e07
								
							
						
					
					
						commit
						0c04c38779
					
				
							
								
								
									
										21
									
								
								profiles/matrix/compress-state-service.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								profiles/matrix/compress-state-service.nix
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | |||
| { pkgs, ... }: | ||||
| { | ||||
|   environment.systemPackages = [ pkgs.matrix-synapse-tools.rust-synapse-compress-state ]; | ||||
|   systemd.services.compress-matrix-state = { | ||||
|     serviceConfig.Type = "oneshot"; | ||||
|     path = [ | ||||
|       pkgs.matrix-synapse-tools.rust-synapse-compress-state | ||||
|     ]; | ||||
|     script = '' | ||||
|       synapse_auto_compressor -p "host=/run/postgresql port=5432 user=matrix-synapse dbname=matrix-synapse" -n 2000000 -c 10000 | ||||
|     ''; | ||||
|     serviceConfig = { | ||||
|       User = "matrix-synapse"; | ||||
|     }; | ||||
|   }; | ||||
|   systemd.timers.compress-matrix-state = { | ||||
|     wantedBy = [ "timers.target" ]; | ||||
|     partOf = [ "compress-matrix-state.service" ]; | ||||
|     timerConfig.OnCalendar = [ "weekly" ]; | ||||
|   }; | ||||
| } | ||||
|  | @ -1,16 +1,16 @@ | |||
| { config, lib, pkgs, ... }: | ||||
| { self, config, lib, pkgs, ... }: | ||||
| 
 | ||||
| { | ||||
|   imports = [ | ||||
|     ./mautrix-telegram.nix | ||||
|     # ./mjolnir.nix  # need to create the mod user | ||||
|     ./mjolnir.nix | ||||
|     ./heisenbridge.nix | ||||
|     ./compress-state-service.nix | ||||
|   ]; | ||||
|   environment.systemPackages = [ pkgs.matrix-synapse-tools.rust-synapse-compress-state ]; | ||||
|   age.secrets.synapse-database-password.file = "${self}/secrets/synapse-database-password.age"; | ||||
|   age.secrets.synapse-database-password.owner = "matrix-synapse"; | ||||
|   age.secrets.synapse-database-password.file = "${self}/secrets/synapse-config.age"; | ||||
|   age.secrets.synapse-database-password.owner = "matrix-synapse"; | ||||
|   age.secrets.synapse-config.file = "${self}/secrets/synapse-config.age"; | ||||
|   age.secrets.synapse-config.owner = "matrix-synapse"; | ||||
| 
 | ||||
|   services.matrix-synapse = { | ||||
|     enable = true; | ||||
|  | @ -50,7 +50,6 @@ | |||
|         "turn:turn.sealight.xyz:3478?transport=tcp" | ||||
|       ]; | ||||
|       # turn_shared_secret = config.services.coturn.static-auth-secret; | ||||
|       extraConfig = "/run/agenix/synapse-config"; | ||||
|       # Example config (saved as secret??) | ||||
|       # '' | ||||
|       #   max_upload_size: "50M" | ||||
|  | @ -59,12 +58,13 @@ | |||
|       #   enable_registration_without_verification: true | ||||
|       # ''; | ||||
|       enable_metrics = true; | ||||
|       enable_registration = true; | ||||
|       enable_registration = false; | ||||
|       database = { | ||||
|         name = "psycopg2"; | ||||
|         args.passfile = "/run/agenix/synapse-database-password"; | ||||
|       }; | ||||
|     }; | ||||
|     extraConfigFiles = [ "/run/agenix/synapse-config" ]; | ||||
|     ## coturn based TURN server integration (TURN server setup mentioned later), | ||||
|     ## shared secret generated while configuring coturn | ||||
|     ## and reused here (power of Nix being a real programming language) | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| { config, lib, pkgs, ... }: | ||||
| { self, config, lib, pkgs, ... }: | ||||
| { | ||||
|   age.secrets.telegram-matrix-env.file = "${self}/secrets/telegram-matrix-env.age"; | ||||
|   age.secrets.telegram-matrix-env.owner = "mautrix-telegram"; | ||||
|   #age.secrets.telegram-matrix-env.owner = "mautrix-telegram"; | ||||
|   services.mautrix-telegram = { | ||||
|     enable = true; | ||||
|     environmentFile = "/run/agenix/telegram-matrix-env"; | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| { pkgs, lib, config, ... }: | ||||
| { self, pkgs, lib, config, ... }: | ||||
| { | ||||
|   age.secrets.sealight-mod-password.file = "${self}/secrets/sealight-mod-password.age"; | ||||
|   age.secrets.sealight-mod-password.owner = "mjolnir"; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue