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.3.0";
11
12 src = fetchFromGitHub {
13 owner = "tchapi";
14 repo = "davis";
15 tag = "v${finalAttrs.version}";
16 hash = "sha256-YLVfcoC8cIcCfi7R2zWXNxD4P+KIXOCL+MqFEt2Z7Tc=";
17 };
18
19 composerNoPlugins = false;
20 vendorHash = "sha256-VpINHPy2gwA5dk8OGQjmWnCpS9JVyEAUG+bptggCybk=";
21
22 postInstall = ''
23 chmod -R u+w $out/share
24 # Only include the files needed for runtime in the derivation
25 mv $out/share/php/davis/{migrations,public,src,config,bin,templates,tests,translations,vendor,symfony.lock,composer.json,composer.lock} $out
26 # Save the upstream .env file for reference, but rename it so it is not loaded
27 mv $out/share/php/davis/.env $out/env-upstream
28 rm -rf "$out/share"
29 '';
30
31 passthru = {
32 php = php;
33 tests = {
34 inherit (nixosTests) davis;
35 };
36 };
37
38 meta = {
39 changelog = "https://github.com/tchapi/davis/releases/tag/v${finalAttrs.version}";
40 homepage = "https://github.com/tchapi/davis";
41 description = "Simple CardDav and CalDav server inspired by Baïkal";
42 license = lib.licenses.mit;
43 maintainers = with lib.maintainers; [ ramblurr ];
44 };
45})