-
Notifications
You must be signed in to change notification settings - Fork 1
/
katzen.nix
61 lines (52 loc) · 1.74 KB
/
katzen.nix
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ src ? ./., version ? "unstable" }:
{ lib, buildGoModule, fetchFromGitHub, copyDesktopItems, makeDesktopItem
, pkg-config, librsvg, libGL, libX11, libXfixes, libxkbcommon, vulkan-headers
, wayland, xorg }:
buildGoModule rec {
pname = "katzen";
inherit src version;
vendorHash = "sha256-bUap2v9fXlrVWbzTe2BRQ1T7K3OhfoMKo6iC7+qliF0=";
# This hash is may drift from the actual vendoring and break the build,
# see https://nixos.org/manual/nixpkgs/unstable/#ssec-language-go.
nativeBuildInputs = [ pkg-config copyDesktopItems librsvg ];
buildInputs = [
libGL
libX11
libXfixes
libxkbcommon
vulkan-headers
wayland
xorg.libXcursor
];
CGO_CFLAGS_ALLOW = "-DPARAMS=sphincs-shake-256f";
postInstall = ''
## Both of the configs are embedded in the binary; "without_tor" being the default.
## Another config may be specified by using '-f' flag.
install -D -t $out/share/ ./default_config_without_tor.toml
install -D -t $out/share/ ./default_config_with_tor.toml
install -D \
./assets/katzenpost_logo.svg \
$out/share/icons/hicolor/scalable/apps/${pname}.svg
mkdir -p $out/share/icons/hicolor/48x48/apps
rsvg-convert \
--output $out/share/icons/hicolor/48x48/apps/${pname}.png \
--width 48 --height 48 \
./assets/katzenpost_logo.svg
'';
desktopItems = [
(makeDesktopItem {
name = pname;
exec = pname;
icon = pname;
desktopName = "Katzen";
genericName = meta.description;
categories = [ "Chat" "Network" ];
})
];
meta = with lib; {
description = "Traffic analysis resistant messaging";
homepage = "https://katzenpost.mixnetworks.org/";
license = licenses.agpl3Only;
maintainers = with maintainers; [ ehmry ];
};
}