If you like this tool, why not Buy Me a Coffee☕
Nixian Jump is a navigation tool for NixOS configuration files that provides a hierarchical menu interface for quickly jumping to different sections of your configuration. It works with any editor that supports line number navigation, it was designed for the Helix text editor originally.
- NixOS Configuration file at
/etc/nixos/configuration.nix
- Required packages:
- rofi (menu interface)
- ydotool (keyboard input simulation)
- ydotoold (daemon service)
Add these configurations to your configuration.nix
:
# Required packages
environment.systemPackages = with pkgs; [
rofi-wayland # Use rofi-wayland for Wayland compatibility
ydotool
];
# Critical: Security wrapper for ydotool
security.wrappers.ydotool = {
owner = "root";
group = "wheel";
capabilities = "cap_dac_override,cap_sys_admin+ep";
source = "${pkgs.ydotool}/bin/ydotool";
};
# Enable ydotool service
services.ydotool = {
enable = true;
};
# Ensure your user is in the wheel group
users.users.YOUR_USERNAME = {
extraGroups = [ "wheel" ]; # Add to existing groups
};
Add these configurations to your configuration.nix
:
# Configure the service
systemd.user.services.ydotool = {
description = "ydotool daemon";
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.ydotool}/bin/ydotoold";
Restart = "always";
RuntimeDirectory = "ydotool";
RuntimeDirectoryMode = "0755";
};
environment = {
XDG_RUNTIME_DIR = "%t";
WAYLAND_DISPLAY = "wayland-1";
};
};
After adding these configurations, you'll need to:
- Replace
YOUR_USERNAME
with your actual username - Log out and log back in (to apply the group changes)
- Enable and start the ydotool service:
systemctl --user enable ydotool systemctl --user start ydotool
- Verify the service is running:
systemctl --user status ydotool
The socket should now be properly created at /run/user/YOUR_UID/.ydotool_socket
Add this script configuration to your configuration.nix
:
environment.systemPackages = with pkgs; [
(writeScriptBin "hx-jump" ''
#!/bin/sh
if ! pgrep -x "ydotoold" > /dev/null; then
echo "ydotoold is not running. Starting it..."
systemctl --user start ydotool
sleep 1
fi
CONFIG_FILE="/etc/nixos/configuration.nix"
show_menu() {
local prompt_text="$1"
{
echo "# Main Sections"
grep -n "^#[0-9]\+\[\(.*\)\]" "$CONFIG_FILE" | \
sed 's/:#\([0-9]*\)\[\(.*\)\]/|\1|\2/' | \
awk -F'|' '{printf "%s|%s\n", $1, $3}'
echo "# Sub Sections"
grep -n "^#[0-9]\+>\[\(.*\)\]" "$CONFIG_FILE" | \
sed 's/:#\([0-9]*\)>\[\(.*\)\]/|\1| ┗━ \2/' | \
awk -F'|' '{printf "%s|%s\n", $1, $3}'
} | sort -n | \
column -t -s'|' | \
rofi -dmenu \
-p "$prompt_text" \
-theme-str '
window {
width: 800px;
height: 600px;
location: center;
anchor: center;
transparency: "real";
background-color: #2E3440;
border: 3px solid;
border-color: #4C566A;
border-radius: 12px;
}
mainbox {
background-color: transparent;
children: [inputbar, listview];
}
inputbar {
padding: 0px;
margin: 0px 0px 20px 0px;
background-color: #3B4252;
text-color: #ECEFF4;
border-radius: 8px;
border: 1px solid;
border-color: #4C566A;
children: [prompt, textbox-prompt-colon, entry];
}
prompt {
enabled: true;
padding: 12px;
background-color: transparent;
text-color: inherit;
}
textbox-prompt-colon {
expand: false;
str: "";
padding: 12px;
text-color: inherit;
}
entry {
padding: 12px;
background-color: transparent;
text-color: inherit;
placeholder: "Search sections...";
placeholder-color: #4C566A;
}
listview {
columns: 1;
lines: 10;
scrollbar: true;
padding: 10px;
background-color: transparent;
border: 0px;
}
scrollbar {
width: 4px;
padding: 0;
handle-width: 8px;
border: 0;
handle-color: #4C566A;
}
element {
padding: 12px;
background-color: transparent;
text-color: #ECEFF4;
border-radius: 8px;
}
element normal.normal {
background-color: transparent;
text-color: #ECEFF4;
}
element selected.normal {
background-color: #3B4252;
text-color: #88C0D0;
border: 1px solid;
border-color: #4C566A;
}
element-text {
background-color: transparent;
text-color: inherit;
highlight: bold #88C0D0;
}
' \
-matching fuzzy \
-i \
-no-custom \
-hover-select \
-me-select-entry "" \
-me-accept-entry "MousePrimary"
}
if [ ! -r "$CONFIG_FILE" ]; then
echo "Error: Cannot read $CONFIG_FILE"
exit 1
fi
selection=$(show_menu "Jump to section")
if [ -n "$selection" ]; then
line_number=$(echo "$selection" | awk '{print $1}')
if [ -n "$line_number" ]; then
${pkgs.ydotool}/bin/ydotool type "$line_number"
sleep 0.1
${pkgs.ydotool}/bin/ydotool type "g"
${pkgs.ydotool}/bin/ydotool type "g"
fi
fi
'')
];
After adding all components, rebuild your system:
sudo nixos-rebuild switch
Nixian Jump uses a special syntax in your configuration file to mark sections:
#1[Category Name]
#
marks the start of a category1
is the category number- Text inside
[]
is the category name
#1>[Subcategory Name]
- Similar to main categories but includes
>
- The
>
indicates this is a subcategory - Displayed with a tree branch (┗━) in the menu
#1[System Configuration]
# ... configuration items ...
#1>[Boot Options]
# ... boot-related configuration ...
#1>[Network Settings]
# ... network-related configuration ...
In the example, [Boot Options] and [Network Settings] are subcategories of [System Configuration]
Add this to your Helix configuration (config.toml
):
[keys.normal.space]
u = [":sh hx-jump"]
This allows you to trigger Nixian Jump with Space + u
in normal mode.
- Ensure
ydotoold
is running:systemctl --user start ydotool
- Run
hx-jump
from your terminal or trigger it from your editor - Use the rofi menu to select a section:
- Type to search (fuzzy-find enabled)
- Use arrow keys or mouse to navigate
- Press Enter or click to select
- The script will automatically jump to the selected section in your configuration file
- Hierarchical navigation system
- Fuzzy search functionality
- Beautiful Nord-themed interface
- Mouse and keyboard navigation
- Section categorization with visual hierarchy
- Instant jumping to any config section