Let's configure the db for gotosocial?
This commit is contained in:
		
							parent
							
								
									c2d0ff412e
								
							
						
					
					
						commit
						7fa997ec94
					
				
					 4 changed files with 37 additions and 22 deletions
				
			
		| 
						 | 
				
			
			@ -16,6 +16,7 @@
 | 
			
		|||
    # You can also split up your configuration and import pieces of it here:
 | 
			
		||||
    # ./nvim.nix
 | 
			
		||||
    ./hardware-configuration.nix
 | 
			
		||||
    ./postgres.nix
 | 
			
		||||
    ./nextcloud.nix
 | 
			
		||||
    ./mail-server.nix
 | 
			
		||||
    ./gotosocial.nix
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,7 @@
 | 
			
		|||
 | 
			
		||||
  services.gotosocial = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    package = pkgs.gotosocial;
 | 
			
		||||
    setupPostgresqlDB = true;
 | 
			
		||||
    settings = {
 | 
			
		||||
      application-name = "gotosocial";
 | 
			
		||||
| 
						 | 
				
			
			@ -41,4 +42,9 @@
 | 
			
		|||
      smtp-from = "no-reply@social.gladtherescake.eu";
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  systemd.services."gotosocial" = {
 | 
			
		||||
    requires = ["postgresql.service"];
 | 
			
		||||
    after = ["postgresql.service"];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -105,28 +105,6 @@
 | 
			
		|||
    enable = true;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  # Enable PostgreSQL
 | 
			
		||||
  services.postgresql = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
 | 
			
		||||
    # Ensure the database, user, and permissions always exist
 | 
			
		||||
    ensureDatabases = ["nextcloud" "onlyoffice" "akkoma"];
 | 
			
		||||
    ensureUsers = [
 | 
			
		||||
      {
 | 
			
		||||
        name = "nextcloud";
 | 
			
		||||
        ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        name = "onlyoffice";
 | 
			
		||||
        ensurePermissions."DATABASE onlyoffice" = "ALL PRIVILEGES";
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        name = "akkoma";
 | 
			
		||||
        ensurePermissions."DATABASE akkoma" = "ALL PRIVILEGES";
 | 
			
		||||
      }
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  services.aria2 = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    rpcListenPort = 6969;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										30
									
								
								nixos/queen/postgres.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								nixos/queen/postgres.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,30 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  services.postgresql = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
 | 
			
		||||
    # Ensure the database, user, and permissions always exist
 | 
			
		||||
    ensureDatabases = ["nextcloud" "onlyoffice" "akkoma"];
 | 
			
		||||
    ensureUsers = [
 | 
			
		||||
      {
 | 
			
		||||
        name = "nextcloud";
 | 
			
		||||
        ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        name = "onlyoffice";
 | 
			
		||||
        ensurePermissions."DATABASE onlyoffice" = "ALL PRIVILEGES";
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        name = "akkoma";
 | 
			
		||||
        ensurePermissions."DATABASE akkoma" = "ALL PRIVILEGES";
 | 
			
		||||
      }
 | 
			
		||||
      {
 | 
			
		||||
        name = "gotosocial";
 | 
			
		||||
        ensurePermissions."DATABASE gotosocial" = "ALL PRIVILEGES";
 | 
			
		||||
      }
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue