27 lines
		
	
	
	
		
			662 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			662 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| {
 | |
|   config,
 | |
|   lib,
 | |
|   ...
 | |
| }: {
 | |
|   options.services.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 = {
 | |
|       configureTika = true;
 | |
|       settings = {
 | |
|         PAPERLESS_DBENGINE = "postgresql";
 | |
|         PAPERLESS_DBHOST = "/run/postgresql";
 | |
|         PAPERLESS_DBNAME = config.services.paperless.database.user;
 | |
|         PAPERLESS_DBUSER = config.services.paperless.database.user;
 | |
|       };
 | |
|     };
 | |
|   };
 | |
| }
 |