repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
neovim.mdMarkdown80 lines3.5 KiBsource raw download

NixDaemon IDE#

Neovim is built by nvf in modules/home/neovim.nix. Plugins, language servers, formatters and the Python debugger come from Nix. The colours follow the shared system palette. No plugin installation is needed inside Neovim.

Apply on the owner's laptop (nixosConfigurations.nixos, user daemonsec):

sudo nixos-rebuild switch --flake ~/NixDaemon#nixos
exec zsh

Open nvim for the Nix dashboard. Its c button opens the NixDaemon checkout; f finds files, g searches their contents, r opens recent files, and e opens the sidebar. nvim . opens Oil's directory editor. Press Space e for the tree.

Everyday keys#

The leader key is Space. Press it and wait for the command guide.

Keys Action
Space e / Space E Toggle tree / reveal current file
Space a Dashboard
Space ff / Space fg / Space fb Find files / search text / buffers
Space fr Recent files
- / Space o Parent directory / floating Oil editor
Space w / Space q Save / close window
gd / gr / K Definition / references / documentation
Space rn / Space ca Rename symbol / code actions
[d / ]d / Space le Previous / next diagnostic / show diagnostic
Space xx Collected diagnostics in the quickfix list
Space lf Format with nixfmt, Ruff, or the filetype's formatter
gcc / gc plus a motion Comment line / region
Ctrl h/j/k/l Move between windows
Ctrl \ Floating terminal (also closes it from terminal mode)
F5 / F9 Start or continue debugging / toggle breakpoint
F10 / F11 / F12 Debug step over / into / out
Space du / Space dq Toggle debugger UI / terminate debug session

In insert mode, completion appears as you type. Tab/Shift Tab select items, Enter accepts a selected item, Ctrl Space requests suggestions, and Ctrl e dismisses them. Quotes and (), [], {} close automatically; type the closing character to move past it. Formatting is manual with Space lf.

Nix and Python#

Nix uses nixd for package and option completion, plus statix/deadnix diagnostics and nixfmt. On the owner's account, nixd reads the live ~/NixDaemon flake's nixos and integrated Home Manager options. The first option lookup can take time while Nix evaluates the flake. Other accounts retain nixd's defaults.

Python uses basedpyright for types and completion, Ruff for linting/formatting, four-space indentation, and debugpy. Launch Neovim from your project directory. For a project virtual environment:

cd /path/to/project
python -m venv .venv
source .venv/bin/activate
nvim .

Install project dependencies into that environment using your project's normal workflow. The debugger detects venv/bin/python or .venv/bin/python under the working directory, then falls back to python on PATH. Language tools themselves are supplied by Nix. :LspInfo and :ConformInfo show their current status.

Zsh#

modules/home/shell.nix supplies ~/.zsh/autopair.zsh from the pinned nixpkgs package. The live dotfiles' config/core.zsh loads it after key bindings, so quotes, backticks and brackets pair at the prompt, closing characters skip over existing matches, and Backspace removes an empty pair. Open a fresh shell after rebuilding. Neovim now takes priority for EDITOR and VISUAL.

References: nvf configuration, nixd settings, zsh-autopair.