File tree Expand file tree Collapse file tree 1 file changed +104
-0
lines changed
pkgs/by-name/st/statping-ng Expand file tree Collapse file tree 1 file changed +104
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ buildGoModule ,
3+ fetchFromGitHub ,
4+ fetchYarnDeps ,
5+ go-rice ,
6+ lib ,
7+ nodejs ,
8+ stdenv ,
9+ yarnBuildHook ,
10+ yarnConfigHook ,
11+ } :
12+ let
13+ version = "0.92.0" ;
14+
15+ src = fetchFromGitHub {
16+ owner = "statping-ng" ;
17+ repo = "statping-ng" ;
18+ tag = "v${ version } " ;
19+ hash = "sha256-E4sVIa8sKmjRcduATTHLklkr+LKX6KucDw42uVFhK4g=" ;
20+ } ;
21+
22+ frontend = stdenv . mkDerivation {
23+ pname = "statping-ng-frontend" ;
24+ inherit version ;
25+ src = "${ src } /frontend" ;
26+
27+ yarnOfflineCache = fetchYarnDeps {
28+ yarnLock = "${ src } /frontend/yarn.lock" ;
29+ hash = "sha256-e8GyKIJ0RopRliVMVrY8eEd6Qx/gTKbW3biPCSqbRrQ=" ;
30+ } ;
31+
32+ nativeBuildInputs = [
33+ nodejs
34+ yarnConfigHook
35+ yarnBuildHook
36+ ] ;
37+
38+ preBuild = ''
39+ export NODE_OPTIONS=--openssl-legacy-provider
40+ '' ;
41+
42+ installPhase = ''
43+ runHook preInstall
44+
45+ mkdir -p "$out"
46+ cp -rt "$out" dist/* src/assets/scss public/robots.txt
47+
48+ runHook postInstall
49+ '' ;
50+ } ;
51+ in
52+ buildGoModule rec {
53+ pname = "statping-ng" ;
54+ inherit version src ;
55+
56+ proxyVendor = true ;
57+ vendorHash = "sha256-ZcNOI5/Fs7/U8/re89YpJ3qlMaQStLrrNHXiHuBQwQk=" ;
58+
59+ postPatch = ''
60+ ln -s "${ frontend } " source/dist
61+ '' ;
62+
63+ nativeBuildInputs = [
64+ go-rice
65+ ] ;
66+
67+ preBuild = ''
68+ (cd source && rice embed-go)
69+ '' ;
70+
71+ subPackages = [
72+ "cmd/"
73+ ] ;
74+
75+ ldflags = [
76+ "-s"
77+ "-w"
78+ "-X main.VERSION=${ version } "
79+ ] ;
80+
81+ tags = [
82+ "netgo"
83+ "ousergo"
84+ ] ;
85+
86+ doCheck = false ;
87+
88+ postInstall = ''
89+ mv $out/bin/cmd $out/bin/statping-ng
90+ $out/bin/statping-ng version | grep ${ version } > /dev/null
91+ '' ;
92+
93+ meta = {
94+ description = "Status Page for monitoring your websites and applications with beautiful graphs, analytics, and plugins" ;
95+ homepage = "https://github.com/statping-ng/statping-ng" ;
96+ changelog = "https://github.com/statping-ng/statping-ng/releases/tag/v${ src . tag } " ;
97+ license = lib . licenses . gpl3Only ;
98+ maintainers = with lib . maintainers ; [
99+ FKouhai
100+ ] ;
101+ platforms = lib . platforms . linux ;
102+ mainProgram = "statping-ng" ;
103+ } ;
104+ }
You can’t perform that action at this time.
0 commit comments