fix: darwin, feat: work vm auto connect
This commit is contained in:
@@ -24,6 +24,7 @@ in
|
|||||||
terminal = {
|
terminal = {
|
||||||
bash = {
|
bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
customProfile = builtins.readFile ./vm-init.sh;
|
||||||
customFastFetchLogo = ./prophet.txt;
|
customFastFetchLogo = ./prophet.txt;
|
||||||
};
|
};
|
||||||
aws = enabled;
|
aws = enabled;
|
||||||
@@ -48,7 +49,7 @@ in
|
|||||||
programs.jq = enabled;
|
programs.jq = enabled;
|
||||||
programs.pandoc = enabled;
|
programs.pandoc = enabled;
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
colima
|
# colima
|
||||||
docker
|
docker
|
||||||
keycastr
|
keycastr
|
||||||
_1password-cli
|
_1password-cli
|
||||||
|
|||||||
39
homes/aarch64-darwin/evanreichard@mac-va-mbp-work/vm-init.sh
Executable file
39
homes/aarch64-darwin/evanreichard@mac-va-mbp-work/vm-init.sh
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
echo "
|
||||||
|
██████╗██████╗ ██████╗ ██╗ ██╗██████╗ ███████╗████████╗██████╗ ██╗██╗ ██╗███████╗
|
||||||
|
██╔════╝██╔══██╗██╔═══██╗██║ ██║██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██║██║ ██╔╝██╔════╝
|
||||||
|
██║ ██████╔╝██║ ██║██║ █╗ ██║██║ ██║███████╗ ██║ ██████╔╝██║█████╔╝ █████╗
|
||||||
|
██║ ██╔══██╗██║ ██║██║███╗██║██║ ██║╚════██║ ██║ ██╔══██╗██║██╔═██╗ ██╔══╝
|
||||||
|
╚██████╗██║ ██║╚██████╔╝╚███╔███╔╝██████╔╝███████║ ██║ ██║ ██║██║██║ ██╗███████╗
|
||||||
|
╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚══════╝
|
||||||
|
EVASION SYSTEM - Because IT can't handle Nix
|
||||||
|
"
|
||||||
|
|
||||||
|
# Start VM
|
||||||
|
utmctl=/Applications/UTM.app/Contents/MacOS/utmctl
|
||||||
|
vm="lin-va-mbp-work-vm"
|
||||||
|
|
||||||
|
if ! "$utmctl" status "$vm" | grep -q "started"; then
|
||||||
|
echo " [*] CrowdStrike Evasion VM Starting..."
|
||||||
|
"$utmctl" start "$vm"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Wait for VM & Start Tunnel
|
||||||
|
if ! pgrep -f "ssh -N -D 1080 adios-cs" > /dev/null; then
|
||||||
|
echo " [*] VM Starting..."
|
||||||
|
until nc -z -w 2 192.168.64.3 22 &> /dev/null; do
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
echo " [✓] VM Started"
|
||||||
|
|
||||||
|
echo " [*] VM SOCKS Proxy Starting..."
|
||||||
|
ssh -N -D 1080 adios-cs &> /dev/null &
|
||||||
|
disown
|
||||||
|
echo " [✓] VM SOCKS Proxy Started"
|
||||||
|
else
|
||||||
|
echo " [✓] VM SOCKS Proxy Already Running"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e " [*] Connecting..."
|
||||||
|
|
||||||
|
# Connect to VM
|
||||||
|
mosh --ssh="ssh -q" adios-cs -- tmux new-session -A -s main
|
||||||
@@ -14,6 +14,7 @@ in
|
|||||||
{
|
{
|
||||||
options.${namespace}.programs.terminal.bash = with lib.types; {
|
options.${namespace}.programs.terminal.bash = with lib.types; {
|
||||||
enable = mkEnableOption "bash";
|
enable = mkEnableOption "bash";
|
||||||
|
customProfile = mkOpt str "" "custom profile";
|
||||||
customFastFetchLogo = mkOpt (nullOr path) null "custom fast fetch logo path";
|
customFastFetchLogo = mkOpt (nullOr path) null "custom fast fetch logo path";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -49,7 +50,8 @@ in
|
|||||||
[[ -f ~/.bash_custom ]] && . ~/.bash_custom
|
[[ -f ~/.bash_custom ]] && . ~/.bash_custom
|
||||||
|
|
||||||
source ${./config/hey-intern.sh}
|
source ${./config/hey-intern.sh}
|
||||||
'';
|
''
|
||||||
|
+ cfg.customProfile;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.powerline-go = {
|
programs.powerline-go = {
|
||||||
|
|||||||
12
overlays/fish/default.nix
Normal file
12
overlays/fish/default.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Workaround for aarch64-darwin codesigning bug (nixpkgs#208951 / #507531):
|
||||||
|
# fish binaries from the binary cache occasionally have invalid ad-hoc
|
||||||
|
# signatures on Apple Silicon. Forcing a local rebuild ensures codesigning
|
||||||
|
# is applied on this machine with a valid signature.
|
||||||
|
{ inputs, ... }:
|
||||||
|
final: prev: {
|
||||||
|
fish = prev.fish.overrideAttrs (_old: {
|
||||||
|
# Bust the cache key so fish is always built locally rather than
|
||||||
|
# substituted from the binary cache where the signature may be stale.
|
||||||
|
NIX_FORCE_LOCAL_REBUILD = "darwin-codesign-fix";
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user