mirror of
https://github.com/js0ny/dotfiles.git
synced 2026-03-22 02:36:19 +00:00
pkgs: noname
This commit is contained in:
parent
2b403b18e4
commit
0ca532e432
9 changed files with 81 additions and 2 deletions
68
nixcfgs/pkgs/noname/default.nix
Normal file
68
nixcfgs/pkgs/noname/default.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchPnpmDeps,
|
||||
pnpmConfigHook,
|
||||
makeWrapper,
|
||||
nodejs_22,
|
||||
pnpm_10,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "noname";
|
||||
version = "v1.11.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "libnoname";
|
||||
repo = "noname";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-w4PGPH2EWNq0wJwLCQeKzV63HjZ8qyLfABvZHGP8oeI=";
|
||||
};
|
||||
|
||||
pnpmRoot = ".";
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs_22
|
||||
pnpm_10
|
||||
pnpmConfigHook
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit (finalAttrs) pname version src pnpmRoot;
|
||||
pnpm = pnpm_10;
|
||||
fetcherVersion = 3;
|
||||
hash = "sha256-1BVkAQut9KfYpduKxBuOoRtHBqh8rbywFC8VnbGCrA0=";
|
||||
};
|
||||
|
||||
pnpmInstallFlags = ["--frozen-lockfile"];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
pnpm -C ${finalAttrs.pnpmRoot} build:full
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share/noname
|
||||
cp -r ./* $out/share/noname
|
||||
|
||||
# wrapper:noname-server -> node dist/noname-server.cjs
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${nodejs_22}/bin/node $out/bin/noname-server \
|
||||
--add-flags "$out/share/noname/dist/noname-server.cjs" \
|
||||
--chdir "$out/share/noname/dist"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "noname (libnoname/noname) packaged from tag source; runs dist/noname-server.cjs";
|
||||
homepage = "https://github.com/libnoname/noname";
|
||||
license = licenses.gpl3Only;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue