nixos-configs/packages/homepage/default.nix

96 lines
2.5 KiB
Nix
Raw Normal View History

{
buildNpmPackage,
fetchFromGitHub,
nodePackages,
python3,
stdenv,
cctools,
IOKit ? {},
lib,
enableLocalIcons ? true,
git,
}: let
inherit (lib) optionals optionalString;
installLocalIcons = import ./icons.nix {inherit fetchFromGitHub;};
pname = "homepage-dashboard";
chore: update sources Flake Inputs: • Updated input 'ags': 'github:Aylur/ags' (2024-12-13) rev: 27cd93147aba09142fa585fd16f13c56268b696c → 'github:Aylur/ags' (2024-12-26) rev: 46aad56c4eb33cd83cd32b4757b96731bebc81a7 • Updated input 'hyprland': 'github:hyprwm/Hyprland' (2024-12-23) rev: 2e2e2e2cad97eb017ab02f8a67b751e0abe3bb72 → 'github:hyprwm/Hyprland' (2024-12-26) rev: e75e2cdac79417ffdbbbe903f72668953483a4e7 • Updated input 'hyprland-plugins': 'github:hyprwm/hyprland-plugins' (2024-12-22) rev: 859b9cd371b4e1bf1043cedc8ab6c514e13ab358 → 'github:hyprwm/hyprland-plugins' (2024-12-26) rev: 616e7ef0aca905b9b4012d2bedbb9225d51040bf • Updated input 'hyprutils': 'github:hyprwm/hyprutils' (2024-12-22) rev: 5e45b1a1b9f02594843b3190deff0a68306525d2 → 'github:hyprwm/hyprutils' (2024-12-25) rev: 9be03a8562e3ed9e648d8fcf0930d0ec86d671a4 • Updated input 'nix-gaming': 'github:fufexan/nix-gaming' (2024-12-22) rev: e45e2276facb9218c119e68c45efd2f9e79d292d → 'github:fufexan/nix-gaming' (2024-12-25) rev: 95f1cc7ebe63b5a5af6c2d206ffd422739c5959e • Updated input 'nix-index-db': 'github:Mic92/nix-index-database' (2024-12-22) rev: d583b2d142f0428313df099f4a2dcf2a0496aa78 → 'github:Mic92/nix-index-database' (2024-12-26) rev: 7e3246f6ad43b44bc1c16d580d7bf6467f971530 • Updated input 'tuya-local-src': 'github:make-all/tuya-local' (2024-12-23) rev: 61c932e694cde191cb8c19cf07264e871bf14fe9 → 'github:make-all/tuya-local' (2024-12-27) rev: bfdc5c918ddf1924fafd0900748302391489d862 Docker Images: • postgres 14: sha256:19afc4af194bd5a58f3d86924fb1ab42b1950ffdc70b145996f1919ef6b03222 → sha256:922d38d4ca73ba5bfa8140c50b0d1f45636ca7b4c20d90506c49e2be2d7911f5 • vegardit/gitea-act-runner dind-latest: sha256:1cb04d85979d671a20c045d23c99bb64df9d4c4d42c236778db0583e146b0b9a → sha256:e4e403c6d197b86f7421c64d682b0e8b766e3703989449930cdaaec82ea82216 • postgres 14: sha256:19afc4af194bd5a58f3d86924fb1ab42b1950ffdc70b145996f1919ef6b03222 → sha256:922d38d4ca73ba5bfa8140c50b0d1f45636ca7b4c20d90506c49e2be2d7911f5 • nginx latest: sha256:fb197595ebe76b9c0c14ab68159fd3c08bd067ec62300583543f0ebda353b5be → sha256:42e917aaa1b5bb40dd0f6f7f4f857490ac7747d7ef73b391c774a41a8b994f15 • nextcloud fpm: sha256:3d017f226daa668be007c1f57741f24453203719e24231adb30b57461a55de46 → sha256:f6b2ec624555c8f63b0b5f8950b432e10352f522b571b66283f10d20b7ef62aa • ghcr.io/linuxserver/bazarr latest: sha256:4e6e74dd25e0b7a0dd20190b1a9e0ec1adb74b56d7b87ce5c9d073f44b2cf2b1 → sha256:c99ddc0c3a6c23edec34faf81a21fd9bdb60a02b3b5d916590b7a7e48254c87f • ghcr.io/linuxserver/prowlarr latest: sha256:e64cb6fe480d68615cbec57b9c717fafb321676f360575b332990fc6251a386c → sha256:447b8d85c4b1290d42b526e4cdd70af380e69bb2f70c4d2497816d7a528d2a08 • ghcr.io/linuxserver/radarr latest: sha256:ee4c2213b769bc9a891b5dd5aa1786804634fb681dd261b3bed6b65d98592c55 → sha256:0068f9fa55cdf8b72b831b8fd56e9e94cf1de969cfa1f58f7ba11ee3619eaf65 • ghcr.io/linuxserver/sabnzbd latest: sha256:37cfb25fdeaca82e1ad89a1bf664efe41ad481ed56aa069f710ac975cc5c6ecf → sha256:76a15e85e391eb2702ac1c6ccd90fc7b7546913065c1504f708ce9bf863aedbf • ghcr.io/linuxserver/sonarr latest: sha256:b466acde22d18859336e790af23c0b56d9dbb7199935b226b3139bf416fe7e1c → sha256:ca4ad72f07e532d1d414435eb43193d1dc407255e46c21c2694653ca8af4fd81 nix-update executions: homepage: 0.10.3 -> 0.10.5
2024-12-27 02:19:02 -05:00
version = "0.10.5";
in
buildNpmPackage {
inherit pname version;
src = fetchFromGitHub {
owner = "gethomepage";
repo = "homepage";
rev = "v${version}";
chore: update sources Flake Inputs: • Updated input 'ags': 'github:Aylur/ags' (2024-12-13) rev: 27cd93147aba09142fa585fd16f13c56268b696c → 'github:Aylur/ags' (2024-12-26) rev: 46aad56c4eb33cd83cd32b4757b96731bebc81a7 • Updated input 'hyprland': 'github:hyprwm/Hyprland' (2024-12-23) rev: 2e2e2e2cad97eb017ab02f8a67b751e0abe3bb72 → 'github:hyprwm/Hyprland' (2024-12-26) rev: e75e2cdac79417ffdbbbe903f72668953483a4e7 • Updated input 'hyprland-plugins': 'github:hyprwm/hyprland-plugins' (2024-12-22) rev: 859b9cd371b4e1bf1043cedc8ab6c514e13ab358 → 'github:hyprwm/hyprland-plugins' (2024-12-26) rev: 616e7ef0aca905b9b4012d2bedbb9225d51040bf • Updated input 'hyprutils': 'github:hyprwm/hyprutils' (2024-12-22) rev: 5e45b1a1b9f02594843b3190deff0a68306525d2 → 'github:hyprwm/hyprutils' (2024-12-25) rev: 9be03a8562e3ed9e648d8fcf0930d0ec86d671a4 • Updated input 'nix-gaming': 'github:fufexan/nix-gaming' (2024-12-22) rev: e45e2276facb9218c119e68c45efd2f9e79d292d → 'github:fufexan/nix-gaming' (2024-12-25) rev: 95f1cc7ebe63b5a5af6c2d206ffd422739c5959e • Updated input 'nix-index-db': 'github:Mic92/nix-index-database' (2024-12-22) rev: d583b2d142f0428313df099f4a2dcf2a0496aa78 → 'github:Mic92/nix-index-database' (2024-12-26) rev: 7e3246f6ad43b44bc1c16d580d7bf6467f971530 • Updated input 'tuya-local-src': 'github:make-all/tuya-local' (2024-12-23) rev: 61c932e694cde191cb8c19cf07264e871bf14fe9 → 'github:make-all/tuya-local' (2024-12-27) rev: bfdc5c918ddf1924fafd0900748302391489d862 Docker Images: • postgres 14: sha256:19afc4af194bd5a58f3d86924fb1ab42b1950ffdc70b145996f1919ef6b03222 → sha256:922d38d4ca73ba5bfa8140c50b0d1f45636ca7b4c20d90506c49e2be2d7911f5 • vegardit/gitea-act-runner dind-latest: sha256:1cb04d85979d671a20c045d23c99bb64df9d4c4d42c236778db0583e146b0b9a → sha256:e4e403c6d197b86f7421c64d682b0e8b766e3703989449930cdaaec82ea82216 • postgres 14: sha256:19afc4af194bd5a58f3d86924fb1ab42b1950ffdc70b145996f1919ef6b03222 → sha256:922d38d4ca73ba5bfa8140c50b0d1f45636ca7b4c20d90506c49e2be2d7911f5 • nginx latest: sha256:fb197595ebe76b9c0c14ab68159fd3c08bd067ec62300583543f0ebda353b5be → sha256:42e917aaa1b5bb40dd0f6f7f4f857490ac7747d7ef73b391c774a41a8b994f15 • nextcloud fpm: sha256:3d017f226daa668be007c1f57741f24453203719e24231adb30b57461a55de46 → sha256:f6b2ec624555c8f63b0b5f8950b432e10352f522b571b66283f10d20b7ef62aa • ghcr.io/linuxserver/bazarr latest: sha256:4e6e74dd25e0b7a0dd20190b1a9e0ec1adb74b56d7b87ce5c9d073f44b2cf2b1 → sha256:c99ddc0c3a6c23edec34faf81a21fd9bdb60a02b3b5d916590b7a7e48254c87f • ghcr.io/linuxserver/prowlarr latest: sha256:e64cb6fe480d68615cbec57b9c717fafb321676f360575b332990fc6251a386c → sha256:447b8d85c4b1290d42b526e4cdd70af380e69bb2f70c4d2497816d7a528d2a08 • ghcr.io/linuxserver/radarr latest: sha256:ee4c2213b769bc9a891b5dd5aa1786804634fb681dd261b3bed6b65d98592c55 → sha256:0068f9fa55cdf8b72b831b8fd56e9e94cf1de969cfa1f58f7ba11ee3619eaf65 • ghcr.io/linuxserver/sabnzbd latest: sha256:37cfb25fdeaca82e1ad89a1bf664efe41ad481ed56aa069f710ac975cc5c6ecf → sha256:76a15e85e391eb2702ac1c6ccd90fc7b7546913065c1504f708ce9bf863aedbf • ghcr.io/linuxserver/sonarr latest: sha256:b466acde22d18859336e790af23c0b56d9dbb7199935b226b3139bf416fe7e1c → sha256:ca4ad72f07e532d1d414435eb43193d1dc407255e46c21c2694653ca8af4fd81 nix-update executions: homepage: 0.10.3 -> 0.10.5
2024-12-27 02:19:02 -05:00
hash = "sha256-Zk6hS2TAtP5Mf8G5QKy0xLeZJDdEOAPEEUyl8yV+1lQ=";
};
npmDepsHash = "sha256-AW7lNkvQeeHkAf6Q23912LiSHJMelR9+4KVSKdlFqd0=";
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
'';
nativeBuildInputs = [git] ++ optionals stdenv.hostPlatform.isDarwin [cctools];
buildInputs =
[
nodePackages.node-gyp-build
]
++ optionals stdenv.hostPlatform.isDarwin [IOKit];
env.PYTHON = "${python3}/bin/python";
installPhase = ''
runHook preInstall
mkdir -p $out/{share,bin}
cp -r .next/standalone $out/share/homepage/
cp -r public $out/share/homepage/public
mkdir -p $out/share/homepage/.next
cp -r .next/static $out/share/homepage/.next/static
chmod +x $out/share/homepage/server.js
# This patch must be applied here, as it's patching the `dist` directory
# of NextJS. Without this, homepage-dashboard errors when trying to
# write its prerender cache.
#
# This patch ensures that the cache implementation respects the env
# variable `HOMEPAGE_CACHE_DIR`, which is set by default in the
# wrapper below.
pushd $out
git apply ${./prerender_cache_path.patch}
popd
makeWrapper $out/share/homepage/server.js $out/bin/homepage \
--set-default PORT 3000 \
--set-default HOMEPAGE_CONFIG_DIR /var/lib/homepage-dashboard \
--set-default HOMEPAGE_CACHE_DIR /var/cache/homepage-dashboard
${optionalString enableLocalIcons installLocalIcons}
runHook postInstall
'';
doDist = false;
meta = {
description = "Highly customisable dashboard with Docker and service API integrations";
changelog = "https://github.com/gethomepage/homepage/releases/tag/v${version}";
mainProgram = "homepage";
homepage = "https://gethomepage.dev";
license = lib.licenses.gpl3;
};
}