+ portUtils +metabase
This commit is contained in:
11
lib/port-utils.nix
Normal file
11
lib/port-utils.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{lib}: let
|
||||
ports = import ./ports.nix;
|
||||
in {
|
||||
# Get port for a service, with optional host-specific override
|
||||
getPort = service: host:
|
||||
ports.hostPorts.${host}.${service} or ports.ports.${service};
|
||||
|
||||
# Get all ports for a specific host
|
||||
getHostPorts = host:
|
||||
lib.mapAttrs (_: port: port) (ports.ports // (ports.hostPorts.${host} or {}));
|
||||
}
|
||||
Reference in New Issue
Block a user