nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenvNoCC,
4 fetchFromGitHub,
5 pnpm_9,
6 nodejs,
7 dart-sass,
8 nix-update-script,
9 nixosTests,
10}:
11stdenvNoCC.mkDerivation rec {
12 pname = "homer";
13 version = "25.04.1";
14 src = fetchFromGitHub {
15 owner = "bastienwirtz";
16 repo = "homer";
17 rev = "v${version}";
18 hash = "sha256-hvDrFGv6Mht9whA2lJbDLQnP2LkOiCo3NtjMpWr/q6A=";
19 };
20
21 pnpmDeps = pnpm_9.fetchDeps {
22 inherit
23 pname
24 version
25 src
26 patches
27 ;
28 fetcherVersion = 1;
29 hash = "sha256-y1R+rlaOtFOHHAgEHPBl40536U10Ft0iUSfGcfXS08Y=";
30 };
31
32 # Enables specifying a custom Sass compiler binary path via `SASS_EMBEDDED_BIN_PATH` environment variable.
33 patches = [ ./0001-build-enable-specifying-custom-sass-compiler-path-by.patch ];
34
35 nativeBuildInputs = [
36 nodejs
37 dart-sass
38 pnpm_9.configHook
39 ];
40
41 buildPhase = ''
42 runHook preBuild
43
44 export SASS_EMBEDDED_BIN_PATH="${dart-sass}/bin/sass"
45 pnpm build
46
47 runHook postBuild
48 '';
49
50 installPhase = ''
51 runHook preInstall
52
53 mkdir -p $out
54 cp -R dist/* $out/
55
56 runHook postInstall
57 '';
58
59 passthru = {
60 updateScript = nix-update-script { };
61 tests = {
62 inherit (nixosTests.homer) caddy nginx;
63 };
64 };
65
66 meta = with lib; {
67 description = "Very simple static homepage for your server";
68 homepage = "https://homer-demo.netlify.app/";
69 changelog = "https://github.com/bastienwirtz/homer/releases";
70 license = licenses.asl20;
71 maintainers = with maintainers; [
72 stunkymonkey
73 christoph-heiss
74 ];
75 platforms = platforms.all;
76 };
77}