Refactor homelab ports
This commit is contained in:
parent
518bfe9cd4
commit
f42833545b
10 changed files with 61 additions and 61 deletions
|
@ -1,10 +1,11 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
port = 8082;
|
||||
service = "pihole";
|
||||
port = config.homelab.ports.${service};
|
||||
in
|
||||
{
|
||||
virtualisation.oci-containers.containers."pihole" = {
|
||||
virtualisation.oci-containers.containers.${service} = {
|
||||
image = "pihole/pihole:latest";
|
||||
|
||||
environment = {
|
||||
|
@ -22,7 +23,7 @@ in
|
|||
"53:53/tcp"
|
||||
"53:53/udp"
|
||||
"67:67/udp"
|
||||
"${toString port}:80/tcp"
|
||||
"${port}:80/tcp"
|
||||
];
|
||||
|
||||
log-driver = "journald";
|
||||
|
|
|
@ -11,16 +11,13 @@ let
|
|||
cfg = homelab.services.${service};
|
||||
service = "tubearchivist";
|
||||
homelab = config.homelab;
|
||||
|
||||
port = homelab.ports.${service};
|
||||
in
|
||||
{
|
||||
options.homelab.services.${service} = {
|
||||
enable = mkEnableOption "Enable ${service}";
|
||||
|
||||
port = mkOption {
|
||||
default = 8099;
|
||||
type = types.port;
|
||||
};
|
||||
|
||||
url = mkOption {
|
||||
default = "${service}.${homelab.domain}";
|
||||
type = types.str;
|
||||
|
@ -177,7 +174,7 @@ in
|
|||
];
|
||||
|
||||
ports = [
|
||||
"${toString cfg.port}:8000/tcp"
|
||||
"${toString port}:8000/tcp"
|
||||
];
|
||||
|
||||
dependsOn = [
|
||||
|
@ -321,7 +318,7 @@ in
|
|||
useACMEHost = homelab.domain;
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString cfg.port}";
|
||||
proxyPass = "http://localhost:${toString port}";
|
||||
recommendedProxySettings = true;
|
||||
proxyWebsockets = true;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue