forked from jan-leila/nix-config
		
	refactor: split server modules into smaller more manageable files
This commit is contained in:
		
							parent
							
								
									b2e5ae1f98
								
							
						
					
					
						commit
						cdeb4e108b
					
				
					 49 changed files with 1519 additions and 1270 deletions
				
			
		
							
								
								
									
										40
									
								
								modules/nixos-modules/server/paperless/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								modules/nixos-modules/server/paperless/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,40 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   ... | ||||
| }: { | ||||
|   imports = [ | ||||
|     ./proxy.nix | ||||
|     ./database.nix | ||||
|     ./fail2ban.nix | ||||
|     ./impermanence.nix | ||||
|   ]; | ||||
| 
 | ||||
|   options.services.paperless = { | ||||
|     subdomain = lib.mkOption { | ||||
|       type = lib.types.str; | ||||
|       description = "subdomain of base domain that paperless will be hosted at"; | ||||
|       default = "paperless"; | ||||
|     }; | ||||
|     database = { | ||||
|       user = lib.mkOption { | ||||
|         type = lib.types.str; | ||||
|         description = "what is the user and database that we are going to use for paperless"; | ||||
|         default = "paperless"; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = lib.mkIf config.services.paperless.enable { | ||||
|     services.paperless = { | ||||
|       domain = "${config.services.paperless.subdomain}.${config.host.reverse_proxy.hostname}"; | ||||
|       configureTika = true; | ||||
|       settings = { | ||||
|         PAPERLESS_DBENGINE = "postgresql"; | ||||
|         PAPERLESS_DBHOST = "/run/postgresql"; | ||||
|         PAPERLESS_DBNAME = config.services.paperless.database.user; | ||||
|         PAPERLESS_DBUSER = config.services.paperless.database.user; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue