forked from fediversity/fediversity
		
	Move old procolix.vm options to new procolixVm ones
				
					
				
			This commit is contained in:
		
							parent
							
								
									eaad4daa39
								
							
						
					
					
						commit
						4d00635e69
					
				
					 8 changed files with 51 additions and 66 deletions
				
			
		|  | @ -1,18 +1,10 @@ | |||
| { config, lib, ... }: | ||||
| 
 | ||||
| let | ||||
|   inherit (lib) mkOption mkDefault; | ||||
|   inherit (lib) mkDefault; | ||||
| 
 | ||||
| in | ||||
| { | ||||
|   options = { | ||||
|     procolix.vm = { | ||||
|       name = mkOption { }; | ||||
|       ip4 = mkOption { }; | ||||
|       ip6 = mkOption { }; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = { | ||||
|     services.openssh = { | ||||
|       enable = true; | ||||
|  | @ -20,8 +12,8 @@ in | |||
|     }; | ||||
| 
 | ||||
|     networking = { | ||||
|       hostName = config.procolix.vm.name; | ||||
|       domain = "procolix.com"; | ||||
|       hostName = config.procolixVm.name; | ||||
|       domain = config.procolixVm.domain; | ||||
| 
 | ||||
|       ## REVIEW: Do we actually need that, considering that we have static IPs? | ||||
|       useDHCP = mkDefault true; | ||||
|  | @ -31,16 +23,14 @@ in | |||
|           ipv4 = { | ||||
|             addresses = [ | ||||
|               { | ||||
|                 address = config.procolix.vm.ip4; | ||||
|                 prefixLength = 24; | ||||
|                 inherit (config.procolixVm.ipv4) address prefixLength; | ||||
|               } | ||||
|             ]; | ||||
|           }; | ||||
|           ipv6 = { | ||||
|             addresses = [ | ||||
|               { | ||||
|                 address = config.procolix.vm.ip6; | ||||
|                 prefixLength = 64; | ||||
|                 inherit (config.procolixVm.ipv6) address prefixLength; | ||||
|               } | ||||
|             ]; | ||||
|           }; | ||||
|  | @ -48,11 +38,11 @@ in | |||
|       }; | ||||
| 
 | ||||
|       defaultGateway = { | ||||
|         address = "185.206.232.1"; | ||||
|         address = config.procolixVm.ipv4.gateway; | ||||
|         interface = "eth0"; | ||||
|       }; | ||||
|       defaultGateway6 = { | ||||
|         address = "2a00:51c0:12:1201::1"; | ||||
|         address = config.procolixVm.ipv6.gateway; | ||||
|         interface = "eth0"; | ||||
|       }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -8,7 +8,21 @@ in | |||
|   options = { | ||||
|     procolixVm = { | ||||
|       name = mkOption { }; | ||||
|       host = mkOption { }; | ||||
|       domain = mkOption { default = "procolix.com"; }; | ||||
| 
 | ||||
|       ipv4 = { | ||||
|         address = mkOption { }; | ||||
|         prefixLength = mkOption { | ||||
|           default = 24; | ||||
|         }; | ||||
|         gateway = mkOption { default = "185.206.232.1"; }; | ||||
|       }; | ||||
| 
 | ||||
|       ipv6 = { | ||||
|         address = mkOption { }; | ||||
|         prefixLength = mkOption { default = 64; }; | ||||
|         gateway = mkOption { default = "2a00:51c0:12:1201::1"; }; | ||||
|       }; | ||||
| 
 | ||||
|       hostPublicKey = mkOption { | ||||
|         description = '' | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ in | |||
|   imports = [ ./options.nix ]; | ||||
| 
 | ||||
|   ssh = { | ||||
|     host = config.procolixVm.host; | ||||
|     host = config.procolixVm.ipv4.address; | ||||
|     hostPublicKey = hostPublicKey; | ||||
|   }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,29 +1,22 @@ | |||
| { lib, ... }: | ||||
| 
 | ||||
| let | ||||
|   inherit (lib) mkForce; | ||||
| 
 | ||||
| in | ||||
| { | ||||
|   procolixVm.host = "95.215.187.30"; | ||||
|   procolixVm = { | ||||
|     domain = "fediversity.eu"; | ||||
| 
 | ||||
|     ipv4 = { | ||||
|       address = "95.215.187.30"; | ||||
|       gateway = "95.215.187.1"; | ||||
|     }; | ||||
|     ipv6 = { | ||||
|       address = "2a00:51c0:12:1305::30"; | ||||
|       gateway = "2a00:51c0:13:1305::1"; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   nixos.module = { | ||||
|     imports = [ | ||||
|       ./forgejo-actions-runner.nix | ||||
|     ]; | ||||
| 
 | ||||
|     procolix.vm = { | ||||
|       name = "fedi300"; | ||||
|       ip4 = "95.215.187.30"; | ||||
|       ip6 = "2a00:51c0:12:1305::30"; | ||||
|     }; | ||||
| 
 | ||||
|     ## FIXME: We should just have an option under `procolix.vm` to distinguish | ||||
|     ## between Procolix VMs and Fediversity ones. | ||||
|     networking.domain = mkForce "fediversity.eu"; | ||||
|     networking.defaultGateway.address = mkForce "95.215.187.1"; | ||||
|     networking.defaultGateway6.address = mkForce "2a00:51c0:13:1305::1"; | ||||
| 
 | ||||
|     fileSystems."/" = { | ||||
|       device = "/dev/disk/by-uuid/cbcfaf6b-39bd-4328-9f53-dea8a9d32ecc"; | ||||
|       fsType = "ext4"; | ||||
|  |  | |||
|  | @ -1,17 +1,14 @@ | |||
| { | ||||
|   procolixVm.host = "185.206.232.34"; | ||||
|   procolixVm = { | ||||
|     ipv4.address = "185.206.232.34"; | ||||
|     ipv6.address = "2a00:51c0:12:1201::20"; | ||||
|   }; | ||||
| 
 | ||||
|   nixos.module = { | ||||
|     imports = [ | ||||
|       ./forgejo.nix | ||||
|     ]; | ||||
| 
 | ||||
|     procolix.vm = { | ||||
|       name = "vm02116"; | ||||
|       ip4 = "185.206.232.34"; | ||||
|       ip6 = "2a00:51c0:12:1201::20"; | ||||
|     }; | ||||
| 
 | ||||
|     ## vm02116 is running on old hardware based on a Xen VM environment, so it | ||||
|     ## needs these extra options. Once the VM gets moved to a newer node, these | ||||
|     ## two options can safely be removed. | ||||
|  |  | |||
|  | @ -1,13 +1,10 @@ | |||
| { | ||||
|   procolixVm.host = "185.206.232.179"; | ||||
|   procolixVm = { | ||||
|     ipv4.address = "185.206.232.179"; | ||||
|     ipv6.address = "2a00:51c0:12:1201::179"; | ||||
|   }; | ||||
| 
 | ||||
|   nixos.module = { | ||||
|     procolix.vm = { | ||||
|       name = "vm02179"; | ||||
|       ip4 = "185.206.232.179"; | ||||
|       ip6 = "2a00:51c0:12:1201::179"; | ||||
|     }; | ||||
| 
 | ||||
|     fileSystems."/" = { | ||||
|       device = "/dev/disk/by-uuid/119863f8-55cf-4e2f-ac17-27599a63f241"; | ||||
|       fsType = "ext4"; | ||||
|  |  | |||
|  | @ -1,13 +1,10 @@ | |||
| { | ||||
|   procolixVm.host = "185.206.232.186"; | ||||
|   procolixVm = { | ||||
|     ipv4.address = "185.206.232.186"; | ||||
|     ipv6.address = "2a00:51c0:12:1201::186"; | ||||
|   }; | ||||
| 
 | ||||
|   nixos.module = { | ||||
|     procolix.vm = { | ||||
|       name = "vm02186"; | ||||
|       ip4 = "185.206.232.186"; | ||||
|       ip6 = "2a00:51c0:12:1201::186"; | ||||
|     }; | ||||
| 
 | ||||
|     fileSystems."/" = { | ||||
|       device = "/dev/disk/by-uuid/833ac0f9-ad8c-45ae-a9bf-5844e378c44a"; | ||||
|       fsType = "ext4"; | ||||
|  |  | |||
|  | @ -1,17 +1,14 @@ | |||
| { | ||||
|   procolixVm.host = "185.206.232.187"; | ||||
|   procolixVm = { | ||||
|     ipv4.address = "185.206.232.187"; | ||||
|     ipv6.address = "2a00:51c0:12:1201::187"; | ||||
|   }; | ||||
| 
 | ||||
|   nixos.module = { | ||||
|     imports = [ | ||||
|       ./wiki.nix | ||||
|     ]; | ||||
| 
 | ||||
|     procolix.vm = { | ||||
|       name = "vm02187"; | ||||
|       ip4 = "185.206.232.187"; | ||||
|       ip6 = "2a00:51c0:12:1201::187"; | ||||
|     }; | ||||
| 
 | ||||
|     fileSystems."/" = { | ||||
|       device = "/dev/disk/by-uuid/a46a9c46-e32b-4216-a4aa-8819b2cd0d49"; | ||||
|       fsType = "ext4"; | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue