| 
									
										
										
										
											2022-12-05 22:53:04 +01:00
										 |  |  | # Podman related settings | 
					
						
							| 
									
										
										
										
											2023-11-07 22:00:00 +01:00
										 |  |  | { config, lib, options, pkgs, ... }: | 
					
						
							| 
									
										
										
										
											2022-12-05 22:53:04 +01:00
										 |  |  | let | 
					
						
							|  |  |  |   cfg = config.my.system.podman; | 
					
						
							|  |  |  | in | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   options.my.system.podman = with lib; { | 
					
						
							|  |  |  |     enable = mkEnableOption "podman configuration"; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   config = lib.mkIf cfg.enable { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     environment.systemPackages = with pkgs; [ | 
					
						
							|  |  |  |       podman-compose | 
					
						
							|  |  |  |     ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtualisation.podman = { | 
					
						
							|  |  |  |       enable = true; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       # Use fake `docker` command to redirect to `podman` | 
					
						
							| 
									
										
										
										
											2023-03-27 00:33:31 +02:00
										 |  |  |       # but only if docker is not enabled | 
					
						
							|  |  |  |       dockerCompat = !config.my.system.docker.enable; | 
					
						
							| 
									
										
										
										
											2022-12-05 22:53:04 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |       # Expose a docker-like socket | 
					
						
							|  |  |  |       dockerSocket.enable = true; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       # Allow DNS resolution in the default network | 
					
						
							| 
									
										
										
										
											2023-06-01 00:09:26 +02:00
										 |  |  |       defaultNetwork.settings.dns_enabled = true; | 
					
						
							| 
									
										
										
										
											2022-12-25 12:22:51 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-01 00:09:26 +02:00
										 |  |  |       autoPrune.enable = true; | 
					
						
							| 
									
										
										
										
											2022-12-05 22:53:04 +01:00
										 |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | } |