mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
refactor(idp): access updates
This commit is contained in:
parent
f1639f78c5
commit
c3892e11f4
3 changed files with 73 additions and 81 deletions
|
|
@ -27,6 +27,12 @@
|
|||
includeTailscale = mkOption {
|
||||
type = bool;
|
||||
};
|
||||
localName = mkOption {
|
||||
type = nullOr str;
|
||||
};
|
||||
tailscaleName = mkOption {
|
||||
type = nullOr str;
|
||||
};
|
||||
};
|
||||
allServerNames = mkOption {
|
||||
type = listOf str;
|
||||
|
|
@ -42,6 +48,14 @@
|
|||
includeTailscale = mkOptionDefault (
|
||||
config.local.enable && tailscale.enable && cfg.qualifier != "tail"
|
||||
);
|
||||
localName = mkOptionDefault (
|
||||
if cfg.includeLocal then "${cfg.shortServer}.local.${networking.domain}"
|
||||
else null
|
||||
);
|
||||
tailscaleName = mkOptionDefault (
|
||||
if cfg.includeTailscale then "${cfg.shortServer}.tail.${networking.domain}"
|
||||
else null
|
||||
);
|
||||
};
|
||||
serverName = mkIf (cfg.shortServer != null) (mkDefault (
|
||||
cfg.shortServer
|
||||
|
|
@ -49,8 +63,8 @@
|
|||
+ ".${networking.domain}"
|
||||
));
|
||||
serverAliases = mkIf (cfg.shortServer != null) (mkDefault [
|
||||
(mkIf cfg.includeLocal "${cfg.shortServer}.local.${networking.domain}")
|
||||
(mkIf cfg.includeTailscale "${cfg.shortServer}.tail.${networking.domain}")
|
||||
(mkIf (cfg.localName != null) cfg.localName)
|
||||
(mkIf (cfg.tailscaleName != null) cfg.tailscaleName)
|
||||
]);
|
||||
allServerNames = mkOptionDefault (
|
||||
[ config.serverName ] ++ config.serverAliases
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue