lol

emacs: fix `env` shallow merge

Fixes regression caused by #252244.

`env` was first defined in its own attrset, which was merged with a
second attrset:

```nix
...
{
env = {
NATIVE_FULL_AOT = "1";
LIBRARY_PATH = lib.concatStringsSep ":" libGccJitLibraryPaths;
};
} // {
...
env.NIX_CFLAGS_COMPILE = ...
...
}
```

In this situation, the `env` from the first attrset is not preserved,
since `//` does a shallow merge.

Signed-off-by: Andrew Pan <a@tny.town>

authored by

Andrew Pan and committed by
Anderson Torres
0f4255bf e919958b

+10 -11
+10 -11
pkgs/applications/editors/emacs/generic.nix
··· 140 140 then llvmPackages_14.stdenv 141 141 else stdenv) mkDerivation; 142 142 in 143 - mkDerivation (finalAttrs: (lib.optionalAttrs withNativeCompilation { 144 - env = { 145 - NATIVE_FULL_AOT = "1"; 146 - LIBRARY_PATH = lib.concatStringsSep ":" libGccJitLibraryPaths; 147 - }; 148 - } // { 143 + mkDerivation (finalAttrs: { 149 144 pname = pname 150 145 + (if noGui then "-nox" 151 146 else if variant == "macport" then "-macport" ··· 341 336 ++ lib.optional withXwidgets "--with-xwidgets" 342 337 ; 343 338 344 - # Fixes intermittent segfaults when compiled with LLVM >= 7.0. 345 - # See https://github.com/NixOS/nixpkgs/issues/127902 346 - env.NIX_CFLAGS_COMPILE = lib.optionalString (variant == "macport") 347 - "-include ${./macport_noescape_noop.h}"; 339 + env = lib.optionalAttrs withNativeCompilation { 340 + NATIVE_FULL_AOT = "1"; 341 + LIBRARY_PATH = lib.concatStringsSep ":" libGccJitLibraryPaths; 342 + } // lib.optionalAttrs (variant == "macport") { 343 + # Fixes intermittent segfaults when compiled with LLVM >= 7.0. 344 + # See https://github.com/NixOS/nixpkgs/issues/127902 345 + NIX_CFLAGS_COMPILE = "-include ${./macport_noescape_noop.h}"; 346 + }; 348 347 349 348 enableParallelBuilding = true; 350 349 ··· 405 404 meta = meta // { 406 405 broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform); 407 406 }; 408 - })) 407 + })