guest: enable access to shelvacu

This commit is contained in:
2023-06-28 03:57:57 +00:00
parent 9be5604c40
commit dbd312e9bd
6 changed files with 48 additions and 12 deletions

View File

@@ -24,6 +24,8 @@ let path = rec {
# return the last path component; error on the empty path
leaf = str: lib.last (split str);
# XXX: this is bugged in that
# from "/foo/bar" "/foo/barbag" => "/bag"
from = start: end: let
s = path.norm start;
e = path.norm end;
@@ -32,6 +34,12 @@ let path = rec {
"/" + (lib.removePrefix s e)
);
isChild = parent: child:
lib.any
(p: p == norm parent)
(walk "/" child)
;
# yield every node between start and end, including each the endpoints
# e.g. walk "/foo" "/foo/bar/baz" => [ "/foo" "/foo/bar" "/foo/bar/baz" ]
# XXX: assumes input paths are normalized