mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(invidious): tail access
This commit is contained in:
parent
8438bf5b45
commit
c06a1e9d79
2 changed files with 13 additions and 2 deletions
|
|
@ -6,6 +6,7 @@
|
|||
inherit (lib.options) mkOption;
|
||||
inherit (lib.modules) mkIf mkDefault mkOptionDefault;
|
||||
inherit (config.services.nginx) virtualHosts;
|
||||
inherit (config.services) tailscale;
|
||||
cfg = config.services.invidious;
|
||||
access = config.services.nginx.access.invidious;
|
||||
in {
|
||||
|
|
@ -21,6 +22,10 @@ in {
|
|||
type = str;
|
||||
default = "yt.local.${config.networking.domain}";
|
||||
};
|
||||
tailDomain = mkOption {
|
||||
type = str;
|
||||
default = "yt.tail.${config.networking.domain}";
|
||||
};
|
||||
};
|
||||
config.services.nginx = {
|
||||
access.invidious = mkIf cfg.enable {
|
||||
|
|
@ -46,6 +51,7 @@ in {
|
|||
inherit extraConfig;
|
||||
};
|
||||
${access.localDomain} = { config, ... }: {
|
||||
serverAliases = mkIf tailscale.enable [ access.tailDomain ];
|
||||
local.enable = true;
|
||||
locations."/" = location;
|
||||
useACMEHost = mkDefault virtualHosts.${access.domain}.useACMEHost;
|
||||
|
|
|
|||
|
|
@ -115,8 +115,13 @@ in {
|
|||
};
|
||||
${access.invidious.domain} = {
|
||||
inherit (nginx) group;
|
||||
extraDomainNames = [
|
||||
access.invidious.localDomain
|
||||
extraDomainNames = mkMerge [
|
||||
[
|
||||
access.invidious.localDomain
|
||||
]
|
||||
(mkIf tailscale.enable [
|
||||
access.invidious.tailDomain
|
||||
])
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue