Nix-Gui allows for navigation and editing of Nixos options through a GUI.
The main window may be divided into four sections, the toolbar (purple), the navbar (red), the navlist (green), and the options editors (black).
The toolbar consists of three functioning tools:
- Save: Save changes by writing to module(s) in
nixos-config
path. - Undo: Revert most recent change to an options value.
- View Diff: Show a list of changes not yet saved.
The navbar is used to manipulate the “URI” being shown in the navlist and options editor. It contains the following:
- Back Button: Return to previous URI.
- Up Button: Change URI from
config:option.path.foo.bar
toconfig:option.path.foo
. - URI Field: Display the current URI. Can be edited if clicked. For option paths, the URI format is
config:option.path.here
, and for searches, the URI format issearch:search text here
. - Search Box: Change the URI to
search:entered text
.
The navlist displays option paths available for selection. For example, given a URI of config:i18n
(internationalization options) the navlist will display i18n.defaultLocale
, i18n.extraLocaleSettings
, i18n.glibcLocales
, i18n.inputMethods
, and i18n.supportedLocales
. Clicking i18n.defaultLocale
will change the URI to config:i18n.defaultLocale
, and load option editors with i18n.defaultLocal
.
The navlist provides metadata about option paths, including the number of direct children in the option heirarchy (the parenthesized number), and the state of the option and/or descendants. Green items indicate options whose value has been changed in this session, but not yet committed to disk, yellow items indicate options which are defined in your nixos-config
path, and white indicates options which are all undefined in your nixos-config
path.
The option editors section contains widgets for each option available for editing given a URI. For example, in the image above config:sound
is loaded and sound.enable
, sound.enableOSSEmulation
, sound.extraConfig
, sound.mediaKeys.enable
, and sound.mediaKeys.volumeStep
option editors are shown.
Each option editor contains metadata about the field including its name, description, and type.
If an option is undefined
, the system default value is applied, just as would be the case for options which aren’t defined in configuration.nix
. If an option is defined
, users can choose between different field widgets with which the option value will be set.
Field widgets are used to specify the definition of an option. There are standard field widgets for most nixos option types: Boolean
, String
, Int
, OneOf
, etc.
Nix-Gui evaluates option definitions expression to determine the current value of an option and sets the field widget accordingly. Changing a field widget will result in the option definition having a new expression. E.g. setting sound.enable
to true in a boolean field will result in sound.enable = true;
in nix code.
The literal expression may be edited as well by pressing the expression
button, which loads the expression editor field widget.
The reference
editor (not yet implemented) allows you to define an option by referencing another attribute path.
The option editor will automatically select an appropriate field widget based on the options current value.
screenshots for all of these and the expression field which they evaluate to
Nixui package manager attempts to have a UI similar to synaptic package manager.
- It controls the inclusion of packages using checkboxes in a list view.
- It shows details surrounding each package in that same list view.
- It allows filtering by category.
- It has a description of each package in a bottom pane.
- It provides search functionality.
The nature of nix packages requires a few changes. E.g.
- A single package may be contained in multiple attribute sets such as
pkgs.python37Packages.requests
,pkgs.python3Packages.requests
,pkgs.pythonPackages.requests
,(import <nixpkgs-unstable>).pythonPackages.requests
. - A packages attributes can be overridden.
TODO