mirror of
https://github.com/nix-community/disko.git
synced 2026-12-01 21:43:29 +01:00
types: relax filename, pathname & absolute pathname
This commit is contained in:
1 parent
af2da574be
commit
6bbccd8edd
1 file changed
+4
-7
@@ -247,25 +247,22 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
optionTypes = rec {
|
optionTypes = rec {
|
||||||
# POSIX.1‐2017, 3.281 Portable Filename
|
|
||||||
filename = mkOptionType {
|
filename = mkOptionType {
|
||||||
name = "POSIX portable filename";
|
name = "filename";
|
||||||
check = x: isString x && builtins.match "[0-9A-Za-z._][0-9A-Za-z._-]*" x != null;
|
check = x: isString x;
|
||||||
merge = mergeOneOption;
|
merge = mergeOneOption;
|
||||||
description = "A filename";
|
description = "A filename";
|
||||||
};
|
};
|
||||||
|
|
||||||
# POSIX.1‐2017, 3.2 Absolute Pathname
|
|
||||||
absolute-pathname = mkOptionType {
|
absolute-pathname = mkOptionType {
|
||||||
name = "POSIX absolute pathname";
|
name = "absolute pathname";
|
||||||
check = x: isString x && substring 0 1 x == "/" && pathname.check x;
|
check = x: isString x && substring 0 1 x == "/" && pathname.check x;
|
||||||
merge = mergeOneOption;
|
merge = mergeOneOption;
|
||||||
description = "An absolute path";
|
description = "An absolute path";
|
||||||
};
|
};
|
||||||
|
|
||||||
# POSIX.1-2017, 3.271 Pathname
|
|
||||||
pathname = mkOptionType {
|
pathname = mkOptionType {
|
||||||
name = "POSIX pathname";
|
name = "pathname";
|
||||||
check = x:
|
check = x:
|
||||||
let
|
let
|
||||||
# The filter is used to normalize paths, i.e. to remove duplicated and
|
# The filter is used to normalize paths, i.e. to remove duplicated and
|
||||||
|
|||||||
Reference in new issue
Block a user