8 # Linked dynamic libraries.
47 wayland, # ozone/wayland
49 # Command line programs
52 # command line arguments which are always set e.g "--disable-gpu"
62 # Additional dependencies according to other distros.
81 # Necessary for USB audio devices.
86 gsettings-desktop-schemas,
88 # For video acceleration via VA-API (--enable-features=VaapiVideoDecoder)
92 # For Vulkan support (--enable-features=Vulkan)
101 opusWithCustomModes = libopus.override { withCustomModes = true; };
161 ++ lib.optional pulseSupport libpulseaudio
162 ++ lib.optional libvaSupport libva
169 stdenv.mkDerivation (finalAttrs: {
170 pname = "microsoft-edge";
171 version = "131.0.2903.70";
174 url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${finalAttrs.version}-1_amd64.deb";
175 hash = "sha256-LcinHmzr3o5ILjGdr8uuiOGWok0J9G/kTdASfYQh/tM=";
178 # With strictDeps on, some shebangs were not being patched correctly
179 # ie, $out/share/microsoft/msedge/microsoft-edge
182 nativeBuildInputs = [
188 # needed for XDG_ICON_DIRS
193 # needed for GSETTINGS_SCHEMAS_PATH
194 gsettings-desktop-schemas
204 rpath = lib.makeLibraryPath deps + ":" + lib.makeSearchPathOutput "lib" "lib64" deps;
205 binpath = lib.makeBinPath deps;
213 exe=$out/bin/microsoft-edge
215 mkdir -p $out/bin $out/share
216 cp -v -a opt/* $out/share
217 cp -v -a usr/share/* $out/share
219 # replace bundled vulkan-loader
220 rm -v $out/share/microsoft/$appname/libvulkan.so.1
221 ln -v -s -t "$out/share/microsoft/$appname" "${lib.getLib vulkan-loader}/lib/libvulkan.so.1"
223 substituteInPlace $out/share/microsoft/$appname/microsoft-edge \
224 --replace-fail 'CHROME_WRAPPER' 'WRAPPER'
225 substituteInPlace $out/share/applications/microsoft-edge.desktop \
226 --replace-fail /usr/bin/microsoft-edge-$dist $exe
227 substituteInPlace $out/share/gnome-control-center/default-apps/microsoft-edge.xml \
228 --replace-fail /opt/microsoft/msedge $exe
229 substituteInPlace $out/share/menu/microsoft-edge.menu \
230 --replace-fail /opt $out/share \
231 --replace-fail $out/share/microsoft/$appname/microsoft-edge $exe
233 for icon_file in $out/share/microsoft/msedge/product_logo_[0-9]*.png; do
234 num_and_suffix="''${icon_file##*logo_}"
235 if [ $dist = "stable" ]; then
236 icon_size="''${num_and_suffix%.*}"
238 icon_size="''${num_and_suffix%_*}"
240 logo_output_prefix="$out/share/icons/hicolor"
241 logo_output_path="$logo_output_prefix/''${icon_size}x''${icon_size}/apps"
242 mkdir -p "$logo_output_path"
243 mv "$icon_file" "$logo_output_path/microsoft-edge.png"
246 # "--simulate-outdated-no-au" disables auto updates and browser outdated popup
247 makeWrapper "$out/share/microsoft/$appname/microsoft-edge" "$exe" \
248 --prefix LD_LIBRARY_PATH : "$rpath" \
249 --prefix PATH : "$binpath" \
250 --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \
251 --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:${addDriverRunpath.driverLink}/share" \
252 --set CHROME_WRAPPER "microsoft-edge-$dist" \
253 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
254 --add-flags "--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'" \
255 --add-flags ${lib.escapeShellArg commandLineArgs}
257 # Make sure that libGL and libvulkan are found by ANGLE libGLESv2.so
258 patchelf --set-rpath $rpath $out/share/microsoft/$appname/lib*GL*
260 # Edge specific set liboneauth
261 patchelf --set-rpath $rpath $out/share/microsoft/$appname/liboneauth.so
263 for elf in $out/share/microsoft/$appname/{msedge,msedge-sandbox,msedge_crashpad_handler}; do
264 patchelf --set-rpath $rpath $elf
265 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $elf
271 passthru.updateScript = ./update.py;
274 changelog = "https://learn.microsoft.com/en-us/deployedge/microsoft-edge-relnote-stable-channel";
275 description = "Web browser from Microsoft";
276 homepage = "https://www.microsoft.com/en-us/edge";
277 license = lib.licenses.unfree;
278 mainProgram = "microsoft-edge";
279 maintainers = with lib.maintainers; [
284 platforms = [ "x86_64-linux" ];
285 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];