### BTCA Add Example Repositories Source: https://github.com/yzua/nixos/blob/master/guides/AI-AGENTS-GUIDE.md Examples of adding specific repositories to BTCA for querying. These are pre-added in the current setup. ```bash btca add -g https://github.com/Effect-TS/effect -n effect ``` ```bash btca add -g https://github.com/anomalyco/opencode -n opencode ``` ```bash btca add -g https://github.com/facebook/react -n react ``` ```bash btca add -g https://github.com/honojs/hono -n hono ``` ```bash btca add -g https://github.com/get-convex/convex-backend -n convex ``` -------------------------------- ### Start Android RE Emulator Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/AGENTS.md If the emulator is not running, execute this command to start it. Note that when launched via `oc*are` aliases, the emulator starts in the background. ```bash bash scripts/ai/android-re/re-avd.sh start ``` -------------------------------- ### Start Zellij with Monitoring Layout Source: https://github.com/yzua/nixos/blob/master/guides/ZELLIJ-GUIDE.md This command initiates Zellij with the 'monitoring' layout, suitable for system monitoring tasks. ```bash zellij -l monitoring ``` -------------------------------- ### Start Zellij with Default Layout Source: https://github.com/yzua/nixos/blob/master/guides/ZELLIJ-GUIDE.md Use this command to start Zellij with its default layout, which includes a single tab and pane with a status bar. ```bash zellij ``` -------------------------------- ### List Packages with ADB Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Lists all installed packages on the Android device and filters the output to find packages containing 'example'. ```bash adb shell pm list packages | grep example ``` -------------------------------- ### Clone and Setup NixOS Repository Source: https://github.com/yzua/nixos/blob/master/README.md Clone the repository and navigate to the system directory. Edit configuration files for identity and hostname registration. ```bash git clone ~/System cd ~/System ``` -------------------------------- ### Start Zellij with AI Layout Source: https://github.com/yzua/nixos/blob/master/guides/ZELLIJ-GUIDE.md Use this command to launch Zellij with the 'ai' layout, optimized for AI-assisted development tasks. ```bash zellij -l ai ``` -------------------------------- ### Start Zellij with Dev Layout Source: https://github.com/yzua/nixos/blob/master/guides/ZELLIJ-GUIDE.md This command starts Zellij using the 'dev' layout, which is pre-configured for development with specific pane arrangements for code and servers. ```bash zellij -l dev ``` -------------------------------- ### Start Frida with Spawn Mode Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Use this command to start an application in spawn mode with Frida injected. This is useful for dynamic analysis and instrumentation of applications. ```bash frida -U -f com.example.target ``` -------------------------------- ### AI Panes Multi-Agent Setup Source: https://github.com/yzua/nixos/blob/master/guides/AI-AGENTS-GUIDE.md Opens multiple AI agent panes side-by-side in Zellij for simultaneous interaction. Example: `aip cl oc gem "prompt"` opens three panes. ```bash aip cl oc gem "prompt" ``` -------------------------------- ### Install App with ADB Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Installs or updates an Android application package (.apk) onto a connected device. The `-r` flag allows reinstallation. ```bash adb install -r /path/to/app.apk ``` -------------------------------- ### Home Manager Configuration Source: https://context7.com/yzua/nixos/llms.txt Basic Home Manager setup including imports, user directory configuration, telemetry opt-outs, and GTK theme settings. ```nix # home-manager/home.nix { homeStateVersion, user, ... }: { imports = [ ./modules ./packages ]; home = { username = user; homeDirectory = "/home/${user}"; stateVersion = homeStateVersion; }; # Telemetry opt-outs (applied automatically) home.sessionVariables = { DO_NOT_TRACK = "1"; DOTNET_CLI_TELEMETRY_OPTOUT = "1"; NEXT_TELEMETRY_DISABLED = "1"; HOMEBREW_NO_ANALYTICS = "1"; }; # Dark mode for GTK apps gtk.enable = true; dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; } ``` -------------------------------- ### Manage Frida Server and Attachments Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/WORKFLOW.md Commands for starting the Frida server and attaching to processes in various modes. ```bash bash scripts/ai/android-re/re-avd.sh frida-start ``` ```bash frida-ps -U | head -10 ``` ```bash # Interactive REPL (good for exploration) frida -U -n com.example.target # One-shot script with -q (quiet, non-interactive) # NOTE: Frida 17.x does NOT have --no-pause frida -U -n com.example.target -q -e 'console.log("attached to " + Process.id)' # Load a script file frida -U -n com.example.target -l hook.js -q # Spawn mode (injects before app code runs — best for bypass hooks) frida -U -f com.example.target -l hook.js --no-pause ``` ```bash frida -U -n com.example.target --realm=emulated ``` -------------------------------- ### Execute Impeccable Commands with Scope Source: https://github.com/yzua/nixos/blob/master/guides/AI-AGENTS-GUIDE.md Examples of using Impeccable slash commands with optional scope arguments to target specific components. ```text /audit header /polish checkout-form ``` -------------------------------- ### Manage Zellij Sessions Source: https://github.com/yzua/nixos/blob/master/guides/ZELLIJ-GUIDE.md Commands for starting, attaching, listing, and terminating Zellij sessions. ```bash zellij # Start or attach to default session zellij -s myproject # Start a named session zellij attach myproject # Attach to an existing session zellij -l dev # Start with the "dev" layout zellij -l monitoring # Start with the "monitoring" layout zellij list-sessions # List all sessions zellij kill-session myproject # Kill a named session zellij kill-all-sessions # Kill all sessions ``` -------------------------------- ### Install Git Hooks Source: https://github.com/yzua/nixos/blob/master/AGENTS.md Installs repository-local Git hooks. These hooks chain after Home Manager-managed global hooks and can provide additional pre-commit or pre-push checks. ```bash just install-hooks ``` -------------------------------- ### Start Yazi Source: https://github.com/yzua/nixos/blob/master/guides/YAZI-GUIDE.md Commands to launch the Yazi file manager from the terminal. ```bash yazi # Open in current directory yazi /path/to/dir # Open in specific directory y # Shell wrapper — cd's to Yazi's directory on exit ``` -------------------------------- ### Spawn Target Process with Frida Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md Start a target application and inject Frida immediately. Use this when attaching to a running process fails or times out. ```bash # Try spawn mode (fresh start with injection) frida -U -f com.example.target -l hook.js --no-pause ``` -------------------------------- ### Retrieve BTCA Documentation Source: https://github.com/yzua/nixos/blob/master/guides/AI-AGENTS-GUIDE.md Use BTCA commands to add a GitHub repository as a resource and then query its documentation for specific information, such as setup, authentication, and breaking changes. ```bash btca add -g https://github.com// -n ``` ```bash btca ask --resource --question "Summarize setup, auth, and latest breaking changes" ``` -------------------------------- ### Manage Emulator State Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/WORKFLOW.md Commands to check emulator status, start the emulator, or monitor runtime logs. ```bash bash scripts/ai/android-re/re-avd.sh status # Or check the background boot log: tail -f ~/Downloads/android-re-tools/re-avd-start.log ``` ```bash bash scripts/ai/android-re/re-avd.sh start bash scripts/ai/android-re/re-avd.sh status ``` ```bash tail -f ~/Downloads/android-re-tools/emulator-runtime.log ``` -------------------------------- ### Inspect Package ABI Compatibility Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md Check the CPU architecture and ABI configuration of a target package and the device to troubleshoot installation failures. ```bash adb shell dumpsys package com.example.target | rg "primaryCpuAbi|secondaryCpuAbi|nativeLibraryDir|split_config" adb shell getprop ro.product.cpu.abi adb shell getprop ro.product.cpu.abilist ``` -------------------------------- ### Verify CA Certificate Installation Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md Use these commands to inspect the contents of the system and apex certificate directories to verify if custom CAs are correctly placed. ```bash adb shell 'ls -l /system/etc/security/cacerts' adb shell 'ls /apex/com.android.conscrypt/cacerts | tail' ``` -------------------------------- ### Mitmproxy Output Examples Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Observe normal traffic, TLS handshake failures due to certificate pinning, and client disconnections in mitmproxy output. ```text 127.0.0.1:12345: GET https://api.example.com/v1/users HTTP/2.0 user-agent: okhttp/4.11.0 authorization: Bearer eyJhbG... << HTTP/2.0 200 OK 2.1k content-type: application/json ``` ```text Client TLS handshake failed. The client does not trust the proxy's certificate for accounts.google.com ``` ```text 127.0.0.1:12345: GET https://example.com/api << client disconnected ``` -------------------------------- ### Get App Path with ADB Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Retrieves the file path of an installed Android application's base APK. ```bash adb shell pm path com.example.target ``` -------------------------------- ### Initialize C/C++ Development Environment Source: https://github.com/yzua/nixos/blob/master/dev-shells/cpp/README.md Use this command to initialize a new project directory with the C/C++ development template. ```bash nix flake init -t "/home/yz/System/dev-shells#cpp" ``` -------------------------------- ### Just Build and Deployment Pipeline Source: https://context7.com/yzua/nixos/llms.txt Commands for managing the build, linting, formatting, and deployment of the system. ```bash # Full pipeline (recommended) just all # modules, pkgs, lint (parallel) -> format -> check -> nixos -> home # Individual steps just modules # Validate import structure just pkgs # Check for duplicate packages just lint # statix + deadnix + shellcheck + markdownlint just format # nix fmt (nixfmt-tree) just check # nix flake check --no-build just nixos # Apply NixOS configuration just home # Apply Home Manager configuration # Utilities just diff # Diff current vs previous NixOS generation just update # Update flake inputs just clean # nh clean + HM generation expiry + store optimise # Security just security-audit # Systemd hardening + CVE scan # Secrets just sops-edit # Edit encrypted secrets just sops-view # View secrets (read-only) just secrets-add KEY # Add a single secret # AI agents just skills-sync # Sync AI agent skills from GitHub # Reports just report # Generate system health report just report-view # View latest system report ``` -------------------------------- ### Initialize Go Project Template Source: https://github.com/yzua/nixos/blob/master/dev-shells/go/README.md Use this command to initialize a new project directory with the Go development flake template. ```bash nix flake init -t "/home/yz/System/dev-shells#go" ``` -------------------------------- ### Incorrect su Invocation Example Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md Example of an incorrect way to invoke the `su` command. Avoid this method when troubleshooting root access. ```bash adb shell 'su -c id' ``` -------------------------------- ### Launch OpenCode RE sessions Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/README.md Use these commands to initialize the OpenCode agent with specific profiles for different analysis tasks. ```bash ocare "prepare the emulator and inspect this target" ocgptare "focus on protocol and auth mapping" ocglmare "look for root or anti-Frida checks" oczenare "do static APK triage first" ``` -------------------------------- ### Initialize and Enter Dev Shell Source: https://github.com/yzua/nixos/blob/master/dev-shells/AGENTS.md Commands to initialize a project from a template, enter the development shell, and enable automatic loading via direnv. ```bash # Initialize from template nix flake init -t "/home/yz/System/dev-shells#python-venv" # Enter dev shell nix develop # With direnv (automatic) echo 'use flake' > .envrc && direnv allow ``` -------------------------------- ### Initialize Node.js development environment Source: https://github.com/yzua/nixos/blob/master/dev-shells/nodejs/README.md Use this command to initialize a new project using the specified Nix flake template. ```bash nix flake init -t "/home/yz/System/dev-shells#nodejs" ``` -------------------------------- ### Launch RE Agents and Interact with Devices Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/WORKFLOW.md Entrypoints for automated agents and manual device interaction commands. ```bash ocare "triage this target" ocgptare "focus on traffic, endpoints, and auth" ocglmare "look for anti-analysis behavior" oczenare "static-first APK triage" ``` ```bash # Launch and navigate agent-device open Settings --platform android agent-device snapshot -i agent-device find "Network" click agent-device screenshot --out /tmp/screen.png agent-device close ``` ```bash adb install -r /path/to/app.apk adb shell monkey -p com.example.target -c android.intent.category.LAUNCHER 1 ``` ```bash adb shell pm list packages | grep example adb shell dumpsys package com.example.target | grep versionName adb shell pidof com.example.target adb shell dumpsys package com.example.target | rg "primaryCpuAbi|secondaryCpuAbi|nativeLibraryDir|split_config" adb shell pm path com.example.target adb shell getprop ro.product.cpu.abi ``` -------------------------------- ### Run Frida Hook Script (Spawn Mode) Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Injects and runs a Frida hook script into a target application when it starts. The `--no-pause` flag ensures the app starts immediately. ```bash frida -U -f com.example.target -l /tmp/hook-login.js ``` -------------------------------- ### Initialize Bun project with Nix flake Source: https://github.com/yzua/nixos/blob/master/dev-shells/bun/README.md Use this command to initialize a new project directory with the specified Bun development shell template. ```bash nix flake init -t "/home/yz/System/dev-shells#bun" ``` -------------------------------- ### Create Host Configuration Source: https://github.com/yzua/nixos/blob/master/README.md Copy existing host configuration to a new hostname and include the hardware configuration file. ```bash cp -r hosts/desktop hosts/ cp /etc/nixos/hardware-configuration.nix hosts// ``` -------------------------------- ### Get SELinux Enforcement Status Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Retrieves the current SELinux enforcement status on the Android device. ```bash adb shell getenforce ``` -------------------------------- ### Configure Host Settings Source: https://context7.com/yzua/nixos/llms.txt Define host-specific imports, system features, and boot parameters in the configuration file. ```nix # hosts/desktop/configuration.nix { ... }: { imports = [ ./hardware-configuration.nix ./local-packages.nix ../common-host-info.nix ../../nixos-modules ./modules ]; mySystem = { hostProfile = "desktop"; # Sets profile-based defaults # Override specific features waydroid.enable = false; flatpak.enable = false; i2pd.enable = true; yggdrasil.enable = true; netdata.enable = true; vnc.enable = true; webRe.enable = true; }; # LUKS encryption for swap partition boot.initrd.luks.devices."luks-5e77e20c-28e2-4012-bc2a-c4c02acf3aab".allowDiscards = true; } ``` -------------------------------- ### Get Process ID with ADB Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Finds the process ID (PID) of a running Android application. ```bash adb shell pidof com.example.target ``` -------------------------------- ### Initialize Deno Nix Flake Source: https://github.com/yzua/nixos/blob/master/dev-shells/deno/README.md Use this command to initialize a new Nix flake project with the Deno development environment template. ```bash nix flake init -t "/home/yz/System/dev-shells#deno" ``` -------------------------------- ### Configure Services in Nix Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/AGENTS.md Standard pattern for enabling and configuring services within Home Manager. ```nix services. = { enable = true; settings = { ... }; }; ``` -------------------------------- ### Manage AVD health and state Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/README.md Commands to check system health, start the emulator, and verify device status. ```bash bash scripts/ai/android-re/re-avd.sh doctor bash scripts/ai/android-re/re-avd.sh start bash scripts/ai/android-re/re-avd.sh status ``` -------------------------------- ### BTCA Add Repository Command Source: https://github.com/yzua/nixos/blob/master/guides/AI-AGENTS-GUIDE.md Register repositories or documentation for querying with btca. Use the generic pattern for adding resources. ```bash btca add -g -n ``` -------------------------------- ### Check Frida Boot Script Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md Verify that the Frida server startup script exists in `/data/adb/service.d/`. Use this if `frida-ps -U` works once but not after reboot. ```bash adb root adb shell 'ls -l /data/adb/service.d/frida.sh' ``` -------------------------------- ### Get App Version Name with ADB Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Retrieves the version name of an Android application by parsing the output of `dumpsys package`. ```bash adb shell dumpsys package com.example.target | grep versionName ``` -------------------------------- ### Force Stop App with ADB Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Forcefully stops a running Android application. Useful for ensuring a clean state before starting an app. ```bash adb shell am force-stop com.example.target ``` -------------------------------- ### Configure Programs in Nix Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/AGENTS.md Standard pattern for enabling and configuring programs within Home Manager. ```nix programs. = { enable = true; settings = { ... }; }; ``` -------------------------------- ### Initialize and Enter a Dev Shell Template Source: https://github.com/yzua/nixos/blob/master/dev-shells/README.md Use this command to initialize a new development shell from a template and then enter the shell. Replace `` with the desired template name. ```bash nix flake init -t "/home/yz/System/dev-shells#" nix develop ``` -------------------------------- ### Enter Nix Development Shell Source: https://github.com/yzua/nixos/blob/master/dev-shells/deno/README.md Run this command within the project directory to enter a bash shell pre-configured with Deno and other necessary packages. ```bash nix develop ``` -------------------------------- ### Configure Restic Backups Source: https://context7.com/yzua/nixos/llms.txt Set up automated Restic backups with defined repositories and retention policies. ```nix # nixos-modules/backup.nix mySystem.backup = { enable = true; repository = "/var/backup/restic"; # Or "s3:s3.amazonaws.com/bucket" }; ``` -------------------------------- ### Check Frida Server Status Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md Check if the Frida server is running on the device and list running processes. Use this when the Frida server does not start. ```bash bash scripts/ai/android-re/re-avd.sh frida-start frida-ps -U adb shell "su 0 sh -c 'ps -A | grep frida'" ``` -------------------------------- ### Connect to OpenAI via btca CLI Source: https://github.com/yzua/nixos/blob/master/guides/AI-AGENTS-GUIDE.md Establishes a connection using ChatGPT Plus credentials. Requires a Codex-compatible model like gpt-5.4. ```bash btca connect -g -p openai -m gpt-5.4 ``` -------------------------------- ### Development Shell Template Commands Source: https://context7.com/yzua/nixos/llms.txt Commands for listing, initializing, and entering development environments using Nix flakes. ```bash # List available templates nix flake show ./dev-shells # Initialize a new project with a template nix flake init -t "/home/user/System/dev-shells#rust-stable" nix flake init -t "/home/user/System/dev-shells#python-venv" nix flake init -t "/home/user/System/dev-shells#nodejs" nix flake init -t "/home/user/System/dev-shells#go" nix flake init -t "/home/user/System/dev-shells#bun" nix flake init -t "/home/user/System/dev-shells#deno" nix flake init -t "/home/user/System/dev-shells#cpp" nix flake init -t "/home/user/System/dev-shells#rust-nightly" # Enter the development shell nix develop ``` -------------------------------- ### Manage Dotfiles with Home Manager Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/AGENTS.md Methods for defining file content or linking source files for application configurations. ```nix home.file.".config/app/config" = { text = ''; # or source = ./path; }; xdg.configFile."app/style.css".text = ''; ``` -------------------------------- ### Check Frida Server Log Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md View the last 30 lines of the Frida server log file on the device. Use this for debugging when the Frida server does not start. ```bash adb shell "su 0 sh -c 'tail -30 /data/local/tmp/frida.log'" ``` -------------------------------- ### Perform static analysis Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/README.md Utilities for preparing APKs, generating hashes, and inventorying analysis results. ```bash bash scripts/ai/android-re/re-static.sh prepare /path/to/app.apk bash scripts/ai/android-re/re-static.sh hashes /path/to/app.apk bash scripts/ai/android-re/re-static.sh inventory ``` -------------------------------- ### Get Package Metadata with npm Source: https://github.com/yzua/nixos/blob/master/guides/AI-AGENTS-GUIDE.md Use this command to retrieve detailed metadata for an npm package, including its name, version, description, repository URL, homepage, and the latest distribution tag. ```bash npm view name version description repository.url homepage dist-tags.latest --json ``` -------------------------------- ### Verify Frida Server and Tool Version Match Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md Check the version of the Frida client tools and the Frida server running on the device. Both should match for proper functionality. ```bash # Verify version match frida --version adb shell "su 0 sh -c '/data/local/tmp/frida-server-17.5.1 --version'" # Both should print 17.5.1 ``` -------------------------------- ### Launch Ghostty from command line Source: https://github.com/yzua/nixos/blob/master/guides/GHOSTTY-GUIDE.md Use these commands to launch Ghostty with specific shells or custom application IDs for window rules. ```bash ghostty # Launch Ghostty ghostty -e zsh # Launch with specific shell ghostty --class=scratchpad # Launch with custom app-id (for window rules) ``` -------------------------------- ### Launch AI-Assisted RE Sessions Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/AGENTS.md These commands launch specialized AI agents for reverse engineering tasks. They start the Android RE baseline and open OpenCode with injected prompt context for specific analysis focuses. ```bash ocare "triage this APK and prepare the baseline" ``` ```bash ocgptare "focus on protocol mapping" ``` ```bash ocglmare "look for anti-Frida and pinning paths" ``` ```bash oczenare "static-first APK reconnaissance" ``` -------------------------------- ### AI Agent Task Management Patterns Source: https://github.com/yzua/nixos/blob/master/guides/AI-AGENTS-GUIDE.md These patterns guide how to delegate, execute, and parallelize tasks for AI agents to optimize performance and reduce overhead. Consider the task's coupling and analysis needs when choosing a strategy. ```text Task is independent? -> delegate or run in parallel Task is sequential? -> keep in a single agent Need deep analysis? -> use opus model Need fast scans? -> use haiku or flash model ``` -------------------------------- ### Register New Host in Inventory Source: https://github.com/yzua/nixos/blob/master/README.md Add your new hostname to the inventory file to register it within the system configuration. ```nix [ { hostname = "desktop"; stateVersion = "25.11"; enabled = true; } { hostname = "your-hostname"; stateVersion = "25.11"; enabled = true; } ] ``` -------------------------------- ### Apply Kernel and System Hardening Source: https://context7.com/yzua/nixos/llms.txt Configure kernel parameters, blacklist insecure modules, and apply sysctl settings for system security. ```nix # nixos-modules/security/hardening.nix (applied automatically) boot = { kernelParams = [ "vsyscall=none" # Disable legacy syscall interface "randomize_kstack_offset=on" # Randomize kernel stack "loglevel=4" # Restrict kernel log access ]; blacklistedKernelModules = [ "dccp" "sctp" "rds" "tipc" # Obscure network protocols "firewire-core" "thunderbolt" # DMA attack vectors "cramfs" "hfs" "hfsplus" # Obscure filesystems ]; kernel.sysctl = { "net.ipv4.tcp_syncookies" = 1; # SYN flood protection "kernel.kptr_restrict" = 2; # Hide kernel pointers "kernel.dmesg_restrict" = 1; # Root-only dmesg "kernel.yama.ptrace_scope" = 1; # Parent-only ptrace "kernel.unprivileged_bpf_disabled" = 1; # Disable unprivileged BPF "kernel.io_uring_disabled" = 2; # Disable io_uring "vm.mmap_rnd_bits" = 28; # Enhanced ASLR }; }; security = { apparmor.enable = true; protectKernelImage = true; lockKernelModules = true; }; # /proc hardening - hide other users' processes fileSystems."/proc".options = [ "defaults" "hidepid=2" ]; ``` -------------------------------- ### Open App with agent-device Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TOOLS.md Opens a specified application on an Android device using the agent-device tool. The platform must be specified. ```bash agent-device open com.example.target --platform android ``` -------------------------------- ### Initialize Python Development Environment Source: https://github.com/yzua/nixos/blob/master/dev-shells/python-venv/README.md Use this command to initialize a new Python development environment with venv using a Nix flake template. Ensure the path to the template is correct. ```bash nix flake init -t "/home/yz/System/dev-shells#python-venv" ``` -------------------------------- ### Home Manager Entrypoint Source: https://github.com/yzua/nixos/blob/master/AGENTS.md The entrypoint for Home Manager configuration. It imports local modules and packages, defining the user's environment. ```nix home-manager/home.nix importing ./modules and ./packages ``` -------------------------------- ### Interactive Inventory (ait) Source: https://github.com/yzua/nixos/blob/master/guides/AI-AGENTS-GUIDE.md Launches hierarchical fzf pickers to navigate AI tool families and sections. ```bash ait ``` ```bash ait --tool ``` ```bash ait --tool --section ``` -------------------------------- ### Initialize Rust Nightly Flake Source: https://github.com/yzua/nixos/blob/master/dev-shells/rust-nightly/README.md Use this command to initialize a new project using the specified Rust nightly flake template. ```bash nix flake init -t "/home/yz/System/dev-shells#rust-nightly" ``` -------------------------------- ### Open Settings with agent-device Debug Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md If agent-device commands fail, use the --debug flag when opening Settings to generate diagnostic logs for troubleshooting. ```bash agent-device open Settings --platform android --debug ``` -------------------------------- ### Check Emulator Status and Logs Source: https://github.com/yzua/nixos/blob/master/home-manager/modules/ai-agents/android-re/prompts/TROUBLESHOOTING.md Verify emulator status and check background boot logs. Use this when the emulator does not appear in `adb devices`. ```bash adb devices -l bash scripts/ai/android-re/re-avd.sh status # If launched via oc*are, check the background boot log: tail -f ~/Downloads/android-re-tools/re-avd-start.log ``` -------------------------------- ### Adding a New NixOS Host Source: https://github.com/yzua/nixos/blob/master/hosts/AGENTS.md Steps to add a new host configuration to a NixOS project. This involves copying an existing host, updating hardware configuration, and registering the host in the inventory. ```bash cp -r hosts/desktop hosts/ # Replace hardware-configuration.nix from target machine (/etc/nixos/) # Add host entry to hosts/_inventory.nix with hostname, stateVersion, and enabled = true # Adjust mySystem.* options in configuration.nix for hardware # Set services.avahi.allowInterfaces to the correct network interface # Create/modify modules/ for hardware-specific needs # Deploy: just nixos (or nh os switch --hostname ) ``` -------------------------------- ### Show Available Nix Flake Templates Source: https://github.com/yzua/nixos/blob/master/dev-shells/README.md Lists all available templates within the local dev-shells flake. ```bash nix flake show ./dev-shells ``` -------------------------------- ### Apply Home Manager Configuration Source: https://github.com/yzua/nixos/blob/master/AGENTS.md Applies the Home Manager configuration for the current user. This is typically run before applying NixOS system configurations to ensure user environment is set up correctly. ```bash just home ``` -------------------------------- ### Initialize Rust Stable Nix Flake Source: https://github.com/yzua/nixos/blob/master/dev-shells/rust-stable/README.md Use this command to initialize a new Rust development project with the stable toolchain using a Nix flake template. ```bash nix flake init -t "/home/yz/System/dev-shells#rust-stable" ```