Loading
emacsPackages: don't set attributes to null
Depending on the version of the package from MELPA, nixpkgs can set attributes like `preBuild` or `patches` to `null`. `mkDerivation` filters out `null`, so this has the desirable effect of not unnecessarily changing the actual derivation. But it is inconvenient when using `overrideAttrs`: it breaks the common pattern of `(previousAttrs.preBuild or "") + ''...''` (also used elsewhere in the files this commit changes), which will fail to coerce `null` to a string or list to append to. Fix this everywhere attributes are set to null, by defaulting to `""` or `[ ]` instead. We cannot set the attribute conditionally, because the attributes names returned by `overrideAttrs` cannot depend on `finalAttrs` (only the values can). This changes some helpers that are (indirectly) used by several packages, but that part of the change is effectively a noop, because the attributes involved are always set (either by the helper or on the original derivation).