feat: add homepage-dashboard module
This commit is contained in:
parent
fc16b83011
commit
b73ee34bef
@ -104,6 +104,7 @@
|
||||
networking.firewall.allowedTCPPorts = [80 443];
|
||||
|
||||
my.server.proxyIP = "10.0.0.2";
|
||||
my.services.homepage-dashboard.proxy = true;
|
||||
my.services.forgejo.proxy = true;
|
||||
|
||||
services.uptime-kuma = {
|
||||
|
@ -69,6 +69,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
my.services.homepage-dashboard = {
|
||||
enable = true;
|
||||
port = 8082;
|
||||
};
|
||||
|
||||
age.secrets.keycloakDb.file = ../../secrets/keycloak-db.age;
|
||||
services.keycloak = {
|
||||
enable = true;
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./forgejo
|
||||
./homepage-dashboard
|
||||
];
|
||||
}
|
||||
|
@ -52,16 +52,16 @@ in {
|
||||
|
||||
networking.firewall.interfaces."${firewallInterface}".allowedTCPPorts = [cfg.port];
|
||||
|
||||
# services.homepage-dashboard.services = [
|
||||
# {
|
||||
# Git = {
|
||||
# Forgejo = {
|
||||
# href = url;
|
||||
# description = "Beyond coding. We forge.";
|
||||
# };
|
||||
# };
|
||||
# }
|
||||
# ];
|
||||
services.homepage-dashboard.services = [
|
||||
{
|
||||
Git = {
|
||||
Forgejo = {
|
||||
href = url;
|
||||
description = "Beyond coding. We forge.";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
})
|
||||
(mkIf cfg.proxy {
|
||||
services.caddy.virtualHosts."${url}".extraConfig = ''
|
||||
|
43
modules/services/homepage-dashboard/default.nix
Normal file
43
modules/services/homepage-dashboard/default.nix
Normal file
@ -0,0 +1,43 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.my.services.homepage-dashboard;
|
||||
inherit (config.my.server) domain proxyIP firewallInterface;
|
||||
in {
|
||||
disabledModules = ["services/misc/homepage-dashboard.nix"];
|
||||
|
||||
imports = [
|
||||
# Use homepage-dashboard service from nixos-unstable channel.
|
||||
"${inputs.unstable}/nixos/modules/services/misc/homepage-dashboard.nix"
|
||||
];
|
||||
|
||||
options.my.services.homepage-dashboard = {
|
||||
enable = mkEnableOption "Homepage Dashboard";
|
||||
proxy = mkEnableOption "Homepage Dashboard reverse proxy entry";
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 8082;
|
||||
description = "HTTP port for the homepage-dashboard service.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enable {
|
||||
services.homepage-dashboard = {
|
||||
enable = true;
|
||||
listenPort = cfg.port;
|
||||
};
|
||||
|
||||
networking.firewall.interfaces."${firewallInterface}".allowedTCPPorts = [cfg.port];
|
||||
})
|
||||
(mkIf cfg.proxy {
|
||||
services.caddy.virtualHosts."${domain}".extraConfig = ''
|
||||
reverse_proxy http://${proxyIP}:${toString cfg.port}
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user