2023-07-15 17:15:38 +00:00
|
|
|
{ buildNpmPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nodePackages
|
|
|
|
, python3
|
2023-08-04 22:07:22 +00:00
|
|
|
, stdenv
|
|
|
|
, cctools
|
|
|
|
, IOKit
|
2023-07-15 17:15:38 +00:00
|
|
|
, lib
|
|
|
|
, fetchpatch
|
|
|
|
, makeBinaryWrapper
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildNpmPackage rec {
|
|
|
|
pname = "homepage-dashboard";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "0.8.6";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-10-09 19:29:22 +00:00
|
|
|
owner = "gethomepage";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = "homepage";
|
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-ws4zPt6N4gPRLgJAeozPlbSJm0mOQKmkOZpKeB1y+J0=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
npmDepsHash = "sha256-RC2Y4XZqO+mLEKQxq+j2ukZYi/uu9XIjYadxek9P+SM=";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
mkdir -p config
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
# Add a shebang to the server js file, then patch the shebang.
|
|
|
|
sed -i '1s|^|#!/usr/bin/env node\n|' .next/standalone/server.js
|
|
|
|
patchShebangs .next/standalone/server.js
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
cctools
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = [
|
|
|
|
nodePackages.node-gyp-build
|
2023-08-04 22:07:22 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
IOKit
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
env.PYTHON = "${python3}/bin/python";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r .next/standalone $out/bin
|
|
|
|
cp -r public $out/bin/public
|
|
|
|
|
|
|
|
mkdir -p $out/bin/.next
|
|
|
|
cp -r .next/static $out/bin/.next/static
|
|
|
|
|
|
|
|
mv $out/bin/server.js $out/bin/homepage
|
|
|
|
chmod +x $out/bin/homepage
|
|
|
|
|
|
|
|
wrapProgram $out/bin/homepage \
|
|
|
|
--set-default PORT 3000 \
|
|
|
|
--set-default HOMEPAGE_CONFIG_DIR /var/lib/homepage-dashboard
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
doDist = false;
|
|
|
|
|
|
|
|
passthru.tests = {
|
2023-08-04 22:07:22 +00:00
|
|
|
inherit (nixosTests) homepage-dashboard;
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A highly customisable dashboard with Docker and service API integrations.";
|
|
|
|
mainProgram = "homepage";
|
|
|
|
homepage = "https://gethomepage.dev";
|
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
maintainers = with lib.maintainers; [ jnsgruk ];
|
|
|
|
platforms = lib.platforms.all;
|
2024-01-02 11:29:13 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
}
|