-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: dvn <git@dvn.me>
- Loading branch information
Showing
5 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,6 @@ sign.keystore | |
|
||
# state files | ||
*.state | ||
|
||
# Nix build symlinks | ||
result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ pkgs ? import <nixpkgs> { } }: pkgs.callPackage (import ./katzen.nix { }) { } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
description = "Katzenpost development flake"; | ||
|
||
outputs = { self, nixpkgs }: | ||
let inherit (nixpkgs) lib; | ||
in { | ||
|
||
overlays.default = final: prev: { | ||
katzen = final.callPackage (import ./katzen.nix { | ||
src = self; | ||
version = "unstable-${self.lastModifiedDate}"; | ||
}) { }; | ||
}; | ||
|
||
legacyPackages = lib.attrsets.mapAttrs (system: pkgs: | ||
pkgs.appendOverlays (builtins.attrValues self.overlays)) { | ||
inherit (nixpkgs.legacyPackages) | ||
i686-linux x86_64-linux aarch64-linux; | ||
}; | ||
|
||
packages = lib.attrsets.mapAttrs (system: pkgs: rec { | ||
inherit (pkgs) katzen; | ||
default = katzen; | ||
}) self.legacyPackages; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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-4/AteWLY9biTspcXcyzK1gNwzkQfFoNq89yJheswf4s="; | ||
# 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.agpl3; | ||
maintainers = with maintainers; [ ehmry ]; | ||
}; | ||
} |