forked from
lass.pds.lassul.us/superconfig
This repository has no description
2.2 kB
76 lines
1{
2 lib,
3 applyPatches,
4 buildGoModule,
5 buildNpmPackage,
6 fetchFromGitHub,
7 makeWrapper,
8}:
9
10let
11 version = "0-unstable-2026-10-07";
12
13 # self-host.patch (AGPL-3.0 §13: this directory is the corresponding source
14 # linked from the footer and the landing page):
15 # - strips Google Tag Manager and the landing page's YouTube/Vimeo embeds
16 # and GitHub star button (upstream itself dropped ads and the paywall)
17 # - replaces the Google/Outlook/email-OTP sign-in page with GitHub OAuth
18 # (GET /api/auth/github, GITHUB_CLIENT_ID/GITHUB_CLIENT_SECRET)
19 # - "Schedule" offers a .ics download next to Google Calendar/Outlook, and
20 # scheduled-event links point at this instance instead of timeful.app
21 # - makes the listen address configurable via LISTEN_ADDR (upstream
22 # hardcodes ":3002" on all interfaces)
23 src = applyPatches {
24 src = fetchFromGitHub {
25 owner = "schej-it";
26 repo = "timeful.app";
27 rev = "add892487de2e1a4cf0d68aa6c07518a379b8f41";
28 hash = "sha256-LQt1kBr2pSkmIxpwV5hSUqDXNt6vRjouCbMBsYqnVeg=";
29 };
30 patches = [ ./self-host.patch ];
31 };
32
33 frontend = buildNpmPackage {
34 pname = "timeful-frontend";
35 inherit version;
36 src = "${src}/frontend";
37
38 npmDepsHash = "sha256-P0oM7gKDfrNP5m5TRHGgPUb6kGLqMeCgLAuQVcDxOCQ=";
39
40 # No PostHog key and no Google/Microsoft OAuth client baked in; sign-in
41 # goes through the server-side GitHub flow instead.
42 installPhase = ''
43 runHook preInstall
44 cp -r dist $out
45 runHook postInstall
46 '';
47 };
48in
49buildGoModule {
50 pname = "timeful";
51 inherit version src;
52
53 modRoot = "server";
54 subPackages = [ "." ];
55 vendorHash = "sha256-1LtyEruDRoW8JUbxqkv+XGhRZolPIquuTQZwu5USYDg=";
56
57 nativeBuildInputs = [ makeWrapper ];
58
59 postInstall = ''
60 mv $out/bin/server $out/bin/timeful
61 wrapProgram $out/bin/timeful --set-default FRONTEND_DIST ${frontend}
62 '';
63
64 passthru = {
65 inherit frontend;
66 updateScript = ./update.sh;
67 };
68
69 meta = {
70 description = "Availability poll to find the best time for a group to meet (formerly Schej)";
71 homepage = "https://github.com/schej-it/timeful.app";
72 license = lib.licenses.agpl3Only;
73 mainProgram = "timeful";
74 platforms = lib.platforms.linux;
75 };
76}