Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

88 lines
2.1 KiB
Nix

{
lib,
stdenv,
fetchurl,
bash,
coreutils,
python3,
libcap_ng,
policycoreutils,
selinux-python,
dbus,
xorgserver,
openbox,
xmodmap,
libselinux,
}:
# this is python3 only as it depends on selinux-python
with python3.pkgs;
stdenv.mkDerivation rec {
pname = "selinux-sandbox";
version = "3.3";
inherit (policycoreutils) se_url;
src = fetchurl {
url = "${se_url}/${version}/selinux-sandbox-${version}.tar.gz";
sha256 = "0rw8pxfqhl6ww4w31fbf4hi3zilh1n3b1rfjm7ra76mm78wfyylj";
};
nativeBuildInputs = [ wrapPython ];
buildInputs = [
bash
coreutils
libcap_ng
policycoreutils
python3
xorgserver
openbox
xmodmap
dbus
libselinux
];
propagatedBuildInputs = [
pygobject3
selinux-python
];
postPatch = ''
# Fix setuid install
substituteInPlace Makefile --replace "-m 4755" "-m 755"
substituteInPlace sandboxX.sh \
--replace "#!/bin/sh" "#!${bash}/bin/sh" \
--replace "/usr/share/sandbox/start" "${placeholder "out"}/share/sandbox/start" \
--replace "/usr/bin/cut" "${coreutils}/bin/cut" \
--replace "/usr/bin/Xephyr" "${xorgserver}/bin/Xepyhr" \
--replace "secon" "${policycoreutils}/bin/secon"
substituteInPlace sandbox \
--replace "/usr/sbin/seunshare" "$out/bin/seunshare" \
--replace "/usr/share/sandbox" "$out/share/sandbox" \
--replace "/usr/share/locale" "${policycoreutils}/share/locale" \
--replace "/usr/bin/openbox" "${openbox}/bin/openbox" \
--replace "#!/bin/sh" "#!${bash}/bin/sh" \
--replace "dbus-" "${dbus}/bin/dbus-" \
--replace "/usr/bin/xmodmap" "${xmodmap}/bin/xmodmap" \
--replace "/usr/bin/shred" "${coreutils}/bin/shred" \
--replace "/usr/bin/test" "${coreutils}/bin/test" \
'';
makeFlags = [
"PREFIX=$(out)"
"SYSCONFDIR=$(out)/etc/sysconfig"
];
postFixup = ''
wrapPythonPrograms
'';
meta = with lib; {
description = "SELinux sandbox utility";
license = licenses.gpl2Only;
homepage = "https://selinuxproject.org";
platforms = platforms.linux;
maintainers = with lib.maintainers; [ RossComputerGuy ];
};
}