Revert "apparmor: fix and improve the service"

This reverts commit fb6d63f3fd.

I really hope this finally fixes #99236: evaluation on Hydra.
This time I really did check basically the same commit on Hydra:
https://hydra.nixos.org/eval/1618011

Right now I don't have energy to find what exactly is wrong in the
commit, and it doesn't seem important in comparison to nixos-unstable
channel being stuck on a commit over one week old.
This commit is contained in:
Vladimír Čunát
2020-10-07 12:22:18 +02:00
parent 3b0886c9af
commit 420f89ceb2
20 changed files with 164 additions and 791 deletions
@@ -1,7 +1,6 @@
{ stdenv, fetchFromGitHub
, meson, ninja, pkgconfig, gettext, libxslt, docbook_xsl_ns
, libcap, systemd, libidn2
, apparmorRulesFromClosure
}:
with stdenv.lib;
@@ -23,8 +22,6 @@ in stdenv.mkDerivation rec {
sha256 = "1jhbcz75a4ij1myyyi110ma1d8d5hpm3scz9pyw7js6qym50xvh4";
};
outputs = ["out" "apparmor"];
mesonFlags = [
"-DBUILD_RARPD=true"
"-DBUILD_TRACEROUTE6=true"
@@ -38,25 +35,6 @@ in stdenv.mkDerivation rec {
nativeBuildInputs = [ meson ninja pkgconfig gettext libxslt.bin docbook_xsl_ns ];
buildInputs = [ libcap systemd ]
++ optional (!stdenv.hostPlatform.isMusl) libidn2;
postInstall = ''
install -D /dev/stdin $apparmor/bin.ping <<EOF
include <tunables/global>
$out/bin/ping {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice>
include "${apparmorRulesFromClosure {}
([libcap] ++ optional (!stdenv.hostPlatform.isMusl) libidn2)}"
include <local/bin.ping>
capability net_raw,
network inet raw,
network inet6 raw,
mr $out/bin/ping,
r $out/share/locale/**,
r @{PROC}/@{pid}/environ,
}
EOF
'';
meta = {
description = "A set of small useful utilities for Linux networking";