Refactor homelab ports
All checks were successful
/ check (push) Successful in 38s

Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
Oliver Davies 2025-11-05 00:27:05 +00:00
parent 239fb86c5d
commit fa38f26bb1
8 changed files with 35 additions and 31 deletions

View file

@ -2,7 +2,7 @@
let
service = "pihole";
port = config.homelab.ports.${service};
port = config.homelab.ports.services.${service};
in
{
virtualisation.oci-containers.containers.${service} = {

View file

@ -13,7 +13,7 @@ let
service = "tubearchivist";
homelab = config.homelab;
port = homelab.ports.${service};
port = homelab.ports.services.${service};
in
{
options.homelab.services.${service} = {

View file

@ -2,7 +2,7 @@
let
ports = config.homelab.ports;
port = ports.nginx-website-sculpin;
port = ports.nginx.website-sculpin;
redirects = builtins.concatStringsSep "\n" (
map (r: "rewrite ^${r.from}/?$ ${r.to} redirect;") (import ./redirects.nix)
@ -26,7 +26,7 @@ let
"themes/custom/opdavies"
];
port = ports.nginx-website-tome;
port = ports.nginx.website-tome;
};
tomeLocations = builtins.listToAttrs (

View file

@ -3,7 +3,7 @@
let
name = "ponthirtaekwondo.co.uk";
ports = config.homelab.ports;
port = ports.nginx-ponthir-taekwondo;
port = ports.nginx.ponthir-taekwondo;
in
{
security.acme.certs = {

View file

@ -5,7 +5,7 @@ let
name: overrides:
let
root = "/var/www/vhosts/${name}" + (overrides.rootSuffix or "");
port = ports."nginx-${name}";
port = ports.nginx.${name};
url = "${name}.oliverdavies.uk";
in
{ inherit port root url; } // overrides;

View file

@ -6,33 +6,37 @@ in
{
options.homelab.ports = mkOption {
internal = true;
type = types.attrsOf types.port;
type = types.attrsOf (types.attrsOf types.port);
};
config.homelab.ports = {
services = {
mealie = 9001;
pihole = 8082;
tubearchivist = 8099;
vaultwarden = 8022;
};
nginx-website-sculpin = 8095;
nginx-website-tome = 8098;
nginx = {
website-sculpin = 8095;
website-tome = 8098;
nginx-books = 9002;
nginx-bootstrap-with-tailwind = 8081;
nginx-eric = 8084;
nginx-examples = 9003;
nginx-florida-drupalcamp-tailwind-css = 8083;
nginx-luke = 8094;
nginx-phpsw-sculpin-demo = 8085;
nginx-ponthir-taekwondo = 9004;
nginx-rebuilding-acquia = 8086;
nginx-rebuilding-bartik = 8087;
nginx-rebuilding-bristol-js = 8088;
nginx-rebuilding-symfony = 8089;
nginx-tailwindcss-demo = 8090;
nginx-talking-drupal-tailwindcss = 8093;
nginx-wp-tailwind = 8091;
nginx-zet = 8092;
books = 9002;
bootstrap-with-tailwind = 8081;
eric = 8084;
examples = 9003;
florida-drupalcamp-tailwind-css = 8083;
luke = 8094;
phpsw-sculpin-demo = 8085;
ponthir-taekwondo = 9004;
rebuilding-acquia = 8086;
rebuilding-bartik = 8087;
rebuilding-bristol-js = 8088;
rebuilding-symfony = 8089;
tailwindcss-demo = 8090;
talking-drupal-tailwindcss = 8093;
wp-tailwind = 8091;
zet = 8092;
};
};
}

View file

@ -10,7 +10,7 @@ in
database.createLocally = true;
port = ports.mealie;
port = ports.services.mealie;
settings.ALLOW_SIGNUP = "false";
};

View file

@ -32,7 +32,7 @@ in
config = {
DOMAIN = "https://${cfg.url}";
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = homelab.ports.${service};
ROCKET_PORT = homelab.ports.services.${service};
SIGNUPS_ALLOWED = false;
};
};