0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-09 12:05:50 +03:00

nixos/home-assistant: fix symlinking multi-manifest custom components

frenck/spook includes a second manifest for an integration. The current
copyCustomComponents script assumed that only one component directory
will be found, which in this case resulted in a malformed symlink
destination:

lrwxrwxrwx 1 hass hass 224 Jun 23 17:23 spook -> '/nix/store/r41ics22zs578avzqf7x86plcgn2q71h-python3.12-frenck-spook-v3.0.1/custom_components/spook/integrations/spook_inverse'$'\n''/nix/store/r41ics22zs578avzqf7x86plcgn2q71h-python3.12-frenck-spook-v3.0.1/custom_components/spook'
This commit is contained in:
Kacper Koniuszy 2024-06-23 18:41:00 +02:00
parent ca39b726c7
commit 7b81a213cf

View file

@ -518,8 +518,9 @@ in {
# recreate symlinks for desired components
declare -a components=(${escapeShellArgs cfg.customComponents})
for component in "''${components[@]}"; do
path="$(dirname $(find "$component" -name "manifest.json"))"
ln -fns "$path" "${cfg.configDir}/custom_components/"
readarray -t manifests < <(find "$component" -name manifest.json)
readarray -t paths < <(dirname "''${manifests[@]}")
ln -fns "''${paths[@]}" "${cfg.configDir}/custom_components/"
done
'';
in