mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +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 {
|
||||
# POSIX.1‐2017, 3.281 Portable Filename
|
||||
filename = mkOptionType {
|
||||
name = "POSIX portable filename";
|
||||
check = x: isString x && builtins.match "[0-9A-Za-z._][0-9A-Za-z._-]*" x != null;
|
||||
name = "filename";
|
||||
check = x: isString x;
|
||||
merge = mergeOneOption;
|
||||
description = "A filename";
|
||||
};
|
||||
|
||||
# POSIX.1‐2017, 3.2 Absolute Pathname
|
||||
absolute-pathname = mkOptionType {
|
||||
name = "POSIX absolute pathname";
|
||||
name = "absolute pathname";
|
||||
check = x: isString x && substring 0 1 x == "/" && pathname.check x;
|
||||
merge = mergeOneOption;
|
||||
description = "An absolute path";
|
||||
};
|
||||
|
||||
# POSIX.1-2017, 3.271 Pathname
|
||||
pathname = mkOptionType {
|
||||
name = "POSIX pathname";
|
||||
name = "pathname";
|
||||
check = x:
|
||||
let
|
||||
# The filter is used to normalize paths, i.e. to remove duplicated and
|
||||
|
||||
Reference in new issue
Block a user