depot/third_party/nixpkgs/pkgs/servers/web-apps/vikunja/api.nix
Default email 3a4df29a92 Project import generated by Copybara.
GitOrigin-RevId: 3d7435c638baffaa826b85459df0fff47f12317d
2022-06-16 19:23:12 +02:00

58 lines
1.4 KiB
Nix

{ lib, buildGoModule, fetchFromGitea, mage, writeShellScriptBin, nixosTests }:
buildGoModule rec {
pname = "vikunja-api";
version = "0.18.1";
src = fetchFromGitea {
domain = "kolaente.dev";
owner = "vikunja";
repo = "api";
rev = "v${version}";
sha256 = "sha256-ngdtK8e4mLpbuY9OP1aHk99qPX/cKwnyhb/3ImTwF6M=";
};
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 ];
vendorSha256 = "sha256-0MP04KpWX17Fa1WhLwF4yzIsDqGAeTUXxv81B+BTNe4=";
# 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
'';
passthru.tests.vikunja = nixosTests.vikunja;
meta = {
description = "API of the Vikunja to-do list app";
homepage = "https://vikunja.io/";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ leona ];
mainProgram = "vikunja";
platforms = lib.platforms.all;
};
}