home_packages: add wrap.sh script

This commit is contained in:
Asmir A 2024-04-01 11:31:11 +02:00
parent 3cabb1a700
commit 4ba5fdb24e
Signed by: asmir
GPG Key ID: 020C42B7A9ABA3E2

View File

@ -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