summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-08-05 12:01:07 +0200
committermakefu <github@syntax-fehler.de>2017-08-05 12:01:07 +0200
commitf1124bd208306b2cfe32e1b85ccb810455453483 (patch)
treeb286db06b459e2d24409c3b4fd02eb0ea7d88a82 /lib
parent7db5d59018f4096b0cc39afa59df53b6a1fa9353 (diff)
parent1310375624b7fbcb6c165a032edc9d3ef336d57b (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix4
-rw-r--r--lib/types.nix16
2 files changed, 15 insertions, 5 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 4c54f60aa..e5e40975e 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -20,10 +20,6 @@ let
then lib.lpad n c (c + s)
else s;
- subdirsOf = path:
- lib.mapAttrs (name: _: path + "/${name}")
- (filterAttrs (_: eq "directory") (readDir path));
-
genAttrs' = names: f: listToAttrs (map f names);
getAttrs = names: set:
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 = {