repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
setup.test.zshShell12 lines651 Braw download
# ── setup.sh : reversible ~/.zshenv cutover (sandbox HOME, never touches live) ─
() {
  local sand; sand="$(mktemp -d)"
  print 'echo OLD' > "$sand/.zshrc"
  HOME="$sand" bash "$DOTFILES/scripts/setup.sh" --link >/dev/null 2>&1
  assert_contains "zshenv exports ZDOTDIR" "$(<"$sand/.zshenv")" 'export ZDOTDIR='
  assert_ok "old .zshrc backed up" bash -c "ls $sand/.dotfiles-backup-*/.zshrc >/dev/null 2>&1"
  assert_eq "old .zshrc untouched" "echo OLD" "$(<"$sand/.zshrc")"
  HOME="$sand" bash "$DOTFILES/scripts/setup.sh" --revert >/dev/null 2>&1
  assert_ok "revert removes zshenv block" bash -c "[[ ! -f $sand/.zshenv ]]"
  rm -rf "$sand"
}