Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758{inputs, ...}: { flake-file.inputs = { wrapper-modules.url = "github:BirdeeHub/nix-wrapper-modules"; }; imports = [ inputs.wrapper-modules.flakeModules.wrappers ]; perSystem = {pkgs, ...}: { wrappers.control_type = "build"; packages.wrap = pkgs.callPackage ({ writeShellApplication, bubblewrap, }: writeShellApplication { name = "wrap"; runtimeInputs = [bubblewrap];
text = '' declare -a root_args declare -a home_args
# Mount all available entries in '/', # ignoring a few that we specially handle. for mnt in "/"*; do if [[ ! "/dev /home /nix" =~ $mnt ]]; then root_args+=(--bind "$mnt" "$mnt") fi done
# Mount all entries from paths into '$HOME'. # TODO: this can get dangerously long and # cause bwrap to fail. # see: https://github.com/containers/bubblewrap/issues/413 for mnt in "$HOME"/{.*,*}; do home_args+=(--bind "$mnt" "$mnt") done
cmd=( bwrap --die-with-parent
--tmpfs "$HOME"
--dev-bind /dev /dev --bind /nix /nix --remount-ro /nix/store
"''${root_args[@]}" "''${home_args[@]}" "$@" )
exec "''${cmd[@]}" ''; }) {}; };}