diff options
author | tv <tv@krebsco.de> | 2017-08-01 11:27:03 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2017-08-01 12:02:02 +0200 |
commit | 5742f322891d380b15b6570bf523e50c17c45212 (patch) | |
tree | 4c3074277ec75d2a491bead30056779651fe1ca7 /lib/types.nix | |
parent | bcc1a72d6a604533e025ad579e0dfca0a83c2716 (diff) |
krebs.sitemap: init
Diffstat (limited to 'lib/types.nix')
-rw-r--r-- | lib/types.nix | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/types.nix b/lib/types.nix index 236190ccd..8c6846887 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -5,7 +5,7 @@ let all any concatMapStringsSep concatStringsSep const filter flip genid hasSuffix head isInt isString length mergeOneOption mkOption mkOptionType optional optionalAttrs optionals range splitString - stringLength substring test typeOf; + stringLength substring test testString typeOf; inherit (lib.types) attrsOf bool either enum int listOf nullOr path str string submodule; in @@ -357,6 +357,20 @@ rec { pgp-pubkey = str; + sitemap.entry = submodule ({ config, ... }: { + options = { + desc = mkOption { + default = null; + type = nullOr str; + }; + href = mkOption { + ${if testString "https?://.*" config._module.args.name + then "default" else null} = config._module.args.name; + type = nullOr str; # TODO nullOr uri? + }; + }; + }); + ssh-pubkey = str; ssh-privkey = submodule { options = { |