Former-commit-id: 5bdbfb3a5f
This commit is contained in:
Hadi
2024-06-20 12:09:20 +02:00
parent 59a3c1d4de
commit 65f8fcc926
6 changed files with 29 additions and 24 deletions

View File

@@ -1,25 +1,28 @@
{ lib, buildNpmPackage, fetchFromGitHub }:
{ pkgs, ... }: {
nginx.virtualHosts."home.anotherhadi.com" = {
enableACME = true;
root = pkgs.stdenv.mkDerivation {
name = "homepage";
buildNpmPackage rec {
pname = "homepage";
version = "0.0.0";
src = pkgs.fetchFromGitHub {
owner = "anotherhadi";
repo = "homepage";
rev = "6588787368cbc403cdec08fd25ef27b42077b8d3";
hash = "sha256-Z2TZ56I6lRmYkLRnnMscvmSCzGt5q9yX90lGPebJpe8=";
};
src = fetchFromGitHub {
owner = "anotherhadi";
repo = pname;
rev = "v${version}";
hash = "sha256-BR+ZGkBBfd0dSQqAvujsbgsEPFYw/ThrylxUbOksYxM=";
};
buildInputs = with pkgs; [ nodejs ];
npmDepsHash = "sha256-tuEfyePwlOy2/mOPdXbqJskO6IowvAP4DWg8xSZwbJw=";
buildPhase = ''
npm install
npm run build
'';
# The prepack script runs the build script, which we'd rather do in the build phase.
npmPackFlags = [ "--ignore-scripts" ];
installPhase = ''
mkdir -p $out
cp -r build/* $out
'';
meta = {
description = "A simple homepage for your server.";
homepage = "https://github.com/anotherhadi/homepage";
# license = lib.licenses.gpl3Only;
# maintainers = with lib.maintainers; [ winter ];
};
};
}