mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 14:50:40 +02:00
feat(topology): improve details readability
This commit is contained in:
parent
beb50045b4
commit
e48cd0581b
4 changed files with 14 additions and 9 deletions
|
@ -14,6 +14,7 @@
|
|||
- impermanence render?
|
||||
- nixos nftables firewall render?
|
||||
|
||||
- make colors configurable
|
||||
- search todo and do
|
||||
- the network propagator based on options.nodes cannot deal with mkMerge and mkIf stuff currently
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
mkDefault
|
||||
mkEnableOption
|
||||
mkIf
|
||||
mkMerge
|
||||
optional
|
||||
replaceStrings
|
||||
;
|
||||
|
@ -76,8 +77,8 @@ in {
|
|||
nginx = mkIf config.services.nginx.enable {
|
||||
name = "NGINX";
|
||||
icon = "services.nginx";
|
||||
details.reverse = let
|
||||
lines = flatten (flip mapAttrsToList config.services.nginx.virtualHosts (
|
||||
details = let
|
||||
reverseProxies = flatten (flip mapAttrsToList config.services.nginx.virtualHosts (
|
||||
server: vh:
|
||||
flip mapAttrsToList vh.locations (
|
||||
path: location: let
|
||||
|
@ -87,11 +88,13 @@ in {
|
|||
then toString (attrNames config.services.nginx.upstreams.${upstreamName}.servers)
|
||||
else location.proxyPass;
|
||||
in
|
||||
optional (path == "/" && location.proxyPass != null) "${server} -> ${passTo}"
|
||||
optional (path == "/" && location.proxyPass != null) {
|
||||
${server} = {text = passTo;};
|
||||
}
|
||||
)
|
||||
));
|
||||
in
|
||||
mkIf (lines != []) {text = concatLines lines;};
|
||||
mkMerge reverseProxies;
|
||||
};
|
||||
|
||||
radicale = mkIf config.services.radicale.enable {
|
||||
|
|
|
@ -50,8 +50,8 @@ in {
|
|||
++ concatLists (
|
||||
flip mapAttrsToList config.systemd.network.networks (
|
||||
_unit: network: let
|
||||
# FIXME: TODO renameInterfacesByMac is not a standard option!
|
||||
macToName = listToAttrs (mapAttrsToList (k: v: nameValuePair v k) config.networking.renameInterfacesByMac);
|
||||
# FIXME: TODO renameInterfacesByMac is not a standard option! It's not an issue here but should proabaly not be used anyway.
|
||||
macToName = listToAttrs (mapAttrsToList (k: v: nameValuePair v k) (config.networking.renameInterfacesByMac or {}));
|
||||
|
||||
nameFromMac =
|
||||
optional (network ? matchConfig.MACAddress && macToName ? ${network.matchConfig.MACAddress})
|
||||
|
|
|
@ -179,9 +179,10 @@
|
|||
html
|
||||
*/
|
||||
''
|
||||
<div tw="flex flex-row mt-1">
|
||||
<span tw="flex text-sm flex-none w-22 font-bold pl-1">${detail.name}</span>
|
||||
<span tw="flex text-sm grow">${detail.text}</span>
|
||||
<div tw="flex flex-row flex-wrap mt-1">
|
||||
<span tw="flex text-sm flex-none min-w-16 font-bold pl-1">${detail.name}</span>
|
||||
<span tw="flex grow"></span>
|
||||
<span tw="flex text-sm ml-4">${detail.text}</span>
|
||||
</div>
|
||||
'';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue