2021-06-26 13:26:17 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitea, mage, writeShellScriptBin, nixosTests }:
|
2021-06-26 20:56:45 +01:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "vikunja-api";
|
2021-09-24 21:52:03 +01:00
|
|
|
version = "0.18.1";
|
2021-06-26 20:56:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "kolaente.dev";
|
|
|
|
owner = "vikunja";
|
|
|
|
repo = "api";
|
|
|
|
rev = "v${version}";
|
2021-09-24 21:52:03 +01:00
|
|
|
sha256 = "sha256-ngdtK8e4mLpbuY9OP1aHk99qPX/cKwnyhb/3ImTwF6M=";
|
2021-06-26 20:56:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs =
|
|
|
|
let
|
|
|
|
fakeGit = writeShellScriptBin "git" ''
|
|
|
|
if [[ $@ = "describe --tags --always --abbrev=10" ]]; then
|
|
|
|
echo "${version}"
|
|
|
|
else
|
|
|
|
>&2 echo "Unknown command: $@"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
in [ fakeGit mage ];
|
|
|
|
|
2021-09-24 21:52:03 +01:00
|
|
|
vendorSha256 = "sha256-0MP04KpWX17Fa1WhLwF4yzIsDqGAeTUXxv81B+BTNe4=";
|
2021-06-26 20:56:45 +01:00
|
|
|
|
|
|
|
# checks need to be disabled because of needed internet for some checks
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
# Fixes "mkdir /homeless-shelter: permission denied" - "Error: error compiling magefiles" during build
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
mage build:build
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
install -Dt $out/bin vikunja
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-06-26 13:26:17 +01:00
|
|
|
passthru.tests.vikunja = nixosTests.vikunja;
|
|
|
|
|
2021-06-26 20:56:45 +01:00
|
|
|
meta = {
|
|
|
|
description = "API of the Vikunja to-do list app";
|
|
|
|
homepage = "https://vikunja.io/";
|
|
|
|
license = lib.licenses.agpl3Plus;
|
|
|
|
maintainers = with lib.maintainers; [ em0lar ];
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
}
|