Skip to content

Commit

Permalink
Merge pull request #60499 from JohnAZoidberg/chromium-upstream-deskto…
Browse files Browse the repository at this point in the history
…p-entry

chromium: Use upstream desktop entry
  • Loading branch information
infinisil committed May 27, 2019
2 parents e383ed6 + 0f537a4 commit 526a0b2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 26 deletions.
19 changes: 19 additions & 0 deletions pkgs/applications/networking/browsers/chromium/browser.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ mkChromiumDerivation (base: rec {
mkdir -vp "$logo_output_path"
cp -v "$icon_file" "$logo_output_path/$packageName.png"
done
# Install Desktop Entry
install -D chrome/installer/linux/common/desktop.template \
$out/share/applications/chromium-browser.desktop
substituteInPlace $out/share/applications/chromium-browser.desktop \
--replace "@@MENUNAME@@" "Chromium" \
--replace "@@PACKAGE@@" "chromium" \
--replace "Exec=/usr/bin/@@USR_BIN_SYMLINK_NAME@@" "Exec=chromium"
# Append more mime types to the end
sed -i '/^MimeType=/ s,$,x-scheme-handler/webcal;x-scheme-handler/mailto;x-scheme-handler/about;x-scheme-handler/unknown,' \
$out/share/applications/chromium-browser.desktop
# See https://github.com/NixOS/nixpkgs/issues/12433
sed -i \
-e '/\[Desktop Entry\]/a\' \
-e 'StartupWMClass=chromium-browser' \
$out/share/applications/chromium-browser.desktop
'';

passthru = { inherit sandboxExecutableName; };
Expand Down
26 changes: 0 additions & 26 deletions pkgs/applications/networking/browsers/chromium/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,6 @@ in let
};
};

desktopItem = makeDesktopItem {
name = "chromium-browser";
exec = "chromium %U";
icon = "chromium";
comment = "An open source web browser from Google";
desktopName = "Chromium";
genericName = "Web browser";
mimeType = stdenv.lib.concatStringsSep ";" [
"text/html"
"text/xml"
"application/xhtml+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
"x-scheme-handler/ftp"
"x-scheme-handler/mailto"
"x-scheme-handler/webcal"
"x-scheme-handler/about"
"x-scheme-handler/unknown"
];
categories = "Network;WebBrowser";
extraEntries = ''
StartupWMClass=chromium-browser
'';
};

suffix = if channel != "stable" then "-" + channel else "";

sandboxExecutableName = chromium.browser.passthru.sandboxExecutableName;
Expand Down Expand Up @@ -135,7 +110,6 @@ in stdenv.mkDerivation {
for f in '${chromium.browser}'/share/*; do # hello emacs */
ln -s -t "$out/share/" "$f"
done
cp -v "${desktopItem}/share/applications/"* "$out/share/applications"
'';

inherit (chromium.browser) packageName;
Expand Down

0 comments on commit 526a0b2

Please sign in to comment.