Merge pull request #284508 from nikstur/etc-overlay-leading-slash
nixos/etc: remove leading slash from paths
This commit is contained in:
commit
9f571cb4ef
@ -710,9 +710,9 @@ in
|
|||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
# Needed since 1.18; see https://bugs.freedesktop.org/show_bug.cgi?id=89023#c5
|
# Needed since 1.18; see https://bugs.freedesktop.org/show_bug.cgi?id=89023#c5
|
||||||
// (let cfgPath = "/X11/xorg.conf.d/10-evdev.conf"; in
|
// (let cfgPath = "X11/xorg.conf.d/10-evdev.conf"; in
|
||||||
{
|
{
|
||||||
${cfgPath}.source = xorg.xf86inputevdev.out + "/share" + cfgPath;
|
${cfgPath}.source = xorg.xf86inputevdev.out + "/share/" + cfgPath;
|
||||||
});
|
});
|
||||||
|
|
||||||
environment.systemPackages = utils.removePackagesByName
|
environment.systemPackages = utils.removePackagesByName
|
||||||
|
@ -58,7 +58,7 @@ class ComposefsPath:
|
|||||||
):
|
):
|
||||||
if path is None:
|
if path is None:
|
||||||
path = attrs["target"]
|
path = attrs["target"]
|
||||||
self.path = "/" + path
|
self.path = path
|
||||||
self.size = size
|
self.size = size
|
||||||
self.filetype = filetype
|
self.filetype = filetype
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
@ -83,8 +83,12 @@ class ComposefsPath:
|
|||||||
return " ".join(line_list)
|
return " ".join(line_list)
|
||||||
|
|
||||||
|
|
||||||
def eprint(*args, **kwargs) -> None:
|
def eprint(*args: Any, **kwargs: Any) -> None:
|
||||||
print(args, **kwargs, file=sys.stderr)
|
print(*args, **kwargs, file=sys.stderr)
|
||||||
|
|
||||||
|
|
||||||
|
def normalize_path(path: str) -> str:
|
||||||
|
return str("/" + os.path.normpath(path).lstrip("/"))
|
||||||
|
|
||||||
|
|
||||||
def leading_directories(path: str) -> list[str]:
|
def leading_directories(path: str) -> list[str]:
|
||||||
@ -145,6 +149,10 @@ def main() -> None:
|
|||||||
|
|
||||||
paths: dict[str, ComposefsPath] = {}
|
paths: dict[str, ComposefsPath] = {}
|
||||||
for attrs in config:
|
for attrs in config:
|
||||||
|
# Normalize the target path to work around issues in how targets are
|
||||||
|
# declared in `environment.etc`.
|
||||||
|
attrs["target"] = normalize_path(attrs["target"])
|
||||||
|
|
||||||
target = attrs["target"]
|
target = attrs["target"]
|
||||||
source = attrs["source"]
|
source = attrs["source"]
|
||||||
mode = attrs["mode"]
|
mode = attrs["mode"]
|
||||||
|
Loading…
Reference in New Issue
Block a user