masive rewriting and setup of server files
This commit is contained in:
@@ -2,20 +2,22 @@
|
||||
lib,
|
||||
config,
|
||||
proxyReverse,
|
||||
setup,
|
||||
...
|
||||
}:
|
||||
let
|
||||
port = 8082;
|
||||
services = import ./homepage/services.nix { inherit config lib; };
|
||||
cfg = config.my.servers.homepage;
|
||||
in
|
||||
{
|
||||
options.my.servers.homepage.enable = lib.mkEnableOption "enable";
|
||||
config = lib.mkIf config.my.servers.homepage.enable {
|
||||
sops.secrets.homepage.sopsFile = ../../secrets/env.yaml;
|
||||
options.my.servers.homepage = setup.mkOptions "homepage" "home" 8082;
|
||||
config = {
|
||||
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
|
||||
sops.secrets = lib.mkIf cfg.enable { homepage.sopsFile = ../../secrets/env.yaml; };
|
||||
services = {
|
||||
homepage-dashboard = {
|
||||
homepage-dashboard = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
listenPort = port;
|
||||
listenPort = cfg.port;
|
||||
environmentFile = config.sops.secrets.homepage.path;
|
||||
settings = {
|
||||
layout = {
|
||||
@@ -75,7 +77,9 @@ in
|
||||
}
|
||||
];
|
||||
};
|
||||
nginx.virtualHosts."home.${config.my.domain}" = proxyReverse port // { };
|
||||
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
|
||||
proxyReverse cfg.hostName cfg.port // { }
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user