mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-04 14:00:04 +00:00
92 lines
2.0 KiB
Nix
92 lines
2.0 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
rustPlatform,
|
|
fetchPnpmDeps,
|
|
stdenv,
|
|
pnpm_10,
|
|
pnpmConfigHook,
|
|
nodejs,
|
|
makeWrapper,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage (
|
|
finalAttrs:
|
|
let
|
|
frontendPname = "wealthfolio-frontend";
|
|
|
|
frontend = stdenv.mkDerivation {
|
|
pname = frontendPname;
|
|
inherit (finalAttrs) version src;
|
|
|
|
__structuredAttrs = true;
|
|
strictDeps = true;
|
|
|
|
pnpmDeps = fetchPnpmDeps {
|
|
pname = frontendPname;
|
|
inherit (finalAttrs) version src;
|
|
|
|
pnpm = pnpm_10;
|
|
fetcherVersion = 3;
|
|
hash = "sha256-P7N2Y41W467PxEcg6EGBuEB1s6n7wfQh4Rg2Mv8z8bs=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
nodejs
|
|
pnpm_10
|
|
pnpmConfigHook
|
|
];
|
|
|
|
buildPhase = ''
|
|
export BUILD_TARGET=web
|
|
pnpm --filter frontend... build
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -R dist/* $out/
|
|
'';
|
|
|
|
inherit (finalAttrs) meta;
|
|
};
|
|
in
|
|
{
|
|
__structuredAttrs = true;
|
|
|
|
pname = "wealthfolio-server";
|
|
version = "3.8.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "wealthfolio";
|
|
repo = "wealthfolio";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-5CqLHnwBzqA+yf/sQM2ie3xuO+5aM5EDA0bhZ6r1VIM=";
|
|
};
|
|
|
|
cargoRoot = ".";
|
|
buildAndTestSubdir = "apps/server";
|
|
cargoHash = "sha256-PFMmpQhQubMzomvLWMJZrriH9emwEzO/rTFCovzFt6w=";
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
postInstall = ''
|
|
mkdir -p $out/share/wealthfolio/dist
|
|
|
|
cp -R ${frontend}/* $out/share/wealthfolio/dist/
|
|
|
|
wrapProgram $out/bin/wealthfolio-server \
|
|
--set WF_STATIC_DIR "$out/share/wealthfolio/dist"
|
|
'';
|
|
|
|
meta = {
|
|
description = "Self-hosted web app for Wealthfolio";
|
|
homepage = "https://wealthfolio.app/";
|
|
changelog = "https://github.com/wealthfolio/wealthfolio/tag/${finalAttrs.src.tag}";
|
|
mainProgram = "wealthfolio-server";
|
|
license = lib.licenses.agpl3Only;
|
|
maintainers = with lib.maintainers; [ luuumine ];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|
|
)
|