about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/electron/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/electron/wrapper.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/electron/wrapper.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/electron/wrapper.nix b/nixpkgs/pkgs/development/tools/electron/wrapper.nix
new file mode 100644
index 000000000000..5ecb0387b6a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/electron/wrapper.nix
@@ -0,0 +1,37 @@
+{ stdenv
+, electron-unwrapped
+, wrapGAppsHook
+, makeWrapper
+, gsettings-desktop-schemas
+, glib
+, gtk3
+, gtk4
+}:
+
+stdenv.mkDerivation {
+  pname = "electron";
+  inherit (electron-unwrapped) version;
+
+  nativeBuildInputs = [ wrapGAppsHook makeWrapper ];
+  buildInputs = [
+    # needed for GSETTINGS_SCHEMAS_PATH
+    gsettings-desktop-schemas glib gtk3 gtk4
+  ];
+  dontWrapGApps = true;
+
+  buildCommand = ''
+    gappsWrapperArgsHook
+    mkdir -p $out/bin
+    makeWrapper "${electron-unwrapped}/libexec/electron/electron" "$out/bin/electron" \
+      "''${gappsWrapperArgs[@]}" \
+      --set CHROME_DEVEL_SANDBOX $out/libexec/electron/chrome-sandbox
+
+    ln -s ${electron-unwrapped}/libexec $out/libexec
+  '';
+
+  passthru = {
+    unwrapped = electron-unwrapped;
+    inherit (electron-unwrapped) headers;
+  };
+  inherit (electron-unwrapped) meta;
+}