Revert "Add isPath to trivial.nix"
This breaks NixOS, and I don't actually need it, so someone who needs it
can bring this back without breaking NixOS :)
This reverts commit 2742087bdd
.
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
2742087bdd
commit
932dd06f3f
@ -11,6 +11,17 @@ with import ./options.nix;
|
|||||||
with import ./properties.nix;
|
with import ./properties.nix;
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
|
# Unfortunately this can also be a string.
|
||||||
|
isPath = x: !(
|
||||||
|
builtins.isFunction x
|
||||||
|
|| builtins.isAttrs x
|
||||||
|
|| builtins.isInt x
|
||||||
|
|| builtins.isBool x
|
||||||
|
|| builtins.isList x
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
importIfPath = path:
|
importIfPath = path:
|
||||||
if isPath path then
|
if isPath path then
|
||||||
import path
|
import path
|
||||||
|
@ -35,14 +35,4 @@ rec {
|
|||||||
else if builtins.isAttrs x
|
else if builtins.isAttrs x
|
||||||
then deepSeqAttrs x y
|
then deepSeqAttrs x y
|
||||||
else seq x y;
|
else seq x y;
|
||||||
|
|
||||||
isPath = val: with builtins; !(
|
|
||||||
isAttrs val
|
|
||||||
|| isList val
|
|
||||||
|| isInt val
|
|
||||||
|| isString val
|
|
||||||
|| isFunction val
|
|
||||||
|| isBool val
|
|
||||||
|| val == null
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,8 @@ rec {
|
|||||||
|
|
||||||
path = mkOptionType {
|
path = mkOptionType {
|
||||||
name = "path";
|
name = "path";
|
||||||
check = lib.traceValIfNot isPath;
|
# Hacky: there is no ‘isPath’ primop.
|
||||||
|
check = lib.traceValIfNot (x: builtins.unsafeDiscardStringContext (builtins.substring 0 1 (toString x)) == "/");
|
||||||
};
|
};
|
||||||
|
|
||||||
listOf = types.list;
|
listOf = types.list;
|
||||||
|
Loading…
Reference in New Issue
Block a user