Shell variables are not expanded in cmakeFlags, so the etc files ended up in `$out/'$out'/etc` instead of the expected `$out/etc`.
Build-tested on x86_64 Linux & Mac.