nixpkgs/pkgs/os-specific/linux/syscall_limiter/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

38 lines
942 B
Nix

{ lib, stdenv
, fetchFromGitHub
, libseccomp
, perl
, which
}:
stdenv.mkDerivation {
pname = "syscall_limiter";
version = "2017-01-23";
src = fetchFromGitHub {
owner = "vi";
repo = "syscall_limiter";
rev = "481c8c883f2e1260ebc83b352b63bf61a930a341";
sha256 = "0z5arj1kq1xczgrbw1b8m9kicbv3vs9bd32wvgfr4r6ndingsp5m";
};
buildInputs = [ libseccomp ];
installPhase = ''
mkdir -p $out/bin
cp -v limit_syscalls $out/bin
cp -v monitor.sh $out/bin/limit_syscalls_monitor.sh
substituteInPlace $out/bin/limit_syscalls_monitor.sh \
--replace perl ${perl}/bin/perl \
--replace which ${which}/bin/which
'';
meta = with lib; {
description = "Start Linux programs with only selected syscalls enabled";
homepage = "https://github.com/vi/syscall_limiter";
license = licenses.mit;
maintainers = with maintainers; [ obadz ];
platforms = platforms.linux;
};
}