2024-07-24 17:22:23 -06:00
|
|
|
{
|
|
|
|
lib,
|
2024-10-02 03:19:54 -06:00
|
|
|
buildGo123Module,
|
2024-07-24 17:22:23 -06:00
|
|
|
fetchFromGitHub,
|
|
|
|
fetchYarnDeps,
|
|
|
|
yarnConfigHook,
|
|
|
|
yarnBuildHook,
|
|
|
|
nodejs,
|
|
|
|
stdenv,
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
|
2024-10-16 15:17:28 -06:00
|
|
|
version = "1.11.1";
|
2024-07-24 17:22:23 -06:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "screego";
|
|
|
|
repo = "server";
|
|
|
|
rev = "v${version}";
|
2024-10-16 15:17:28 -06:00
|
|
|
hash = "sha256-P8O3E7mNAqUid42XFaJBQm3ApxykYLCuHXDOFHrG9Fs=";
|
2024-07-24 17:22:23 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
ui = stdenv.mkDerivation {
|
|
|
|
pname = "screego-ui";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = src + "/ui";
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/ui/yarn.lock";
|
2024-10-02 03:19:54 -06:00
|
|
|
hash = "sha256-yjHxyKEqXMxYsm+KroPB9KulfqYSOU/7ghbKnlSFrd0=";
|
2024-07-24 17:22:23 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
yarnConfigHook
|
|
|
|
yarnBuildHook
|
|
|
|
nodejs
|
|
|
|
];
|
|
|
|
|
2024-10-03 11:47:05 -06:00
|
|
|
preConfigure = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2024-07-24 17:22:23 -06:00
|
|
|
installPhase = ''
|
|
|
|
cp -r build $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2024-10-02 03:19:54 -06:00
|
|
|
buildGo123Module rec {
|
2024-07-24 17:22:23 -06:00
|
|
|
inherit src version;
|
|
|
|
|
|
|
|
pname = "screego-server";
|
|
|
|
|
2024-10-02 03:19:54 -06:00
|
|
|
vendorHash = "sha256-190Fp2QtnZis0sophGwhnWhXNWLhODWlnzE3bfScZ+Q=";
|
2024-07-24 17:22:23 -06:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X=main.version=${version}"
|
|
|
|
"-X=main.commitHash=${src.rev}"
|
|
|
|
"-X=main.mode=prod"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2024-07-30 05:55:59 -06:00
|
|
|
mkdir -p ./ui
|
2024-07-24 17:22:23 -06:00
|
|
|
cp -r "${ui}" ./ui/build
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/server $out/bin/screego
|
|
|
|
'';
|
|
|
|
|
2024-10-03 11:47:05 -06:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2024-07-24 17:22:23 -06:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Screen sharing for developers";
|
|
|
|
homepage = "https://screego.net";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ pinpox ];
|
|
|
|
mainProgram = "screego";
|
|
|
|
};
|
|
|
|
}
|