2021-01-23 08:47:37 +00:00
|
|
|
{ lib
|
2019-10-05 07:46:51 +00:00
|
|
|
, buildGoPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildGoModule
|
|
|
|
, sqlite
|
|
|
|
, callPackage
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "gotify-server";
|
2020-04-27 13:23:33 +00:00
|
|
|
# should be update just like all other files imported like that via the
|
|
|
|
# `update.sh` script.
|
|
|
|
version = import ./version.nix;
|
2019-10-05 07:46:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gotify";
|
|
|
|
repo = "server";
|
|
|
|
rev = "v${version}";
|
2020-04-27 13:23:33 +00:00
|
|
|
sha256 = import ./source-sha.nix;
|
2019-10-05 07:46:51 +00:00
|
|
|
};
|
|
|
|
|
2020-11-30 21:16:14 +00:00
|
|
|
# With `allowGoReference = true;`, `buildGoModule` adds the `-trimpath`
|
|
|
|
# argument for Go builds which apparently breaks the UI like this:
|
|
|
|
#
|
|
|
|
# server[780]: stat /var/lib/private/ui/build/index.html: no such file or directory
|
|
|
|
allowGoReference = true;
|
|
|
|
|
2020-05-14 22:39:42 +00:00
|
|
|
vendorSha256 = import ./vendor-sha.nix;
|
2019-10-05 07:46:51 +00:00
|
|
|
|
2020-08-04 00:26:27 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2020-03-27 07:33:21 +00:00
|
|
|
buildInputs = [ sqlite ];
|
2019-10-05 07:46:51 +00:00
|
|
|
|
|
|
|
ui = callPackage ./ui.nix { };
|
|
|
|
|
|
|
|
preBuild = ''
|
2020-09-12 17:02:09 +00:00
|
|
|
cp -r ${ui}/libexec/gotify-ui/deps/gotify-ui/build ui/build && go run hack/packr/packr.go
|
2019-10-05 07:46:51 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-10 20:12:41 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
};
|
|
|
|
|
2019-10-05 07:46:51 +00:00
|
|
|
# Otherwise, all other subpackages are built as well and from some reason,
|
|
|
|
# produce binaries which panic when executed and are not interesting at all
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
buildFlagsArray = [
|
2020-09-13 13:16:00 +00:00
|
|
|
"-ldflags=-X main.Version=${version} -X main.Mode=prod"
|
2019-10-05 07:46:51 +00:00
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-10-05 07:46:51 +00:00
|
|
|
description = "A simple server for sending and receiving messages in real-time per WebSocket";
|
|
|
|
homepage = "https://gotify.net";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ doronbehar ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|