38 lines
No EOL
866 B
Nix
38 lines
No EOL
866 B
Nix
{ lib, ...}:
|
|
let
|
|
inherit (builtins) isString typeOf;
|
|
inherit (lib) mkOption types throwIfNot concatStringsSep splitStringBy toLower map;
|
|
in
|
|
{
|
|
options = {
|
|
mkUrlOptions =
|
|
defaults:
|
|
{
|
|
host = mkOption {
|
|
type = types.str;
|
|
example = "host.tld";
|
|
description = ''
|
|
Hostname
|
|
'';
|
|
} // (defaults.host or {});
|
|
|
|
port = mkOption {
|
|
type = types.port;
|
|
default = 1234;
|
|
example = "1234";
|
|
description = ''
|
|
Port
|
|
'';
|
|
} // (defaults.port or {});
|
|
|
|
protocol = mkOption {
|
|
type = types.str;
|
|
default = "https";
|
|
example = "https";
|
|
description = ''
|
|
Which protocol to use when creating a url string
|
|
'';
|
|
} // (defaults.protocol or {});
|
|
};
|
|
};
|
|
} |