Move old procolix.vm options to new procolixVm ones

This commit is contained in:
Nicolas Jeannerod 2025-01-31 17:15:12 +01:00
parent eaad4daa39
commit 4d00635e69
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8
8 changed files with 51 additions and 66 deletions

View file

@ -1,18 +1,10 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib) mkOption mkDefault; inherit (lib) mkDefault;
in in
{ {
options = {
procolix.vm = {
name = mkOption { };
ip4 = mkOption { };
ip6 = mkOption { };
};
};
config = { config = {
services.openssh = { services.openssh = {
enable = true; enable = true;
@ -20,8 +12,8 @@ in
}; };
networking = { networking = {
hostName = config.procolix.vm.name; hostName = config.procolixVm.name;
domain = "procolix.com"; domain = config.procolixVm.domain;
## REVIEW: Do we actually need that, considering that we have static IPs? ## REVIEW: Do we actually need that, considering that we have static IPs?
useDHCP = mkDefault true; useDHCP = mkDefault true;
@ -31,16 +23,14 @@ in
ipv4 = { ipv4 = {
addresses = [ addresses = [
{ {
address = config.procolix.vm.ip4; inherit (config.procolixVm.ipv4) address prefixLength;
prefixLength = 24;
} }
]; ];
}; };
ipv6 = { ipv6 = {
addresses = [ addresses = [
{ {
address = config.procolix.vm.ip6; inherit (config.procolixVm.ipv6) address prefixLength;
prefixLength = 64;
} }
]; ];
}; };
@ -48,11 +38,11 @@ in
}; };
defaultGateway = { defaultGateway = {
address = "185.206.232.1"; address = config.procolixVm.ipv4.gateway;
interface = "eth0"; interface = "eth0";
}; };
defaultGateway6 = { defaultGateway6 = {
address = "2a00:51c0:12:1201::1"; address = config.procolixVm.ipv6.gateway;
interface = "eth0"; interface = "eth0";
}; };

View file

@ -8,7 +8,21 @@ in
options = { options = {
procolixVm = { procolixVm = {
name = mkOption { }; 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 { hostPublicKey = mkOption {
description = '' description = ''

View file

@ -20,7 +20,7 @@ in
imports = [ ./options.nix ]; imports = [ ./options.nix ];
ssh = { ssh = {
host = config.procolixVm.host; host = config.procolixVm.ipv4.address;
hostPublicKey = hostPublicKey; hostPublicKey = hostPublicKey;
}; };

View file

@ -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 = { nixos.module = {
imports = [ imports = [
./forgejo-actions-runner.nix ./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."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/cbcfaf6b-39bd-4328-9f53-dea8a9d32ecc"; device = "/dev/disk/by-uuid/cbcfaf6b-39bd-4328-9f53-dea8a9d32ecc";
fsType = "ext4"; fsType = "ext4";

View file

@ -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 = { nixos.module = {
imports = [ imports = [
./forgejo.nix ./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 ## 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 ## needs these extra options. Once the VM gets moved to a newer node, these
## two options can safely be removed. ## two options can safely be removed.

View file

@ -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 = { nixos.module = {
procolix.vm = {
name = "vm02179";
ip4 = "185.206.232.179";
ip6 = "2a00:51c0:12:1201::179";
};
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/119863f8-55cf-4e2f-ac17-27599a63f241"; device = "/dev/disk/by-uuid/119863f8-55cf-4e2f-ac17-27599a63f241";
fsType = "ext4"; fsType = "ext4";

View file

@ -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 = { nixos.module = {
procolix.vm = {
name = "vm02186";
ip4 = "185.206.232.186";
ip6 = "2a00:51c0:12:1201::186";
};
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/833ac0f9-ad8c-45ae-a9bf-5844e378c44a"; device = "/dev/disk/by-uuid/833ac0f9-ad8c-45ae-a9bf-5844e378c44a";
fsType = "ext4"; fsType = "ext4";

View file

@ -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 = { nixos.module = {
imports = [ imports = [
./wiki.nix ./wiki.nix
]; ];
procolix.vm = {
name = "vm02187";
ip4 = "185.206.232.187";
ip6 = "2a00:51c0:12:1201::187";
};
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/a46a9c46-e32b-4216-a4aa-8819b2cd0d49"; device = "/dev/disk/by-uuid/a46a9c46-e32b-4216-a4aa-8819b2cd0d49";
fsType = "ext4"; fsType = "ext4";