diff --git a/pkgs/default.nix b/pkgs/default.nix index febcb70..76d46ee 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -5,6 +5,7 @@ zsh-histdb = super.callPackage ./zsh-histdb.nix {}; your_spotify = super.callPackage ./your_spotify.nix {}; deploy = super.callPackage ./deploy.nix {}; + netbird-dashboard = super.callPackage ./netbird-dashboard {}; minify = super.callPackage ./minify {}; mongodb-bin = super.callPackage ./mongodb-bin.nix {}; awakened-poe-trade = super.callPackage ./awakened-poe-trade.nix {}; diff --git a/pkgs/netbird-dashboard/0001-remove-buildtime-google-fonts.patch b/pkgs/netbird-dashboard/0001-remove-buildtime-google-fonts.patch new file mode 100644 index 0000000..8313933 --- /dev/null +++ b/pkgs/netbird-dashboard/0001-remove-buildtime-google-fonts.patch @@ -0,0 +1,22 @@ +diff --git a/src/layouts/AppLayout.tsx b/src/layouts/AppLayout.tsx +index 86137fe..0339fb7 100644 +--- a/src/layouts/AppLayout.tsx ++++ b/src/layouts/AppLayout.tsx +@@ -6,7 +6,7 @@ import { cn } from "@utils/helpers"; + import dayjs from "dayjs"; + import relativeTime from "dayjs/plugin/relativeTime"; + import { Viewport } from "next/dist/lib/metadata/types/extra-types"; +-import { Inter } from "next/font/google"; ++import localFont from "next/font/local"; + import React from "react"; + import { Toaster } from "react-hot-toast"; + import OIDCProvider from "@/auth/OIDCProvider"; +@@ -17,7 +17,7 @@ import ErrorBoundaryProvider from "@/contexts/ErrorBoundary"; + import { GlobalThemeProvider } from "@/contexts/GlobalThemeProvider"; + import { NavigationEvents } from "@/contexts/NavigationEvents"; + +-const inter = Inter({ subsets: ["latin"] }); ++const inter = localFont({ src: "./inter.ttf" }); + + // Extend dayjs with relativeTime plugin + dayjs.extend(relativeTime); diff --git a/pkgs/netbird-dashboard/default.nix b/pkgs/netbird-dashboard/default.nix new file mode 100644 index 0000000..16f5bef --- /dev/null +++ b/pkgs/netbird-dashboard/default.nix @@ -0,0 +1,40 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, + inter, +}: +buildNpmPackage rec { + pname = "netbird-dashboard"; + version = "2.1.3"; + + src = fetchFromGitHub { + owner = "netbirdio"; + repo = "dashboard"; + rev = "v${version}"; + hash = "sha256-RxqGNIo7UdcVKz7UmupjsCzDpaSoz9UawiUc+h2tyTU="; + }; + patches = [ + ./0001-remove-buildtime-google-fonts.patch + ]; + + CYPRESS_INSTALL_BINARY = 0; + npmDepsHash = "sha256-ts3UuThIMf+wwSr3DpZ+k1i9RnHi/ltvhD/7lomVxQk="; + npmFlags = ["--legacy-peer-deps"]; + + preBuild = '' + cp ${inter}/share/fonts/truetype/InterVariable.ttf src/layouts/inter.ttf + ''; + + installPhase = '' + mkdir -p $out + cp -R out/* $out + ''; + + meta = with lib; { + description = "NetBird Management Service Web UI Panel"; + homepage = "https://github.com/netbirdio/dashboard"; + license = licenses.bsd3; + maintainers = with maintainers; [thubrecht]; + }; +}