mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
types: relax filename, pathname & absolute pathname
This commit is contained in:
parent
af2da574be
commit
6bbccd8edd
1 changed files with 4 additions and 7 deletions
11
types.nix
11
types.nix
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue