discord: Fix sandbox and desktop item

This commit is contained in:
2021-09-06 18:10:14 +02:00
parent 66ddcf0270
commit c093b10729
6 changed files with 41 additions and 42 deletions

View File

@@ -1,5 +1,6 @@
{
lib, stdenv, pkgs
, makeDesktopItem
, extraStartupArgs ? ""
}:
@@ -8,7 +9,7 @@ pkgs.discord.overrideAttrs (old: let
gtk3 = pkgs.gtk3;
binaryName = "Discord";
system-electron = "$out/opt/${binaryName}/system-electron.sh";
in {
in rec {
nativeBuildInputs = with pkgs; old.nativeBuildInputs ++ [ electron asar ];
buildPhase = ''
${asar}/bin/asar e resources/app.asar resources/app
@@ -35,7 +36,6 @@ pkgs.discord.overrideAttrs (old: let
# Without || true the install would fail on case-insensitive filesystems
ln -s ${system-electron} $out/bin/${lib.strings.toLower binaryName} || true
ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${old.pname}.png
ln -s "${old.desktopItem}/share/applications" $out/share/
'';
desktopItem = null;
desktopItem = null;
})

View File

@@ -1,11 +0,0 @@
{ stdenv, lib, makeDesktopItem, discord }:
makeDesktopItem {
name = "Discord";
exec = "${discord}/bin/Discord";
icon = "discord";
comment = "All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.";
genericName = "Internet Messenger";
desktopName = "Discord";
categories = "Network;InstantMessaging;";
}

View File

@@ -1,14 +0,0 @@
{ writeScript, runtimeShell, buildFHSUserEnvBubblewrap, discord }:
buildFHSUserEnvBubblewrap {
name = "discord";
runScript = ''
#!${runtimeShell}
exec ${discord}/bin/Discord $@
'';
specifyHomeDirs = true;
mountInHome = ".config/discord";
additionalBlacklist = [ "/mnt" ];
chdirTo = "/home/$USER";
}