mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 05:29:20 +03:00
nixos/etc: support direct symlinks with etc overlay
This commit is contained in:
parent
2baa58d348
commit
1b288bca00
3 changed files with 22 additions and 19 deletions
|
@ -175,7 +175,7 @@ def main() -> None:
|
|||
paths[glob_target] = composefs_path
|
||||
add_leading_directories(glob_target, attrs, paths)
|
||||
else: # Without globbing
|
||||
if mode == "symlink":
|
||||
if mode == "symlink" or mode == "direct-symlink":
|
||||
composefs_path = ComposefsPath(
|
||||
attrs,
|
||||
# A high approximation of the size of a symlink
|
||||
|
@ -184,24 +184,23 @@ def main() -> None:
|
|||
mode="0777",
|
||||
payload=source,
|
||||
)
|
||||
elif os.path.isdir(source):
|
||||
composefs_path = ComposefsPath(
|
||||
attrs,
|
||||
size=4096,
|
||||
filetype=FileType.directory,
|
||||
mode=mode,
|
||||
payload=source,
|
||||
)
|
||||
else:
|
||||
if os.path.isdir(source):
|
||||
composefs_path = ComposefsPath(
|
||||
attrs,
|
||||
size=4096,
|
||||
filetype=FileType.directory,
|
||||
mode=mode,
|
||||
payload=source,
|
||||
)
|
||||
else:
|
||||
composefs_path = ComposefsPath(
|
||||
attrs,
|
||||
size=os.stat(source).st_size,
|
||||
filetype=FileType.file,
|
||||
mode=mode,
|
||||
# payload needs to be relative path in this case
|
||||
payload=target.lstrip("/"),
|
||||
)
|
||||
composefs_path = ComposefsPath(
|
||||
attrs,
|
||||
size=os.stat(source).st_size,
|
||||
filetype=FileType.file,
|
||||
mode=mode,
|
||||
# payload needs to be relative path in this case
|
||||
payload=target.lstrip("/"),
|
||||
)
|
||||
paths[target] = composefs_path
|
||||
add_leading_directories(target, attrs, paths)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue