sshuttle, cleanup

This commit is contained in:
2024-07-31 01:57:47 +02:00
parent fa78f6c4eb
commit 0b434f509b
9 changed files with 37 additions and 12 deletions

View File

@@ -32,6 +32,11 @@
#nix-shell -p atom --run "atom $(printf "%q " "$@") --no-sandbox"
nix run nixpkgs#atom -- --disable-gpu --in-process-gpu --no-sandbox "$@"
}
function vpn {
ip="$(dig +short -x a $1 | tail -n 1)"
( set -x; sshuttle 0.0.0.0/0 --disable-ipv6 --dns -r "$1" -x $ip -x 127.0.0.1 -x 172.0.0.0/8 )
}
'';
home.packages = with pkgs; [
@@ -76,12 +81,13 @@
cachix
#nix-template
nix-output-monitor
nixpkgs-review
unstable.nixpkgs-review
unstable.nixpkgs-hammering
unstable.nix-update
unstable.nix-init
unstable.deadnix
unstable.statix
(pkgs.nixfmt-rfc-style or unstable.nixfmt-rfc-style or null)
nurl
manix
#comma # collides with nix-index-database

View File

@@ -7,5 +7,6 @@
./profiles/mpv.nix
./profiles/desktop.nix
./profiles/salert.nix
./profiles/sshuttle.nix
];
}

View File

@@ -90,7 +90,7 @@
curl
wget
sshuttle
wakeonlan
#tldr
entr

View File

@@ -5,9 +5,6 @@
if test -f ~/.ssh/config; then
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" ssh
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" rssh
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" vpn
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" lvpn
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" dvpn
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" scp
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" remote-init
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" remote-add

View File

@@ -0,0 +1,21 @@
# https://nix-community.github.io/home-manager/options.html
{ pkgs, config, ... }:
{
home.packages = with pkgs; [
sshuttle
];
programs.bash.initExtra = ''
function vpn (
ip="$(dig +short -x a $1 | tail -n 1)"
set -x
sshuttle 0.0.0.0/0 --disable-ipv6 --dns -r "$1" -x $ip -x 127.0.0.1 -x 172.0.0.0/8
)
if test -f ~/.ssh/config; then
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" vpn
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" lvpn
complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" dvpn
fi
'';
}