summary refs log tree commit diff
path: root/pkgs/tools/networking/qcard/default.nix
blob: 16ffb5d686feac24f56774aec00336bda7e1b8ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib
, buildGoModule
, fetchFromSourcehut
}:

buildGoModule rec {
  pname = "qcard";
  version = "0.7.1";

  src = fetchFromSourcehut {
    owner = "~psic4t";
    repo = "qcard";
    rev = version;
    hash = "sha256-OwmJSeAOZTX7jMhoLHSIJa0jR8zCadISQF/PqFqltRY=";
  };

  vendorHash = null;

  # Replace "config-sample.json" in error message with the absolute path
  # to that config file in the nix store
  preBuild = ''
    substituteInPlace helpers.go \
      --replace " config-sample.json " " $out/share/qcard/config-sample.json "
  '';

  postInstall = ''
    mkdir -p $out/share/qcard
    cp config-sample.json $out/share/qcard/
  '';

  meta = {
    description = "CLI addressbook application for CardDAV servers written in Go";
    homepage = "https://git.sr.ht/~psic4t/qcard";
    license = lib.licenses.gpl3Plus;
    mainProgram = "qcard";
    maintainers = with lib.maintainers; [ antonmosich ];
  };
}