Add littlelink
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
52
packages/littlelink-server/default.nix
Normal file
52
packages/littlelink-server/default.nix
Normal file
@@ -0,0 +1,52 @@
|
||||
{ pkgs, ... }:
|
||||
# AUTO-UPDATE: nix-update --flake --version=branch=main littlelink-server --subpackage yarnSrc
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "littlelink-server";
|
||||
version = "0-unstable-2025-07-16";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "techno-tim";
|
||||
repo = "littlelink-server";
|
||||
rev = "fa9fb3a20375c6287ae134af9c2e9e754e0aebb6";
|
||||
hash = "sha256-BUPqXpiofHlLKgbOYkZr+QEoRIdRgr8alrUzcGS9edc=";
|
||||
};
|
||||
|
||||
yarnSrc = pkgs.stdenv.mkDerivation {
|
||||
inherit src pname version;
|
||||
|
||||
offlineCache = pkgs.fetchYarnDeps {
|
||||
yarnLock = src + "/yarn.lock";
|
||||
hash = "sha256-nv1NgMm56wWlAYqqdH9UKTnWNhjxWBs1lmG+UCCQAzk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
nodejs
|
||||
yarnConfigHook
|
||||
yarnBuildHook
|
||||
npmHooks.npmInstallHook
|
||||
];
|
||||
|
||||
yarnBuildFlags = [ "--noninteractive" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/${pname}
|
||||
cp -r build node_modules $out/lib/${pname}
|
||||
'';
|
||||
};
|
||||
|
||||
wrapper = pkgs.writeShellApplication {
|
||||
name = pname;
|
||||
runtimeInputs = with pkgs; [ nodejs_20 ];
|
||||
text = ''
|
||||
cd ${yarnSrc}/lib/${pname}
|
||||
exec node build/server.js "$@"
|
||||
'';
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp ${wrapper}/bin/${pname} $out/bin/
|
||||
'';
|
||||
|
||||
meta.mainProgram = pname;
|
||||
}
|
Reference in New Issue
Block a user