Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

Repository files navigation

This project is archived and no longer maintained. No new features, bug fixes, or pull requests will be accepted. You are welcome to fork this repository if you'd like to continue development.

nixedit

A terminal UI for managing NixOS packages across modular configuration files.

Most NixOS setups split configuration across multiple imported files. nixedit follows those imports, shows all packages in one place, and edits the correct source file when you add or remove a package.

Features

  • Multi-file support - Recursively follows imports to discover all configuration modules
  • Unified package view - Aggregates environment.systemPackages from all modules
  • Live package search - Search nixpkgs with auto-debounce (searches after you stop typing)
  • Smart insertion - Auto-detects with pkgs; vs pkgs. syntax and indentation
  • Module selection - Choose which configuration file to install packages into
  • Duplicate detection - Warns if a package is already installed
  • Safe removal - Remove packages from their source file, preserving formatting
  • Rebuild integration - Automatic or manual nixos-rebuild switch after changes
  • Dry-run mode - Preview what would be built without applying changes
  • Persistent settings - Preferences saved to ~/.config/nixedit/settings.json

Installation

Flake

nix build github:roamingparrot/nixos-config-manager
nix-env -i ./result

Nix (non-flake)

nix-build
nix-env -i ./result

Development

./build.sh
# or manually:
cd src && mkdir -p build && cd build && cmake .. && make

Usage

sudo nixedit

Root privileges are required to edit /etc/nixos/ files and run nixos-rebuild.

Controls

Main View

Key Action
a Add package (open search)
d Mark/unmark for deletion
w Save changes and rebuild
; Open settings
j/k / Arrow keys Navigate
q Quit

Search

Key Action
Type Enter query (auto-searches)
j/k Navigate results
Enter Select package
Escape Cancel

Module Selection

Key Action
j/k Navigate modules
Enter Install to module
Escape Back to search

Settings

Key Action
j/k Navigate
Space / Enter Toggle option
Escape Save and close

Settings

Access settings with ; from the main view. Preferences persist across sessions.

Setting Default Description
Automatic Rebuild On Run nixos-rebuild switch automatically after changes
Dry Run Off Add --dry-run to preview changes without applying

Settings are stored in ~/.config/nixedit/settings.json.

How It Works

nixedit starts from /etc/nixos/configuration.nix, follows all imports, and parses environment.systemPackages blocks from each file. This gives a unified view while tracking which file each package belongs to.

# /etc/nixos/configuration.nix
{ imports = [ ./hardware-configuration.nix ./packages.nix ]; }

# /etc/nixos/packages.nix
{ environment.systemPackages = with pkgs; [ git neovim ]; }

Both git and neovim appear in the TUI, attributed to packages.nix. Removing either edits only that file.

Limitations

This is not a full Nix language parser. It uses pattern matching for common forms:

environment.systemPackages = with pkgs; [
  git
  neovim
];

Dynamic expressions like someFunction pkgs or complex Nix expressions in imports are not supported.

Rollback

NixOS tracks every configuration as a generation. If something goes wrong:

sudo nixos-rebuild switch --rollback

License

MIT

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages