Skip to content

Commit

Permalink
init grayjay with fhs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelBelsanti committed Jan 13, 2025
1 parent fbd533f commit b0b7da4
Showing 1 changed file with 112 additions and 0 deletions.
112 changes: 112 additions & 0 deletions packages/grayjay/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# https://github.com/futo-org/Grayjay.Desktop/issues/63#issuecomment-2564617529
{
stdenv,
lib,
fetchurl,
buildFHSEnv,
writeShellScript,

unzip,

libz,
icu,
openssl,

xorg,

gtk3,
glib,
nss,
nspr,
dbus,
atk,
cups,
libdrm,
expat,
libxkbcommon,
pango,
cairo,
udev,
alsa-lib,
mesa,
libGL,
libsecret,
}:

let
grayjay-app = stdenv.mkDerivation {
pname = "grayjay-app";
version = "0.1.0";

src = fetchurl {
url = "https://updater.grayjay.app/Apps/Grayjay.Desktop/Grayjay.Desktop-linux-x64.zip";
hash = "sha256-MU4AJVKkE80/E9ikq9RKIL9Z3npwmC2N0PHybd++jQM=";
};

buildInputs = [
unzip
];

sourceRoot = ".";

dontUnpack = true;
dontConfigure = true;
dontBuild = true;

installPhase = ''
mkdir -p $out/bin $out/share
unzip -d $out $src && f=($out/*) && mv $out/*/* $out
rm $out/Portable
'';

meta = with lib; {
homepage = "https://grayjay.app/desktop/";
description = "Grayjay Desktop";
platforms = platforms.linux;
};
};
in
buildFHSEnv {
name = "grayjay";
targetPkgs = pkgs: [
grayjay-app

libz
icu
openssl # For updater

xorg.libX11
xorg.libXcomposite
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXrandr
xorg.libxcb

gtk3
glib
nss
nspr
dbus
atk
cups
libdrm
expat
libxkbcommon
pango
cairo
udev
alsa-lib
mesa
libGL
libsecret
];

multiPkgs = pkgs: [ libGL ];
runScript = writeShellScript "grayjay-script" ''
mkdir -p ~/.local/share/Grayjay
cp -r ${grayjay-app}/* ~/.local/share/Grayjay/
cd ~/.local/share/Grayjay
./Grayjay
'';
}

0 comments on commit b0b7da4

Please sign in to comment.