diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index db253a0c582..5bdb8bdac0b 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -401,8 +401,10 @@ let # Symlink all units provided listed in systemd.packages. for i in ${toString cfg.packages}; do - if [ -n "$(echo $i/etc/systemd/${type}/*)" ]; then - ln -s $i/etc/systemd/${type}/* $i/lib/systemd/${type}/* $out/ + files=$(echo $i/etc/systemd/${type}/* $i/lib/systemd/${type}/*) + echo $i: $files + if [ -n "$files" ]; then + ln -s $files $out/ fi done