blob: bb227d90e677858e55a0c66212ed58b82fd41dca (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
{
buildGoModule,
buildNpmPackage,
nix-update-script,
versionCheckHook,
fetchFromGitHub,
lib,
}:
let
version = "0.10.4";
src = fetchFromGitHub {
repo = "gose";
owner = "stv0g";
tag = "v${version}";
hash = "sha256-CYMpibAvuOScKoCP212MSoAt0hhQhEP0uQK7y/YPk9Q=";
};
frontend = buildNpmPackage {
pname = "gose-frontend";
inherit version;
src = "${src}/frontend";
npmDepsHash = "sha256-p24s2SgCL8E9vUoZEyWSrd15IdkprneAXS7dwb7UbyA=";
installPhase = ''
runHook preInstall
find ./dist
mkdir $out
cp -r dist/* $out/
runHook postInstall
'';
};
in
buildGoModule {
pname = "gose";
inherit version;
inherit src;
vendorHash = "sha256-oz2nmJxnmhj2InN4E7tyz5iWr4geraGszz3QePKuEMM=";
env.CGO_ENABLED = 0;
postInstall = ''
mv $out/bin/cmd $out/bin/gose
'';
tags = [ "embed" ];
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.builtBy=Nix"
];
# Skipping test which relies on internet services.
checkFlags = "-skip TestShortener";
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "-version";
doInstallCheck = true;
prePatch = ''
cp -r ${frontend} frontend/dist
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Modern and scalable file-uploader focusing on scalability and simplicity";
homepage = "https://github.com/stv0g/gose";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ stv0g ];
mainProgram = "gose";
};
}
|