feat(box): gpodder deployed
This commit is contained in:
		
							parent
							
								
									afb1c0efb4
								
							
						
					
					
						commit
						676ed31aad
					
				
							
								
								
									
										21
									
								
								flake.nix
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								flake.nix
									
									
									
									
									
								
							|  | @ -214,19 +214,6 @@ | ||||||
|           ]; |           ]; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         cube = nixpkgs.lib.nixosSystem rec { |  | ||||||
|           specialArgs = { inherit inputs self; }; |  | ||||||
|           system = "x86_64-linux"; |  | ||||||
|           pkgs = litePkgsFor.${system}; |  | ||||||
|           modules = [ |  | ||||||
|             ./hosts/cube |  | ||||||
|             agenix.nixosModules.age |  | ||||||
|             self.nixosModules.backup |  | ||||||
|             self.nixosModules.wireguard |  | ||||||
|             basant.nixosModule |  | ||||||
|           ]; |  | ||||||
|         }; |  | ||||||
| 
 |  | ||||||
|         box = nixpkgs.lib.nixosSystem rec { |         box = nixpkgs.lib.nixosSystem rec { | ||||||
|           specialArgs = { inherit inputs self; }; |           specialArgs = { inherit inputs self; }; | ||||||
|           system = "x86_64-linux"; |           system = "x86_64-linux"; | ||||||
|  | @ -237,6 +224,7 @@ | ||||||
|             self.nixosModules.backup |             self.nixosModules.backup | ||||||
|             self.nixosModules.wireguard |             self.nixosModules.wireguard | ||||||
|             self.nixosModules.gonic |             self.nixosModules.gonic | ||||||
|  |             self.nixosModules.gpodder2go | ||||||
|             self.nixosModules.wallabag |             self.nixosModules.wallabag | ||||||
|             self.nixosModules.ulogger-server |             self.nixosModules.ulogger-server | ||||||
|             grasp.nixosModule |             grasp.nixosModule | ||||||
|  | @ -292,13 +280,6 @@ | ||||||
|             path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix; |             path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix; | ||||||
|           }; |           }; | ||||||
|         }; |         }; | ||||||
|         cube = { |  | ||||||
|           hostname = "lakhwara.com"; |  | ||||||
|           profiles.system = { |  | ||||||
|             user = "root"; |  | ||||||
|             path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cube; |  | ||||||
|           }; |  | ||||||
|         }; |  | ||||||
|       }; |       }; | ||||||
| 
 | 
 | ||||||
|       checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; |       checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; | ||||||
|  |  | ||||||
|  | @ -39,6 +39,7 @@ let | ||||||
|     "tracks.mossnet.lan" |     "tracks.mossnet.lan" | ||||||
|     "grasp.mossnet.lan" |     "grasp.mossnet.lan" | ||||||
|     "photos.mossnet.lan" |     "photos.mossnet.lan" | ||||||
|  |     "pod.mossnet.lan" | ||||||
|   ]; |   ]; | ||||||
| 
 | 
 | ||||||
| in | in | ||||||
|  |  | ||||||
|  | @ -1,4 +1,16 @@ | ||||||
| { | { | ||||||
|   services.gpodder.enable = true; |   services.gpodder.enable = true; | ||||||
|   networking.firewall.allowedTCPPorts = [ 3005 ]; |   networking.firewall.allowedTCPPorts = [ 3005 ]; | ||||||
|  |   services.nginx.virtualHosts."pod.mossnet.lan" = { | ||||||
|  |     extraConfig = "client_max_body_size 20M;"; | ||||||
|  | 
 | ||||||
|  |     locations."/" = { | ||||||
|  |       extraConfig = '' | ||||||
|  |         proxy_pass http://localhost:3005/; | ||||||
|  |         proxy_set_header    X-Forwarded-Proto $scheme; | ||||||
|  |         proxy_set_header    X-Real-IP $remote_addr; | ||||||
|  |         proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for; | ||||||
|  |       ''; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -18,6 +18,7 @@ | ||||||
|     192.168.1.240 tracks.mossnet.lan |     192.168.1.240 tracks.mossnet.lan | ||||||
|     192.168.1.240 grasp.mossnet.lan |     192.168.1.240 grasp.mossnet.lan | ||||||
|     192.168.1.240 photos.mossnet.lan |     192.168.1.240 photos.mossnet.lan | ||||||
|  |     192.168.1.240 pod.mossnet.lan | ||||||
|   ''; |   ''; | ||||||
|   # 10.0.69.4 mossnet.lan |   # 10.0.69.4 mossnet.lan | ||||||
|   #  10.0.69.4 links.mossnet.lan |   #  10.0.69.4 links.mossnet.lan | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ | ||||||
| with lib; | with lib; | ||||||
| 
 | 
 | ||||||
| let | let | ||||||
|   cfg = config.services.gpodder2go; |   cfg = config.services.gpodder; | ||||||
| in | in | ||||||
| { | { | ||||||
|   options = { |   options = { | ||||||
|  | @ -53,7 +53,7 @@ in | ||||||
|         Environment = [ |         Environment = [ | ||||||
|           "VERIFIER_SECRET_KEY=${cfg.VERIFIER_SECRET_KEY}" |           "VERIFIER_SECRET_KEY=${cfg.VERIFIER_SECRET_KEY}" | ||||||
|         ]; |         ]; | ||||||
|         WorkingDirectory = dataFolder; |         WorkingDirectory = cfg.dataFolder; | ||||||
|         TimeoutStopSec = " 20 "; |         TimeoutStopSec = " 20 "; | ||||||
|         KillMode = " process "; |         KillMode = " process "; | ||||||
|         RestartSec = " 10 "; |         RestartSec = " 10 "; | ||||||
|  | @ -73,8 +73,8 @@ in | ||||||
|         RestrictNamespaces = " yes "; |         RestrictNamespaces = " yes "; | ||||||
|         RestrictRealtime = " yes "; |         RestrictRealtime = " yes "; | ||||||
|         SystemCallFilter = "~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap"; |         SystemCallFilter = "~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap"; | ||||||
|         ReadWritePaths = dataFolder; |         ReadWritePaths = cfg.dataFolder; | ||||||
|         StateDirectory = baseNameOf dataFolder; |         StateDirectory = baseNameOf cfg.dataFolder; | ||||||
|       }; |       }; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  | @ -90,25 +90,31 @@ in | ||||||
|     users.groups = optionalAttrs (cfg.group == "gpodder") ({ |     users.groups = optionalAttrs (cfg.group == "gpodder") ({ | ||||||
|       gpodder = { }; |       gpodder = { }; | ||||||
|     }); |     }); | ||||||
|   }; |  | ||||||
| 
 | 
 | ||||||
|   systemd.services.gpodder-install = { |     # systemd.services.gpodder-install = { | ||||||
|     description = "gpodder install service"; |     #   description = "gpodder install service"; | ||||||
|     wantedBy = [ "multi-user.target" ]; |     #   wantedBy = [ "multi-user.target" ]; | ||||||
|     before = [ "gpodder.service" ]; |     #   before = [ "gpodder.service" ]; | ||||||
|     path = with pkgs; [ gpodder2go ]; |     #   path = with pkgs; [ gpodder2go ]; | ||||||
| 
 | 
 | ||||||
|     serviceConfig = { |     #   serviceConfig = { | ||||||
|       User = cfg.user; |     #     User = cfg.user; | ||||||
|       Type = "oneshot"; |     #     Type = "oneshot"; | ||||||
|     } // commonServiceConfig; |     #     CacheDirectory = "gpodder"; | ||||||
|  |     #     # Stores sessions. | ||||||
|  |     #     CacheDirectoryMode = "700"; | ||||||
|  |     #     ConfigurationDirectory = "gpodder"; | ||||||
|  |     #     LogsDirectory = "gpodder"; | ||||||
|  |     #     StateDirectory = "gpodder"; | ||||||
|  |     #   }; | ||||||
| 
 | 
 | ||||||
|     script = '' |     #   script = '' | ||||||
|     if [ ! -f "${cfg.dataFolder}/installed" ]; then |     #   if [ ! -f "${cfg.dataFolder}/installed" ]; then | ||||||
|       ${pkgs.gpodder2go}/bin/gpodder2go init |     #     ${pkgs.gpodder2go}/bin/gpodder2go init | ||||||
|       touch "${cfg.dataFolder}/installed" |     #     touch "${cfg.dataFolder}/installed" | ||||||
|     fi |     #   fi | ||||||
|   ''; |     # ''; | ||||||
|  |     # }; | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue