chore(desktop): move postgresql service to it's own file
This commit is contained in:
		
							parent
							
								
									751ba3ce34
								
							
						
					
					
						commit
						9a4e5c40ef
					
				
					 2 changed files with 15 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
{ pkgs, ... }:
 | 
			
		||||
{ ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
| 
						 | 
				
			
			@ -6,15 +6,6 @@
 | 
			
		|||
    ./services/caddy.nix
 | 
			
		||||
    ./services/forgejo.nix
 | 
			
		||||
    ./services/jellyfin.nix
 | 
			
		||||
    ./services/postgresql.nix
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  services.postgresql = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
 | 
			
		||||
    initialScript = pkgs.writeText "backend-initScript" ''
 | 
			
		||||
      CREATE ROLE wizardlink WITH LOGIN SUPERUSER PASSWORD 'wizardlink' CREATEDB CREATEROLE REPLICATION;
 | 
			
		||||
      CREATE DATABASE wizardlink;
 | 
			
		||||
      GRANT ALL PRIVILEGES ON DATABASE wizardlink TO wizardlink;
 | 
			
		||||
    '';
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										13
									
								
								specific/desktop/services/postgresql.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								specific/desktop/services/postgresql.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
{ pkgs, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  services.postgresql = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
 | 
			
		||||
    initialScript = pkgs.writeText "backend-initScript" ''
 | 
			
		||||
      CREATE ROLE wizardlink WITH LOGIN SUPERUSER PASSWORD 'wizardlink' CREATEDB CREATEROLE REPLICATION;
 | 
			
		||||
      CREATE DATABASE wizardlink;
 | 
			
		||||
      GRANT ALL PRIVILEGES ON DATABASE wizardlink TO wizardlink;
 | 
			
		||||
    '';
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue