nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 php,
5 nixosTests,
6}:
7
8php.buildComposerProject2 (finalAttrs: {
9 pname = "davis";
10 version = "5.1.2";
11
12 src = fetchFromGitHub {
13 owner = "tchapi";
14 repo = "davis";
15 tag = "v${finalAttrs.version}";
16 hash = "sha256-Z2e5QRyyJeisWLi2tZJZNAXrO3/DL6v2Nvxd0+SC6EU=";
17 };
18
19 vendorHash = "sha256-ee3Gvg8rvX9jelmSVHjFltZz9R+7w2B8L4gjv3GaN/g=";
20
21 composerNoPlugins = false;
22
23 postInstall = ''
24 chmod -R u+w $out/share
25 # Only include the files needed for runtime in the derivation
26 mv $out/share/php/davis/{migrations,public,src,config,bin,templates,tests,translations,vendor,symfony.lock,composer.json,composer.lock} $out
27 # Save the upstream .env file for reference, but rename it so it is not loaded
28 mv $out/share/php/davis/.env $out/env-upstream
29 rm -rf "$out/share"
30 '';
31
32 passthru = {
33 php = php;
34 tests = {
35 inherit (nixosTests) davis;
36 };
37 };
38
39 meta = {
40 changelog = "https://github.com/tchapi/davis/releases/tag/v${finalAttrs.version}";
41 homepage = "https://github.com/tchapi/davis";
42 description = "Simple CardDav and CalDav server inspired by Baïkal";
43 license = lib.licenses.mit;
44 maintainers = with lib.maintainers; [ ramblurr ];
45 };
46})