repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
README.mdMarkdown353 lines18.1 KiBsource raw download
NixDaemon — a declarative NixOS offensive-security workstation in Gruvpine

Your desktop, editor, toolkit, and lab workflow — declared in one flake.
Built for authorised assessments, HackTheBox, and the CPTS path. The successor to IceBreaker.

NixOS unstable Dendritic flake Gruvpine theme
Linux: x86_64 and aarch64, with category limitations 23 toolkit categories Includes smoke checks and NixOS VM tests

Install · Daily operations · Arsenal · Editor guide · Gruvpine · Recovery

Choose the right host before installing or rebuilding. nixdaemon is the generic template, with user operator by default. nixos is the owner's laptop, with user daemonsec. On an existing system, preserve its accounts and use its verified configuration. Switching to a different host can remove accounts and password hashes; rolling back a generation does not restore that mutable state. Already locked out? Start with the recovery guide.

Overview#

Overview: what is NixDaemon?

NixDaemon brings the operating system and the working environment into the same repository. Nix builds the tools and their dependencies; Home Manager configures the shell and applications; small helpers connect the steps of a lab engagement. The lock file pins the inputs, and each toolkit category has its own enable switch.

Start with a Niri desktop, a Nix-configured Neovim IDE, and the default assessment toolkit. Choose an X11 desktop for a VM without 3D, or use a headless host. The generic configuration stands on its own; the personal laptop adds private identity, secrets, dotfiles, and hardware settings.

htbup                                      # connect the lab VPN
htbbox new Sauna 10.10.10.175 win easy       # create the box workspace and target
htbscan full                               # save scans under the box's recon directory
htbbox info                                # review ports, credentials, flags, and notes
htbcast -n enumeration                      # record a terminal session for the write-up

The workstation#

Payload manifest: the workstation
Layer What is included
Desktop Niri + Noctalia by default. Optional XFCE or i3 for VMs without 3D, or a headless console/SSH setup. The shared palette currently selects Gruvpine.
Editor Neovim through nvf: Nix-themed dashboard, file tree, completion, bracket pairing, Nix and Python language tools, formatting, Git signs, and Python debugging. Keys and setup →
Shell Zsh, Starship with target context, fzf, zoxide, Kitty, and Yazi. The generic host has a self-contained Home Manager setup; the laptop uses the owner's dotfiles.
Toolkit 23 categories: 12 enabled by default on x86_64, 11 optional. Packages are available system-wide, including for commands run with sudo.
Lab workflow VPN management, a shared $TARGET, clock-skew handling, per-box workspaces, scan imports, credentials and flags, and terminal recordings.
Payload library ~/pentesting/, htbpaths, and variables such as $privesc, $potatoes, and $ligolo. Pinned downloads plus cross-built agents for supported OS/architecture combinations.
VM integration Guest tools for VMware, VirtualBox, QEMU/KVM/UTM, and Hyper-V. Optional shared folders for VMware and VirtualBox.
Reference cards pentest-cheat, niri-cheat, nix-cheat, and gpg-cheat, with individual sections available from the terminal.
Validation Category checks for expected binaries, smoke runs, Python collision checks, and NixOS VM tests for the VPN, target, and clock helpers. Run them with nix flake check.

System requirements#

System requirements: choose your machine
Minimum Comfortable
CPU x86_64 or aarch64, 2 cores 4+ cores
RAM 4 GB; limit parallel builds 8–16 GB
Disk 60 GB 100 GB+ for generations, wordlists, and labs
Firmware UEFI or legacy BIOS UEFI, Secure Boot off for this setup
Graphics X11 desktop or headless if 3D is unavailable Working 3D for Niri

On aarch64, BloodHound CE is disabled automatically and the mobile category is unavailable. Niri and the toolkit get daily use; XFCE, i3, ARM, and some hypervisor combinations have had less testing. The installation guide covers the platform-specific details.

Installation#

Installation: start with your host
Your starting point Follow this path
A new bare-metal machine or VM Fresh install
An existing NixOS system Integrate with your existing system
Only the tools, on Linux or WSL Use the toolkit without installing NixDaemon
Fresh installation: clone, configure user and hardware, install the generic host, then boot

For a fresh generic installation, the machine-specific settings live in two files:

File Purpose
_settings.nix Username, hostname, architecture, boot mode, hypervisor, desktop, and optional toolkit categories
_hardware-configuration.nix Disks and kernel modules generated for your machine

From the installer, after following the guide to mount your target system at /mnt. This example uses the template's operator account; if you choose a different username, use it in the checkout path as well:

nix-shell -p git
git clone https://gitlab.com/DAEMON-404/NixDaemon.git /mnt/home/operator/NixDaemon
cd /mnt/home/operator/NixDaemon
nano modules/hosts/generic/_settings.nix
nixos-generate-config --root /mnt --show-hardware-configuration \
  > modules/hosts/generic/_hardware-configuration.nix
nixos-install --flake .#nixdaemon

Set your intended username before installing and change the initial password at first login. The checkout above will be ~/NixDaemon for that account after reboot, matching the generic host's nh configuration. The full guide covers first-boot ownership and account setup.

Daily operations#

Daily operations: build, work, record

The owner's laptop — the existing nixos host and daemonsec account:

cd ~/NixDaemon
sudo nixos-rebuild build --flake .#nixos    # build first, without activation
sudo nixos-rebuild switch --flake .#nixos   # apply the reviewed configuration

A generic installation — from its checkout, after verifying its configured accounts:

sudo nixos-rebuild build --flake .#nixdaemon
sudo nixos-rebuild switch --flake .#nixdaemon
Task Command
Update pinned inputs nix flake update, review the lock-file diff, then build and switch your existing host
Roll back system configuration sudo nixos-rebuild switch --rollback, or select a generation at boot
Keep the latest five generations and clean older store paths nh clean all --keep 5
Run repository checks nix flake check
Open the editor nvim; Space e opens the tree, Space ff finds files, Space lf formats

During a lab engagement:

htbup                                     # profiles live in ~/.config/htb/vpn/
htbbox new EscapeTwo 10.10.11.202 win medium sequel.htb dc01.sequel.htb
htbscan full                              # scan results → recon/ and box.json
htbtime                                   # handle Kerberos clock skew against the DC
htbbox info                               # the current box card
htbcast -n foothold                        # record the terminal session

pentest-cheat is the full reference. Use pentest-cheat ad or pentest-cheat pivot for a focused section.

Arsenal#

Arsenal: 23 categories, one switch each Default categories: recon, AD, web, pivot, crack, shells, core, Python, BloodHound, GUI, payloads, and wordlists. Eleven optional categories are listed below.
Default on x86_64 Optional
core, python, recon, ad, web, pivot dfir, reversing, wireless, radio, hardware, c2
crack, shells, bloodhound, gui, payloads, wordlists database, cloud, osint, social, mobile

Category modules live in modules/features/pentest/. The option is daemon.pentest.<category>.enable; generic installations set these through the pentest attribute set in _settings.nix:

pentest = {
  reversing = true;
  dfir = true;
  wireless = false;
};

To use a package category temporarily, enter its development shell:

nix develop .#pentest-recon

Use htbpaths to locate the payload library and pentest-update when updating its pinned upstream releases. The payload tree is managed separately from the package-category development shells.

Make it yours#

Make it yours: packages and modules

Add a toolkit package in its category's packages list. Add the executable name to expectedBins so the check verifies what is actually installed:

# Example shape inside a category module
packages = pkgs: with pkgs; [ ffuf gobuster feroxbuster wafw00f ];
expectedBins = [ "ffuf" "gobuster" "feroxbuster" "wafw00f" ];

The attribute and executable can differ: netexec provides nxc, for example. Use nix search nixpkgs <word> to find attributes, then inspect the package's executables when adding checks.

Add a personal application to the relevant host's environment.systemPackages or Home Manager home.packages. Add a category by following recon.nix, using the _sets.nix factory, and importing the new module from modules/features/pentest/default.nix.

New files must be tracked for a Git-backed flake to see them: use git add path/to/new-file.nix, then build your existing host before switching.

Architecture#

Architecture: how the dendritic modules fit together

flake-parts and import-tree load the Nix modules under modules/. Each module declares the outputs it owns, and modules refer to each other by name through self. Paths containing /_ are excluded from automatic loading; those files hold data, helper functions, or explicitly imported configuration.

NixDaemon/
├── flake.nix / flake.lock        inputs, pins, and module discovery
├── theme.nix                    active theme selector
├── modules/
│   ├── _palette.nix             shared colours and theme adapters
│   ├── hosts/
│   │   ├── generic/             nixdaemon: the portable template
│   │   │   ├── _settings.nix
│   │   │   ├── _hardware-configuration.nix
│   │   │   ├── default.nix
│   │   │   └── home.nix
│   │   └── laptop/              nixos: the owner's personal machine
│   ├── features/
│   │   ├── pentest/             toolkit, checks, dev shells, lab helpers
│   │   └── desktop/             Niri, Noctalia, XFCE, i3
│   └── home/                    editor, terminal, prompt, reference cards
├── docs/                        install, recovery, editor, SVG artwork
└── scripts/                     recovery and README artwork generation

The generic host builds without the owner's keys or dotfiles. The laptop host imports its personal identity, encrypted secrets, and hardware configuration. They share the toolkit, but are separate system configurations.

When things break#

Troubleshooting: diagnose and recover
Symptom First check
A newly created module is missing from the flake Track that specific file with git add path/to/file.nix
Black screen after starting Niri in a VM Check 3D support; choose desktop = "xfce" or "i3" for a VM without it
_settings.nix assertion fails Read the named setting and its allowed values
Boot fails after installation Verify the boot mode, disk configuration, and biosDevice where applicable
Build is killed or runs out of RAM Retry with --max-jobs 1 --cores 2
Payload hash mismatch Review the upstream release and update the relevant pin with pentest-update
Account missing or password rejected after changing hosts Follow live-USB recovery; rollback alone may not restore login
Desktop or packages regress after a rebuild Select the previous generation; mutable data is not rolled back

For step-by-step diagnosis, see installation troubleshooting. The recovery guide documents the recovery script, its backups, and the checks it performs before making account changes.

Documentation#

Documentation: keep the map close
Read For
Installation guide Fresh installs, existing NixOS systems, hypervisors, and tools-only setups
Recovery guide Missing accounts, password recovery, live USBs, and backups
Neovim guide Dashboard, tree, completion, Nix/Python tools, formatting, and debugging
Pentest card The lab workflow and toolkit, by section
Niri card Desktop keys and shell controls
Nix card Builds, updates, generations, and repository operations
Generic settings Every portable machine setting, commented
Artwork notes SVG sources, palette, and regeneration

From IceBreaker#

Lineage: from IceBreaker

NixDaemon succeeds IceBreaker, the earlier NixOS pentest flake. The workflow stays familiar while more of the environment moves into declarative configuration.

IceBreaker NixDaemon
setup.sh edits files before rebuilding _settings.nix plus standard NixOS install/build commands
Runtime pipx installs A pinned Python environment with collision checks
Downloaded tunnelling agents Cross-built ligolo-ng, chisel, fscan, and pspy agents
newbox, flag, cred, ~/targets/ htbbox, per-box box.json, and scan imports
settarget and ~/.target.env htbbox new/use/clear, refreshed in open terminals at their next prompt
Toolkit presets Per-category switches, development shells, and checks

Gruvpine and the artwork#

Theme and artwork: Gruvpine throughout Gruvpine palette: charcoal #282828, cream #ebdbb2, gold #fabd2f, sage #b8bb26, love #eb6f92, rose #ebbcba, foam #9ccfd8, iris #c4a7e7

Gruvpine combines Gruvbox's warm charcoal, cream, gold, and sage with Rosé Pine's love, rose, foam, and iris accents. It is the current selection in theme.nix; rose-pine and gruvbox are also available.

The shared modules/_palette.nix feeds Kitty, Starship, Fastfetch, Neovim, Yazi, rmpc, Zen Browser, GTK, pixel icons, desktop-shell colours, Niri, i3/XFCE, GRUB, and the console. Apply theme changes using your existing host and restart the desktop session to reload its colours. Restart Zen to reload its preferences and CSS. Wallpapers, cursors, Floorp, and some dotfiles-managed applications keep their own themes. See desktop theme configuration for Zen, GTK, the pixel icons, and the Home Manager directory migration.

The hero, section headers, dividers, palette, and diagrams are local SVGs. They use the repository's Gruvpine colour definitions and have no embedded raster images, remote fonts, or JavaScript. Regenerate them with:

python3 scripts/render-readme.py

The Shields badges use the same colours. Artwork details →

☧ NixDaemon · Gruvpine · built for authorised work