home_packages: add wrap.sh script
This commit is contained in:
parent
3cabb1a700
commit
4ba5fdb24e
@ -19,6 +19,22 @@
|
||||
PROXY_PORT="1337"
|
||||
${pkgs.openssh}/bin/ssh -D "$PROXY_PORT" -q -N "$@"
|
||||
'';
|
||||
wrap_sh = let
|
||||
bubblewrap = pkgs.callPackage ../packages/bubblewrap/default.nix {};
|
||||
in
|
||||
pkgs.writeShellScriptBin "wrap.sh" ''
|
||||
if ${pkgs.coreutils-full}/bin/test $# -ne 1; then
|
||||
echo "Usage: $0 <directory>"
|
||||
exit
|
||||
fi
|
||||
FULL_PATH=$(${pkgs.coreutils-full}/bin/realpath "$1")
|
||||
BUBBLEWRAP_DIR="$1" ${bubblewrap}/bin/bwrap \
|
||||
--bind / / \
|
||||
--dev /dev \
|
||||
--overlay-src "$FULL_PATH" \
|
||||
--tmp-overlay "$FULL_PATH" \
|
||||
"$SHELL"
|
||||
'';
|
||||
in {
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
@ -116,6 +132,7 @@ in {
|
||||
chromium_discord
|
||||
chromium_teams
|
||||
ssh_proxy
|
||||
wrap_sh
|
||||
]
|
||||
++ [
|
||||
inputs.swaysw.packages.${system}.swaysw
|
||||
|
Loading…
Reference in New Issue
Block a user