Refactor homelab ports
This commit is contained in:
parent
518bfe9cd4
commit
f42833545b
10 changed files with 61 additions and 61 deletions
|
@ -1,27 +1,16 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = homelab.services.${service};
|
||||
homelab = config.homelab;
|
||||
opts = options.services.${service};
|
||||
service = "homepage-dashboard";
|
||||
in
|
||||
{
|
||||
options.homelab.services.${service} = {
|
||||
enable = mkEnableOption "Enable ${service}";
|
||||
|
||||
port = mkOption {
|
||||
default = opts.listenPort.default;
|
||||
type = types.port;
|
||||
};
|
||||
|
||||
url = mkOption {
|
||||
default = "${config.networking.hostName}.${homelab.domain}";
|
||||
type = types.str;
|
||||
|
@ -32,7 +21,7 @@ in
|
|||
services = {
|
||||
${service} = {
|
||||
enable = true;
|
||||
listenPort = cfg.port;
|
||||
listenPort = homelab.ports.${service};
|
||||
openFirewall = true;
|
||||
|
||||
customCSS = ''
|
||||
|
|
|
@ -55,7 +55,7 @@ in
|
|||
config = {
|
||||
DOMAIN = "https://${cfg.url}";
|
||||
ROCKET_ADDRESS = "127.0.0.1";
|
||||
ROCKET_PORT = 8222;
|
||||
ROCKET_PORT = homelab.ports.${service};
|
||||
SIGNUPS_ALLOWED = false;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue