mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 06:31:02 +00:00
4b1cf5afb8
Changes: * doesn't handle root user separately * doesn't chdir("/") which makes using it seamless * only bind mounts, doesn't symlink (i.e. files) Incidentally, fixes #33106. It's about two times shorter than the previous version, and much easier to read/follow through. It uses GLib quite heavily, along with RAII (available in GCC/Clang).
20 lines
457 B
Nix
20 lines
457 B
Nix
{ stdenv, pkgconfig, glib }:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "chrootenv";
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
buildInputs = [ glib ];
|
|
|
|
buildCommand = ''
|
|
cc ${./chrootenv.c} $(pkg-config --cflags --libs glib-2.0) -o $out
|
|
'';
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "Setup mount/user namespace for FHS emulation";
|
|
license = licenses.free;
|
|
maintainers = with maintainers; [ yegortimoshenko ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|