Compare commits

...

3 Commits

Author SHA1 Message Date
e5412509cb
flake: update 2024-04-01 12:27:34 +02:00
4026db64a9
home/zsh: add RPS1 info for bubblewrap 2024-04-01 11:31:40 +02:00
4ba5fdb24e
home_packages: add wrap.sh script 2024-04-01 11:31:11 +02:00
3 changed files with 30 additions and 9 deletions

18
flake.lock generated
View File

@ -162,11 +162,11 @@
]
},
"locked": {
"lastModified": 1711625603,
"narHash": "sha256-W+9dfqA9bqUIBV5u7jaIARAzMe3kTq/Hp2SpSVXKRQw=",
"lastModified": 1711868868,
"narHash": "sha256-QpZanlbVu6Gb2K96u3vgu0F2BvZD74+fOsIFWcYEXoY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c0ef0dab55611c676ad7539bf4e41b3ec6fa87d2",
"rev": "30f2ec39519f4f5a8a96af808c439e730c15aeab",
"type": "github"
},
"original": {
@ -232,11 +232,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1711233294,
"narHash": "sha256-eEu5y4J145BYDw9o/YEmeJyqh8blgnZwuz9k234zuWc=",
"lastModified": 1711819797,
"narHash": "sha256-tNeB6emxj74Y6ctwmsjtMlzUMn458sBmwnD35U5KIM4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ac6bdf6181666ebb4f90dd20f31e2fa66ede6b68",
"rev": "2b4e3ca0091049c6fbb4908c66b05b77eaef9f0c",
"type": "github"
},
"original": {
@ -356,11 +356,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1711249319,
"narHash": "sha256-N+Pp3/8H+rd7cO71VNV/ovV/Kwt+XNeUHNhsmyTabdM=",
"lastModified": 1711855048,
"narHash": "sha256-HxegAPnQJSC4cbEbF4Iq3YTlFHZKLiNTk8147EbLdGg=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "405987a66cce9a4a82f321f11b205982a7127c88",
"rev": "99b1e37f9fc0960d064a7862eb7adfb92e64fa10",
"type": "github"
},
"original": {

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

View File

@ -103,6 +103,10 @@
TMUX_EXE="${pkgs.tmux}/bin/tmux"
systemd-run --scope --user $TMUX_EXE attach-session -t $USER || systemd-run --scope --user $TMUX_EXE new-session -s $USER
fi
if [[ -n "$BUBBLEWRAP_DIR" ]]; then
RPS1="{{$BUBBLEWRAP_DIR}}"
fi
'';
};
}