drift-detection
Skill118 starsChanged 6 months agoApache-2.0View on GitHub
Detect configuration drift — manual changes that exist outside NixOS management. Offer to bring imperative changes into declarative config.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- murphytrueman/design-system-opstheir own version, first seen Sep 23, 2026
- ghively/infra-opstheir own version, first seen Jun 9, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- murphytrueman/design-system-ops★ 200same name
- ghively/infra-ops★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- app-deployerSkill
- deploy-ai-agentSkill
- file-managerSkill
- flight-recorderSkill
- generation-timelineSkill
- morning-briefingSkill
- natural-language-configSkill
- network-managerSkill
- nix-optimizerSkill
- predictive-resourcesSkill
- scaled-swarm-predictSkill
- security-hardeningSkill
- self-healingSkill
- service-explorerSkill
- spec-driven-developmentSkill
- swarm-predictSkill
- system-configSkill
- system-monitorSkill
- system-packagesSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
If packages found: offer to add them to environment.systemPackages in NixOS config.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Configuration Drift Detection
NixOS is declarative — the config should be the single source of truth. But reality drifts: manual edits, imperative installs, ad-hoc cron jobs. Detect and reconcile.
Checks
1. Imperatively installed packages
shell_exec({ command: "nix-env -q 2>/dev/null || echo 'none'" })If packages found: offer to add them to environment.systemPackages in NixOS config.
2. Manual files outside NixOS
shell_exec({ command: "find /etc -newer /etc/NIXOS -not -path '/etc/nixos/*' -not -path '/etc/resolv.conf' -type f 2>/dev/null | head -20" })Files modified after last NixOS rebuild may be manual edits.
3. Manual cron jobs
shell_exec({ command: "ls /etc/cron.d/ /var/spool/cron/crontabs/ 2>/dev/null" })Offer to convert to systemd timers in NixOS config.
4. Stale NixOS generations
shell_exec({ command: "nixos-rebuild list-generations 2>/dev/null | wc -l" })More than 20 generations → suggest cleanup.
5. Orphaned systemd units
shell_exec({ command: "systemctl list-units --state=failed --no-pager" })Remediation
For each drift finding, offer to bring it into NixOS:
Drift Report:
⚠️ 3 packages installed via nix-env: htop, ncdu, tree
→ Add to environment.systemPackages? [Y/n]
⚠️ /etc/cron.d/backup exists outside NixOS
→ Convert to systemd timer in NixOS config? [Y/n]
⚠️ 47 old NixOS generations (using 18GB)
→ Keep current + last 5, remove rest? [Y/n]
✅ No unauthorized file changes in /etc/nixos/
✅ All systemd services match NixOS configWhy This Matters
On Ubuntu, configuration drift is invisible and irreversible. On NixOS with osModa, you can:
- Detect that something was changed manually
- Reconcile by adding it to the declarative config
- Prove with the audit ledger that nothing unauthorized happened
- Reproduce the exact system state on new hardware
This is useful supporting evidence for compliance programs (SOC 2, etc.) — though not by itself proof of regulatory readiness.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

