all repos — nixfiles @ aa212dd7bef8c8326d639d72391e05d47a45be8a

System and user configuration, managed by nix and home-manager

Make nix wrapper scripts resilient to unkeyed NIX_PATH entries

Alan Pearce
commit

aa212dd7bef8c8326d639d72391e05d47a45be8a

parent

abe63fead407367d77e93d05e7076be84c7d525c

1 file changed, 11 insertions(+), 9 deletions(-)

jump to
M bin/home-managerbin/home-manager
@@ -112,17 +112,19 @@ ln -s $new_src $target
end for np in $NIX_PATH - echo $np | read --function --delimiter "=" channel new_src_rel - set --local new_src (path resolve $new_src_rel) + if string match --quiet --entire "=" $np + echo $np | read --function --delimiter "=" channel new_src_rel + set --local new_src (path resolve $new_src_rel) - if test $channel = darwin-config - continue - end - if set --local i (contains --index $channel $old_channels) - set --erase old_channels[$i] - end + if test $channel = darwin-config + continue + end + if set --local i (contains --index $channel $old_channels) + set --erase old_channels[$i] + end - update_link $new_src $channel_root/$channel + update_link $new_src $channel_root/$channel + end end for old in $channel_root/$old_channels