about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/onioncircuits/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/onioncircuits/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/onioncircuits/default.nix58
1 files changed, 58 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/onioncircuits/default.nix b/nixpkgs/pkgs/tools/security/onioncircuits/default.nix
new file mode 100644
index 000000000000..c1468becc262
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/onioncircuits/default.nix
@@ -0,0 +1,58 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, fetchpatch
+, gobject-introspection
+, intltool
+, python3
+, wrapGAppsHook
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "onioncircuits";
+  version = "0.7";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.tails.boum.org";
+    owner = "tails";
+    repo = "onioncircuits";
+    rev = version;
+    sha256 = "sha256-O4tSbKBTmve4u8bXVg128RLyuxvTbU224JV8tQ+aDAQ=";
+  };
+
+  nativeBuildInputs = [
+    gobject-introspection
+    intltool
+    wrapGAppsHook
+    python3.pkgs.distutils-extra
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    pygobject3
+    stem
+  ];
+
+  patches = [
+    # Fix https://gitlab.tails.boum.org/tails/onioncircuits/-/merge_requests/4
+    (fetchpatch {
+      name = "fix-setuptool-package-discovery.patch";
+      url = "https://gitlab.tails.boum.org/tails/onioncircuits/-/commit/4c620c77f36f540fa27041fcbdeaf05c9f57826c.patch";
+      sha256 = "sha256-WXqyDa2meRMMHkHLO5Xl7x43KUGtlsai+eOVzUGUPpo=";
+    })
+  ];
+
+  postInstall = ''
+    mkdir -p $out/etc/apparmor.d
+
+    cp apparmor/usr.bin.onioncircuits $out/etc/apparmor.d
+  '';
+
+  meta = with lib; {
+    broken = stdenv.isDarwin;
+    homepage = "https://tails.boum.org";
+    description = "GTK application to display Tor circuits and streams";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ milran ];
+  };
+}
+