nixcf-service-firewall

Refactors NixOS and Home Manager services with single-owner firewall rules in the nixcf repository.

Updated Jun 23, 2024
One-click install
npx skills add https://github.com/lifeich1/nixcf --skill nixcf-service-firewall-lifeich1
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nixcf-service-firewall
Source: https://github.com/lifeich1/nixcf/tree/main/.agents/skills/nixcf-service-firewall
Command: npx skills add https://github.com/lifeich1/nixcf --skill nixcf-service-firewall-lifeich1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Changing network-facing services in a multi-host NixOS flake risks duplicated firewall rules, lockouts, broken state, and leaked secrets. This Skill guides safe service and firewall refactors in the nixcf repository by enforcing single rule ownership, typed options, and staged validation. ## Core Features & Use Cases - Firewall ownership migration: Inventory declared and evaluated rules, assign each TCP/UDP rule to exactly one owning module, and migrate without lockout. - Service hardening and state preservation: Design typed options (ports, bind addresses, openFirewall), minimize privileges with systemd hardening, and protect state for Gitea, Attic, Hobob, Syncthing, vlmcsd, and recorder containers. - Secret-safe workflows: Wire Agenix runtime credentials without exposing secret content, gated by a source-safety check before any Nix evaluation. - Use Case: When moving a Gitea or Attic firewall rule from a broad host-level range into the service module, use this Skill to compare evaluated ports before and after, preserve data paths, and stage rollout per host. ## Quick Start Use the nixcf-service-firewall skill to move the Gitea firewall rule into its service module and verify the evaluated ports stay unchanged.

Frequently Asked Questions about nixcf-service-firewall

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a NixOS firewall rule to a service module without lockout?▼

Inventory declared and evaluated rules first, add the service-owned rule while keeping the existing broad rule, then compare evaluated TCP/UDP ports before removing duplicates. Tighten broad ranges only in a separate change after deciding exposure and recovery paths.

How should Home Manager containers handle NixOS firewall rules?▼

A Home Manager module should not silently own the system firewall. Expose bind, host-port, and access intent in the user module, then route any required NixOS firewall rule through one explicit system-level owner.

Does this Skill support aarch64-linux containers on Raspberry Pi?▼

Yes, it requires immutable approved image digests and manifest architecture inspection for every enabled architecture. Pi images must be validated on aarch64-linux, separately from x86_64-linux hosts like GTR7.

Can the Skill deploy or restart services after refactoring?▼

No, it never deploys, restarts services, migrates data, or alters a live firewall without explicit user authorization for that exact action. Local validation stops at evaluation and nix flake check; deployment goes to a separate workflow.

How are secrets handled when changing services like Attic?▼

Secrets are wired through Agenix runtime files or systemd credentials, never interpolated into Nix strings, derivations, or logs. A source-safety gate script must pass before any Nix evaluation, and .age payloads are never opened.