mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
chore: nf-fmt-nix
This commit is contained in:
parent
c2726dd41b
commit
ffde3c1c27
14 changed files with 170 additions and 131 deletions
20
modules/extern/home/ssh.nix
vendored
20
modules/extern/home/ssh.nix
vendored
|
|
@ -54,12 +54,15 @@ let
|
|||
++ optional (sshd.ports.public.enable or false) sshd.ports.public.port
|
||||
++ [sshd.ports.standard.port]
|
||||
);
|
||||
in mkOptionDefault port;
|
||||
in
|
||||
mkOptionDefault port;
|
||||
hostName = let
|
||||
hostName = if config.network != null
|
||||
hostName =
|
||||
if config.network != null
|
||||
then system.network.networks.${config.network}.fqdn
|
||||
else sshHostConfig.hostName;
|
||||
in mkOptionDefault hostName;
|
||||
in
|
||||
mkOptionDefault hostName;
|
||||
hostKeyAlias = mkOptionDefault sshHostConfig.hostKeyAlias;
|
||||
matchBlockSettings = {
|
||||
hostname = mkDefault config.hostName;
|
||||
|
|
@ -176,7 +179,10 @@ let
|
|||
then head canonNetworkName'
|
||||
else null;
|
||||
mkNetwork = network: nameValuePair (mkNetworkName network) (mkNetworkConf network);
|
||||
mkNetworkName = network: if network != null then network else "fallback";
|
||||
mkNetworkName = network:
|
||||
if network != null
|
||||
then network
|
||||
else "fallback";
|
||||
mkNetworkConf = network: let
|
||||
needsProxy = network == "int" || (network == "local" && !access.local.enable);
|
||||
networkConf = {
|
||||
|
|
@ -186,7 +192,8 @@ let
|
|||
cfg.proxyJump
|
||||
)));
|
||||
};
|
||||
in networkConf;
|
||||
in
|
||||
networkConf;
|
||||
in
|
||||
mapListToAttrs mkNetwork networks;
|
||||
set = {
|
||||
|
|
@ -197,7 +204,8 @@ let
|
|||
extraOptions = unmerged.mergeAttrs config.extraOptions;
|
||||
};
|
||||
extraSettings = unmerged.mergeAttrs config.extraSettings;
|
||||
in mkMerge [ matchBlock extraSettings ];
|
||||
in
|
||||
mkMerge [matchBlock extraSettings];
|
||||
matchBlocksSettings = let
|
||||
mkMatchBlock = _: network: let
|
||||
matchBlockConf = mkMerge [
|
||||
|
|
|
|||
|
|
@ -23,7 +23,10 @@
|
|||
}: let
|
||||
port = service.ports.${portName};
|
||||
# TODO: this properly
|
||||
getAddressFor = if port.status.gatus.client.network or "ip" == "ip4" then "getAddress4For" else "getAddressFor";
|
||||
getAddressFor =
|
||||
if port.status.gatus.client.network or "ip" == "ip4"
|
||||
then "getAddress4For"
|
||||
else "getAddressFor";
|
||||
in "${mkAddress6 (access.${getAddressFor} system.name "lan")}:${toString port.port}";
|
||||
mkServiceConfig = system: serviceName: let
|
||||
inherit (service.prometheus) exporter;
|
||||
|
|
|
|||
|
|
@ -75,8 +75,10 @@ in {
|
|||
allowedTCPPorts = map mkExporterPort exporters;
|
||||
res = builtins.tryEval (any (enablePort true) exporters);
|
||||
cond = lib.warnIf (!res.success) "broken prometheus exporter: ${name}" res.value;
|
||||
in mkIf cond allowedTCPPorts;
|
||||
in
|
||||
mkIf cond allowedTCPPorts;
|
||||
mkExporterPort = exporter: mkIf (enablePort false exporter) exporter.port;
|
||||
in mkMerge (mapAttrsToList mkExporterPorts allExporters);
|
||||
in
|
||||
mkMerge (mapAttrsToList mkExporterPorts allExporters);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue