-
Notifications
You must be signed in to change notification settings - Fork 7
/
default.nix
67 lines (55 loc) · 1.18 KB
/
default.nix
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
# SPDX-FileCopyrightText: 2024 Steffen Vogel <post@steffenvogel.de>
# SPDX-License-Identifier: Apache-2.0
{
buildGoModule,
buildNpmPackage,
versionCheckHook,
lib,
}:
let
version = "0.8.0";
frontend = buildNpmPackage {
pname = "gose-frontend";
inherit version;
src = ./frontend;
npmDepsHash = "sha256-p24s2SgCL8E9vUoZEyWSrd15IdkprneAXS7dwb7UbyA=";
installPhase = ''
find ./dist
mkdir $out
cp -r dist/* $out/
'';
};
in
buildGoModule {
pname = "gose";
inherit version;
src = ./.;
vendorHash = "sha256-U/umJ6McCuD0HARVMj1JXHOpVxcph16z7Y7i47Nf3cg=";
CGO_ENABLED = 0;
postInstall = ''
mv $out/bin/cmd $out/bin/gose
'';
tags = [ "embed" ];
ldflags = [
"-s"
"-w"
"-X"
"main.version=${version}"
"-X"
"main.builtBy=Nix"
];
checkFlags = "-skip TestShortener";
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
prePatch = ''
cp -r ${frontend} frontend/dist
'';
meta = {
description = "GoSƐ: A terascale file-uploader";
homepage = "https://github.com/stv0g/gose";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ stv0g ];
};
}