From a1159e49c4ce00e393a26d1cdd07a6cfa603f94e Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Fri, 28 Aug 2026 21:19:31 -0300 Subject: [PATCH] feat(golive): package from source Assisted-by: pi (gpt-5.6-sol) --- pkgs/default.nix | 1 + pkgs/golive/default.nix | 90 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 pkgs/golive/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index d6d6d538..b172f1a2 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -5,6 +5,7 @@ alt1 = pkgs.callPackage ./alt1 {}; hyprbars = pkgs.callPackage ./hyprbars {}; jellysearch = pkgs.callPackage ./jellysearch {}; + golive = pkgs.callPackage ./golive {}; website = pkgs.callPackage ../projects/website {}; runelite-query = pkgs.callPackage ../projects/runelite-query {}; gtkhal = pkgs.callPackage ../projects/gtkhal {}; diff --git a/pkgs/golive/default.nix b/pkgs/golive/default.nix new file mode 100644 index 00000000..dffcf31c --- /dev/null +++ b/pkgs/golive/default.nix @@ -0,0 +1,90 @@ +{ + copyDesktopItems, + electron, + fetchFromGitHub, + fetchNpmDeps, + lib, + makeDesktopItem, + makeWrapper, + nodejs_22, + npmHooks, + stdenvNoCC, +}: let + desktopItem = makeDesktopItem { + name = "golive"; + desktopName = "GoLive"; + comment = "Share your screen with people in the same room"; + exec = "golive %U"; + icon = "golive"; + categories = ["Network"]; + mimeTypes = ["x-scheme-handler/golive"]; + startupWMClass = "GoLive"; + }; +in + stdenvNoCC.mkDerivation (finalAttrs: { + pname = "golive"; + version = "0.1.15"; + + src = fetchFromGitHub { + owner = "Nem-Tudo"; + repo = "group-sharescreen"; + rev = "v${finalAttrs.version}"; + hash = "sha256-HddLmJ+Zr5BHw5OUoPEbysOnAHPXjb8PacX4XuJBROs="; + }; + + npmDeps = fetchNpmDeps { + inherit (finalAttrs) src; + hash = "sha256-PLzCYQoxpeBjABESW4M+XsfRYjH02Mw1EqAufl+fbj8="; + }; + + env = { + ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; + npm_config_ignore_scripts = "true"; + }; + + nativeBuildInputs = [ + copyDesktopItems + makeWrapper + nodejs_22 + npmHooks.npmConfigHook + ]; + + desktopItems = [desktopItem]; + + buildPhase = '' + runHook preBuild + + npm run electron:typecheck + npm run electron:build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p \ + $out/lib/golive/electron/{build,dist} \ + $out/share/icons/hicolor/512x512/apps + install -Dm444 package.json $out/lib/golive/package.json + install -Dm444 electron/dist/*.js $out/lib/golive/electron/dist/ + install -Dm444 electron/picker.html $out/lib/golive/electron/picker.html + install -Dm444 electron/build/icon.png $out/lib/golive/electron/build/icon.png + install -Dm444 electron/build/icon.png \ + $out/share/icons/hicolor/512x512/apps/golive.png + + makeWrapper ${lib.getExe electron} $out/bin/golive \ + --add-flags "--class=GoLive" \ + --add-flags "$out/lib/golive" + + runHook postInstall + ''; + + meta = { + description = "Screen sharing app for GoLive rooms"; + homepage = "https://golive.nemtudo.me"; + license = lib.licenses.unfree; + mainProgram = "golive"; + platforms = ["x86_64-linux"]; + }; + })