forked from jan-leila/nix-config
		
	added forgejo state dir to persist
This commit is contained in:
		
							parent
							
								
									8f59f8aeca
								
							
						
					
					
						commit
						2742eea9c5
					
				
					 1 changed files with 19 additions and 3 deletions
				
			
		|  | @ -4,6 +4,7 @@ | ||||||
|   ... |   ... | ||||||
| }: let | }: let | ||||||
|   forgejoPort = 8081; |   forgejoPort = 8081; | ||||||
|  |   stateDir = "/var/lib/forgejo"; | ||||||
| in { | in { | ||||||
|   options.host.forgejo = { |   options.host.forgejo = { | ||||||
|     enable = lib.mkEnableOption "should forgejo be enabled on this computer"; |     enable = lib.mkEnableOption "should forgejo be enabled on this computer"; | ||||||
|  | @ -14,8 +15,7 @@ in { | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   config = |   config = lib.mkIf config.host.forgejo.enable (lib.mkMerge [ | ||||||
|     lib.mkIf config.host.forgejo.enable |  | ||||||
|     { |     { | ||||||
|       host = { |       host = { | ||||||
|         reverse_proxy.subdomains.${config.host.forgejo.subdomain} = { |         reverse_proxy.subdomains.${config.host.forgejo.subdomain} = { | ||||||
|  | @ -45,5 +45,21 @@ in { | ||||||
|           }; |           }; | ||||||
|         }; |         }; | ||||||
|       }; |       }; | ||||||
|     }; |     } | ||||||
|  |     (lib.mkIf config.host.impermanence.enable { | ||||||
|  |       assertions = [ | ||||||
|  |         { | ||||||
|  |           assertion = config.services.forgejo.stateDir == stateDir; | ||||||
|  |           message = "forgejo state directory does not match persistence"; | ||||||
|  |         } | ||||||
|  |       ]; | ||||||
|  |       environment.persistence."/persist/system/root" = { | ||||||
|  |         enable = true; | ||||||
|  |         hideMounts = true; | ||||||
|  |         directories = [ | ||||||
|  |           stateDir | ||||||
|  |         ]; | ||||||
|  |       }; | ||||||
|  |     }) | ||||||
|  |   ]); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue