Loading pkgs/by-name/op/opensnitch-ui/package.nix +17 −26 Original line number Diff line number Diff line { python311Packages, fetchFromGitHub, nix-update-script, python3Packages, qt5, lib, opensnitch, }: python311Packages.buildPythonApplication rec { python3Packages.buildPythonApplication { pname = "opensnitch-ui"; version = "1.6.9"; src = fetchFromGitHub { owner = "evilsocket"; repo = "opensnitch"; rev = "refs/tags/v${version}"; hash = "sha256-c+VAlm32/NXvUr5i0AY/zuTrFIQLtPxNNeSiQTMoJAY="; }; inherit (opensnitch) src version; sourceRoot = "${opensnitch.src.name}/ui"; postPatch = '' substituteInPlace ui/opensnitch/utils/__init__.py \ --replace /usr/lib/python3/dist-packages/data ${python311Packages.pyasn}/${python311Packages.python.sitePackages}/pyasn/data substituteInPlace opensnitch/utils/__init__.py \ --replace-fail /usr/lib/python3/dist-packages/data ${python3Packages.pyasn}/${python3Packages.python.sitePackages}/pyasn/data ''; nativeBuildInputs = [ python311Packages.pyqt5 python3Packages.pyqt5 qt5.wrapQtAppsHook ]; Loading @@ -31,7 +25,7 @@ python311Packages.buildPythonApplication rec { qt5.qtwayland ]; propagatedBuildInputs = with python311Packages; [ dependencies = with python3Packages; [ grpcio-tools notify2 packaging Loading @@ -50,16 +44,12 @@ python311Packages.buildPythonApplication rec { sed -i 's/^import ui_pb2/from . import ui_pb2/' opensnitch/ui_pb2* ''; preConfigure = '' cd ui ''; preCheck = '' export PYTHONPATH=opensnitch:$PYTHONPATH ''; postInstall = '' mv $out/${python311Packages.python.sitePackages}/usr/* $out/ mv $out/${python3Packages.python.sitePackages}/usr/* $out/ ''; dontWrapQtApps = true; Loading @@ -68,14 +58,15 @@ python311Packages.buildPythonApplication rec { # All tests are sandbox-incompatible and disabled for now doCheck = false; passthru.updateScript = nix-update-script { }; meta = with lib; { meta = { description = "Application firewall"; mainProgram = "opensnitch-ui"; homepage = "https://github.com/evilsocket/opensnitch/wiki"; license = licenses.gpl3Only; maintainers = with maintainers; [ onny ]; platforms = platforms.linux; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ onny grimmauld ]; platforms = lib.platforms.linux; }; } pkgs/by-name/op/opensnitch/package.nix +32 −16 Original line number Diff line number Diff line Loading @@ -13,9 +13,12 @@ testers, opensnitch, nixosTests, opensnitch-ui, nix-update-script, }: let # Override protoc-gen-go-grpc to use the compatible version # Should be droppable on opensnitch 1.7.0 protoc-gen-go-grpc' = protoc-gen-go-grpc.overrideAttrs (oldAttrs: rec { version = "1.3.0"; Loading @@ -29,20 +32,20 @@ let vendorHash = "sha256-y+/hjYUTFZuq55YAZ5M4T1cwIR+XFQBmWVE+Cg1Y7PI="; }); in buildGoModule rec { buildGoModule (finalAttrs: { pname = "opensnitch"; version = "1.6.9"; src = fetchFromGitHub { owner = "evilsocket"; repo = "opensnitch"; tag = "v${version}"; tag = "v${finalAttrs.version}"; hash = "sha256-c+VAlm32/NXvUr5i0AY/zuTrFIQLtPxNNeSiQTMoJAY="; }; postPatch = '' # Allow configuring Version at build time substituteInPlace daemon/core/version.go --replace "const " "var " substituteInPlace daemon/core/version.go --replace-fail "const " "var " ''; modRoot = "daemon"; Loading Loading @@ -71,18 +74,18 @@ buildGoModule rec { mkdir -p $out/etc/opensnitchd $out/lib/systemd/system cp system-fw.json $out/etc/opensnitchd/ substitute default-config.json $out/etc/opensnitchd/default-config.json \ --replace "/var/log/opensnitchd.log" "/dev/stdout" --replace-fail "/var/log/opensnitchd.log" "/dev/stdout" # Do not mkdir rules path sed -i '8d' opensnitchd.service # Fixup hardcoded paths substitute opensnitchd.service $out/lib/systemd/system/opensnitchd.service \ --replace "/usr/local/bin/opensnitchd" "$out/bin/opensnitchd" --replace-fail "/usr/local/bin/opensnitchd" "$out/bin/opensnitchd" ''; ldflags = [ "-s" "-w" "-X github.com/evilsocket/opensnitch/daemon/core.Version=${version}" "-X github.com/evilsocket/opensnitch/daemon/core.Version=${finalAttrs.version}" ]; postInstall = '' Loading @@ -90,20 +93,33 @@ buildGoModule rec { --prefix PATH : ${lib.makeBinPath [ iptables ]} ''; passthru.tests = { passthru = { tests = { inherit (nixosTests) opensnitch; inherit opensnitch-ui; version = testers.testVersion { package = opensnitch; command = "opensnitchd -version"; }; }; meta = with lib; { updater = nix-update-script { extraArgs = [ "--version-regex" "^v([0-9.]+)$" ]; }; }; meta = { description = "Application firewall"; mainProgram = "opensnitchd"; homepage = "https://github.com/evilsocket/opensnitch/wiki"; license = licenses.gpl3Only; maintainers = with maintainers; [ onny ]; platforms = platforms.linux; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ onny grimmauld ]; platforms = lib.platforms.linux; }; } }) Loading
pkgs/by-name/op/opensnitch-ui/package.nix +17 −26 Original line number Diff line number Diff line { python311Packages, fetchFromGitHub, nix-update-script, python3Packages, qt5, lib, opensnitch, }: python311Packages.buildPythonApplication rec { python3Packages.buildPythonApplication { pname = "opensnitch-ui"; version = "1.6.9"; src = fetchFromGitHub { owner = "evilsocket"; repo = "opensnitch"; rev = "refs/tags/v${version}"; hash = "sha256-c+VAlm32/NXvUr5i0AY/zuTrFIQLtPxNNeSiQTMoJAY="; }; inherit (opensnitch) src version; sourceRoot = "${opensnitch.src.name}/ui"; postPatch = '' substituteInPlace ui/opensnitch/utils/__init__.py \ --replace /usr/lib/python3/dist-packages/data ${python311Packages.pyasn}/${python311Packages.python.sitePackages}/pyasn/data substituteInPlace opensnitch/utils/__init__.py \ --replace-fail /usr/lib/python3/dist-packages/data ${python3Packages.pyasn}/${python3Packages.python.sitePackages}/pyasn/data ''; nativeBuildInputs = [ python311Packages.pyqt5 python3Packages.pyqt5 qt5.wrapQtAppsHook ]; Loading @@ -31,7 +25,7 @@ python311Packages.buildPythonApplication rec { qt5.qtwayland ]; propagatedBuildInputs = with python311Packages; [ dependencies = with python3Packages; [ grpcio-tools notify2 packaging Loading @@ -50,16 +44,12 @@ python311Packages.buildPythonApplication rec { sed -i 's/^import ui_pb2/from . import ui_pb2/' opensnitch/ui_pb2* ''; preConfigure = '' cd ui ''; preCheck = '' export PYTHONPATH=opensnitch:$PYTHONPATH ''; postInstall = '' mv $out/${python311Packages.python.sitePackages}/usr/* $out/ mv $out/${python3Packages.python.sitePackages}/usr/* $out/ ''; dontWrapQtApps = true; Loading @@ -68,14 +58,15 @@ python311Packages.buildPythonApplication rec { # All tests are sandbox-incompatible and disabled for now doCheck = false; passthru.updateScript = nix-update-script { }; meta = with lib; { meta = { description = "Application firewall"; mainProgram = "opensnitch-ui"; homepage = "https://github.com/evilsocket/opensnitch/wiki"; license = licenses.gpl3Only; maintainers = with maintainers; [ onny ]; platforms = platforms.linux; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ onny grimmauld ]; platforms = lib.platforms.linux; }; }
pkgs/by-name/op/opensnitch/package.nix +32 −16 Original line number Diff line number Diff line Loading @@ -13,9 +13,12 @@ testers, opensnitch, nixosTests, opensnitch-ui, nix-update-script, }: let # Override protoc-gen-go-grpc to use the compatible version # Should be droppable on opensnitch 1.7.0 protoc-gen-go-grpc' = protoc-gen-go-grpc.overrideAttrs (oldAttrs: rec { version = "1.3.0"; Loading @@ -29,20 +32,20 @@ let vendorHash = "sha256-y+/hjYUTFZuq55YAZ5M4T1cwIR+XFQBmWVE+Cg1Y7PI="; }); in buildGoModule rec { buildGoModule (finalAttrs: { pname = "opensnitch"; version = "1.6.9"; src = fetchFromGitHub { owner = "evilsocket"; repo = "opensnitch"; tag = "v${version}"; tag = "v${finalAttrs.version}"; hash = "sha256-c+VAlm32/NXvUr5i0AY/zuTrFIQLtPxNNeSiQTMoJAY="; }; postPatch = '' # Allow configuring Version at build time substituteInPlace daemon/core/version.go --replace "const " "var " substituteInPlace daemon/core/version.go --replace-fail "const " "var " ''; modRoot = "daemon"; Loading Loading @@ -71,18 +74,18 @@ buildGoModule rec { mkdir -p $out/etc/opensnitchd $out/lib/systemd/system cp system-fw.json $out/etc/opensnitchd/ substitute default-config.json $out/etc/opensnitchd/default-config.json \ --replace "/var/log/opensnitchd.log" "/dev/stdout" --replace-fail "/var/log/opensnitchd.log" "/dev/stdout" # Do not mkdir rules path sed -i '8d' opensnitchd.service # Fixup hardcoded paths substitute opensnitchd.service $out/lib/systemd/system/opensnitchd.service \ --replace "/usr/local/bin/opensnitchd" "$out/bin/opensnitchd" --replace-fail "/usr/local/bin/opensnitchd" "$out/bin/opensnitchd" ''; ldflags = [ "-s" "-w" "-X github.com/evilsocket/opensnitch/daemon/core.Version=${version}" "-X github.com/evilsocket/opensnitch/daemon/core.Version=${finalAttrs.version}" ]; postInstall = '' Loading @@ -90,20 +93,33 @@ buildGoModule rec { --prefix PATH : ${lib.makeBinPath [ iptables ]} ''; passthru.tests = { passthru = { tests = { inherit (nixosTests) opensnitch; inherit opensnitch-ui; version = testers.testVersion { package = opensnitch; command = "opensnitchd -version"; }; }; meta = with lib; { updater = nix-update-script { extraArgs = [ "--version-regex" "^v([0-9.]+)$" ]; }; }; meta = { description = "Application firewall"; mainProgram = "opensnitchd"; homepage = "https://github.com/evilsocket/opensnitch/wiki"; license = licenses.gpl3Only; maintainers = with maintainers; [ onny ]; platforms = platforms.linux; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ onny grimmauld ]; platforms = lib.platforms.linux; }; } })