Configuration / tooling collection — Nix flake with a NixOS module, dev shell, and standalone config templates (nftables, WireGuard, NetworkManager, DNS)

Network

Network

Version 1.00Source on GitHub

OVERVIEW

"Qompass AI Network Tooling": a Nix flake providing a network-security and encryption environment — rage/age/OpenSSL encryption tools, collision-resistant hash utilities (BLAKE3, SHA3-256, SHA-512), NetworkManager, and Unbound DNS-over-TLS — plus standalone nftables, WireGuard, and nmcli material. The flake's `nixosModules.default` hardens kernel sysctls and configures NetworkManager, systemd-resolved, and Unbound with the settings below.

HOW IT WORKS

  1. 1Clone and bootstrap: `git clone https://github.com/qompassai/network.git`, `cd network`, `chmod +x scripts/nix.sh`, `./scripts/nix.sh` — the script installs Nix if needed, enables flakes/experimental features, writes an optimised `nix.conf`, tests the tools, and drops you into the dev environment.
  2. 2Or enter the environment later with `nix develop` from the repo directory.
  3. 3Build just one piece, e.g. `nix build .#hash-utils` then `./result/bin/hash-utils blake3 somefile.txt`, or `nix build .#networkmanager-setup`.
  4. 4Or run a tool without installing: `nix run github:qompassai/network#hash-utils blake3 myfile.txt`.
  5. 5On NixOS, import the flake's `nixosModules.default` to apply the sysctl, NetworkManager, resolved, and Unbound settings.
  6. 6For public Wi-Fi via nmcli: enable NetworkManager, turn the radio on, list networks, and connect.
How it works, step by step — each step as the project's own documentation states it.

CONCEPTS

DNS UNDER THE HARDENED MODULE — NOTHING LEAVES IN PLAINTEXTAPP / CLIENTissues a querySYSTEMD-RESOLVEDstub listener · DNSSEC onUNBOUNDloopback only · 127.0.0.1, ::1UPSTREAM — DNS-OVER-TLS :8531.1.1.1@853 · 1.0.0.1@853 · 9.9.9.9@853 (+ IPv6)resolved is pointed at Unbound: DNS=127.0.0.1NetworkManager DNS plugin: systemd-resolvedUNBOUND HARDENING — FROM FLAKE.NIXqname-minimisation · prefetch + prefetch-key · hide-identity · hide-versionharden-* flags on · cache TTL bounded 300–14400 s · all queries TLS-forwardedRESOLVED FALLBACKfallbackDns: 1.1.1.1 · 9.9.9.9Wi-Fi power saving off (module)SURROUNDING POSTURE — WIREGUARD + NFTABLESnftables template (table inet my_filter): input policy drop · established/related + loopback acceptedWireGuard in on UDP 51820 · kernel sysctls refuse ICMP redirects (IPv4 + IPv6)the nftables file is a standalone template — its header states nothing was applied to a live firewall
DNS resolution under the flake's NixOS module: systemd-resolved's stub listener hands queries to a loopback-only Unbound, which forwards everything upstream over DNS-over-TLS on port 853; WireGuard and the nftables template form the surrounding posture. Values are the module's own, from flake.nix and the shipped nftables template.

CONFIGURATION

OptionDefaultWhat it does
boot.kernel.sysctl `net.ipv4.conf.all.accept_redirects` / `send_redirects` (+ default and IPv6 equivalents)0ICMP redirects disabled on all/default interfaces, IPv4 and IPv6
networking.networkmanager.enabletrueNetworkManager enabled by the module
networking.networkmanager.dnssystemd-resolvedNetworkManager DNS plugin
networking.networkmanager.wifi.powersavefalseWi-Fi power saving off
services.resolved.dnssec"true"DNSSEC validation in systemd-resolved
services.resolved.fallbackDns["1.1.1.1", "9.9.9.9"]Fallback DNS servers
services.resolved.extraConfigDNS=127.0.0.1`, `Cache=yes`, `DNSStubListener=yesResolved points at the local Unbound
services.unbound.settings.server.interface["127.0.0.1", "::1"]Unbound listens on loopback only
services.unbound.settings.server cache-min-ttl / cache-max-ttl300 / 14400Unbound cache TTL bounds (seconds)
services.unbound.settings.server hardening`hide-identity`, `hide-version`, `qname-minimisation`, `prefetch`, `prefetch-key`, `harden-*` all truePrivacy and DNSSEC hardening flags
services.unbound.settings.forward-zone "."forward-tls-upstream true; forward-addr `1.1.1.1@853`, `1.0.0.1@853`, `9.9.9.9@853` (+ IPv6)All queries forwarded over DNS-over-TLS (port 853)
scripts/nix.sh nix.conf`experimental-features = nix-command flakes`, `max-jobs` = cores (max 8), substituters cache.nixos.org + nix-community cachix (+ FlakeHub extra)User Nix configuration written by the bootstrap script
nftables template `table inet my_filter` chain inputpolicy drop; accepts established/related, loopback, ICMP/ICMPv6 (rate-limited echo), UDP 51820 (WireGuard), TCP {22, 80, 389, 443, 636, 2375, 2376, 3000, 9001, 9030, 9050, 9051, 11371, 13340, 13342}Standalone template ruleset — header states it is a template and "nothing here was applied to a live firewall"
devShells.default packagesage, rage, nix-rage, openssl 3.5, b3sum/rhash, nmap, tcpdump, wireshark-cli, unbound, networkmanager (+ openvpn/openconnect plugins), gnupg, yubikey-manager, etc.Tools provided in the dev shell (also the default package context for the module's system packages)

CONTROLS

ActionControl
Bootstrap the environment`./scripts/nix.sh` (after `git clone` + `chmod +x`)
Enter the dev environmentnix develop
Build the hash utilitiesnix build .#hash-utils
Hash a file./result/bin/hash-utils blake3 <file>` / `hash-utils sha3-256 <file>` / `hash-utils sha512 <file>
Run a tool without installingnix run github:qompassai/network#hash-utils blake3 myfile.txt
Build the user-level NetworkManager setupnix build .#networkmanager-setup` then `./result/bin/networkmanager-setup
Check the configuration`network-security-check` (package in flake.nix; checks NetworkManager/Unbound activity, DNS resolution, tool versions)
Generate a rage key (setup package)`rage-setup` (package in flake.nix; creates `~/.config/rage/key.txt` via `rage-keygen`)
Encrypt a file (example)rage-keygen -o mykey.txt` then `rage -e -i mykey.txt -o secret.age plaintext.txt
Connect to public Wi-Fisudo systemctl enable --now NetworkManager`; `nmcli radio wifi on`; `nmcli device wifi list`; `sudo nmcli device wifi connect "YOUR_SSID" password "YOUR_PASSWORD" ifname wlan0

NOT COVERED

- `wireguard/quickstart.sh`, `nmcli/quickstart.sh`, `scripts/config.sh`, `etc/NetworkManager/`, and `nftables/monero.nft` exist but were not read in full; only `nftables/nftables.conf` and `nmcli/README.md` were verified among the standalone templates. - `doh/` contains a single file named `doh-client-disabled`; no DNS-over-HTTPS configuration could be sourced from it. - `docs/IP.md` is a generic GitHub Pages custom-domain DNS table, not network-tooling documentation. - The README says the tools are "presented for educational purposes ONLY".

REFERENCES

  1. RFC 7858 — Specification for DNS over Transport Layer Security (TLS)DNS-over-TLS: the protocol Unbound's forward-tls-upstream setting speaks to 1.1.1.1, 1.0.0.1, and 9.9.9.9 on port 853 in the module.
  2. WireGuard: Next Generation Kernel Network Tunnel (whitepaper)The WireGuard protocol paper; the repo ships WireGuard material and its nftables template admits WireGuard traffic on UDP 51820.
  3. nftables wikiThe nftables documentation for the table, chain, and policy model the repo's standalone template ruleset (table inet my_filter, input policy drop) is written in.