about summary refs log tree commit diff
path: root/pkgs/tools/networking/qcal/default.nix
blob: 31e80039495497884896fd781f9a83acad65a411 (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
{ lib
, buildGoModule
, fetchFromSourcehut
}:

buildGoModule rec {
  pname = "qcal";
  version = "0.9.1";
  src = fetchFromSourcehut {
    owner = "~psic4t";
    repo = "qcal";
    rev = version;
    hash = "sha256-Rj806cKCFxWB8X4EiKvyZ5/xACw+VVbo9hv8AJiB0S4=";
  };
  vendorHash = "sha256-ntpSj3Ze7n1sMIMojaESi4tQtx+mrA0aiv3+MQetjZI=";

  # 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/qcal/config-sample.json "
  '';

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

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