2024-12-08 16:12:00 +00:00
|
|
|
# Extra utility functions
|
2024-12-06 18:04:47 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
# Parses the domain from a URI
|
|
|
|
getDomainFromURI =
|
|
|
|
url:
|
|
|
|
let
|
|
|
|
parsedURL = (lib.strings.splitString "." url);
|
|
|
|
in
|
|
|
|
builtins.concatStringsSep "." [
|
|
|
|
(builtins.elemAt parsedURL 1)
|
|
|
|
(builtins.elemAt parsedURL 2)
|
|
|
|
];
|
|
|
|
}
|