nixos-operations
Skill9 starsChanged 55 days agoMITView on GitHub
Operate NixOS systems by choosing rebuild modes, managing generations and rollback, upgrading, cleaning the store, and diagnosing boot and service problems.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- devenv-projectSkill
- home-managerSkill
- microvm-nixSkill
- nix-darwinSkill
- nix-languageSkill
- nixos-coding-agentsSkill
- nixos-wikiSkill
- nixpkgs-developmentSkill
- nix-workflowSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Read the repository instructions and find out how the system is built:
- Very specific: line 37
Start with build or dry-activate to validate a change.
- Very specific: line 63
Use home-manager for user environments, nixpkgs-development for packaging, nixos-wiki for community guidance, and nix-workflow for general …
- Very specific: line 73
Never search /nix/store (for example find /nix/store/*foo-* -name libfoo.so) and never copy a literal store path.
- Very specific: line 77
Do not quote attribute names that are valid identifiers ([A-Za-z_][A-Za-z0-9_'-]*, dashes included).
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
NixOS operations
Establish the setup first
Read the repository instructions and find out how the system is built:
- a flake with
nixosConfigurations.<host>, or channels with/etc/nixos/configuration.nix; - the NixOS release (
nixos-version) andsystem.stateVersion; - the host being changed.
The bundled operations reference quotes the NixOS manual at the Nixpkgs master snapshot in sources.json, not necessarily the user's release. Check version-sensitive behaviour against the user's release. Never treat the manual's examples as a reason to move a system between channels and flakes.
Rebuild modes
nixos-rebuild builds a configuration and optionally activates it. Add
--flake .#HOST for flake systems.
| Mode | Effect | Changes the running system |
dry-build | Show what would be built or fetched | No |
build | Build into ./result | No |
dry-activate | Build and show what activation would change | No |
test | Activate now, but keep the previous boot default | Yes |
boot | Make it the boot default, activating on next boot | Yes, at reboot |
switch | Activate now and make it the boot default | Yes |
Start with build or dry-activate to validate a change. test, boot,
switch, --rollback, --upgrade and --target-host deployments change a
system. Propose them with the exact command, and run them only with the
user's authorization. The same applies to restarting services, deleting
generations, collecting garbage and changing boot entries.
Generations, rollback and upgrades
nixos-rebuild list-generations lists system generations. For rollback and
boot-menu recovery, read Rolling Back Configuration Changes. For channel
upgrades and flake input updates, read Upgrading NixOS. Treat an upgrade as
a deliberate, reviewable change: update inputs separately from configuration
edits, and build before switching.
Store cleaning, boot and services
- Cleaning the Nix Store explains garbage collection, and how deleting old generations removes rollback targets. Confirm which generations the user still needs first.
- Boot Problems covers kernel parameters and emergency shells.
- Service Management covers
systemctlandjournalctl. Reading status and logs is safe. Starting, stopping, restarting and enabling services change the system.
Related skills
Use home-manager for user environments, nixpkgs-development for packaging,
nixos-wiki for community guidance, and nix-workflow for general Nix
command-line practice, if they are installed. Otherwise use the
NixOS manual.
Modified excerpts from the Nixpkgs contributors are covered by COPYING.
Nix style
- Never search
/nix/store(for examplefind /nix/store/*foo-* -name libfoo.so) and never copy a literal store path. Find the providing package withnix-locate, and refer to it through Nix:${pkgs.foo}/liborlib.makeLibraryPath [ pkgs.foo ]. - Do not quote attribute names that are valid identifiers
(
[A-Za-z_][A-Za-z0-9_'-]*, dashes included). Writepkgs.foo-barandpackages.x86_64-linux, notpkgs."foo-bar". Quote only other names (".config/foo","2.0"), the keywordsassert else if in inherit let or rec then with, and interpolations ("${name}"). Upstream examples in references sometimes quote needlessly; do not copy that style.
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.

