sshuttle, cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
./profiles/mpv.nix
|
||||
./profiles/desktop.nix
|
||||
./profiles/salert.nix
|
||||
./profiles/sshuttle.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
curl
|
||||
wget
|
||||
|
||||
sshuttle
|
||||
wakeonlan
|
||||
|
||||
#tldr
|
||||
entr
|
||||
|
||||
@@ -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
|
||||
|
||||
21
users/pbsds/home/profiles/sshuttle.nix
Normal file
21
users/pbsds/home/profiles/sshuttle.nix
Normal 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
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user