- Go 91.2%
- Nix 8.8%
| cmd | ||
| containers | ||
| db | ||
| docs | ||
| internal/options | ||
| nix | ||
| testdata | ||
| .envrc | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .golangci.yml | ||
| .goreleaser.yaml | ||
| .sqlfluff | ||
| CHANGELOG.md | ||
| container.nix | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| go.mod | ||
| go.sum | ||
| gomod2nix.toml | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
| renovate.json | ||
| shell.nix | ||
| sqlc.yaml | ||
| Taskfile.yml | ||
OptiNix
A CLI tool for searching options in Nix, written in Go, powered by the bubbletea framework for TUI.
Demo
TUI
No TUI - FZF
Install
There are several ways you can install OptiNix.
Nix flakes
Add OptiNix as an input to your flake, in your flake.nix file
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
optinix.url = "gitlab:hmajid2301/optinix";
};
outputs = {};
}
Then you can install the package in your nix config like in a devShell
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
optinix.url = "gitlab:hmajid2301/optinix";
};
outputs = {
self,
nixpkgs,
flake-utils,
optinix,
...
}: (
flake-utils.lib.eachDefaultSystem
(system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
optinix.packages.${system}.default
];
};
})
);
}
Go
You can install using go
go install gitlab.com/hmajid2301/optinix
Nix
You can install this package from nixpkgs, like you would with other packages.
nix-shell -p optinix
optinix --help
Usage
OptiNix is tool you can use on the command line to search options for NixOS, home-manager and Darwin.
Usage:
optinix [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
get Finds options
help Help about any command
update When you want to fetch the latest options.
Flags:
-h, --help help for optinix
-v, --version version for optinix
Use "optinix [command] --help" for more information about a comman
Nix with flakes
If you are running Nix and have flakes enabled in your configuration, you can run the tool like the command below. Without needing to "install" OptiNix.
nix run 'gitlab:hmajid2301/optinix' get niri
Key Maps
Navigation
jor↓: Down one item in listkor↑: Up one item in listg: Top of listG: End of list
Views
t: Toggle detail view to see more information about the optiono: Open option source in browser (when in detail view)
Filtering
n: Filter by NixOS options onlyh: Filter by Home Manager options onlyd: Filter by Darwin options onlya: Show all options (remove filter)
Other
qorEsc: Quit (or close detail view if open)/: Search (start typing to filter results)
Without TUI
By default, the tool will render a list using bubble tea, if you want just plain text output you can add the --no-tui flag.
optinix get podman --no-tui
Option: 0
Name: virtualisation.podman.networkSocket.server
Type: value "ghostunnel" (singular enum)
Default:
Example: "ghostunnel"
From: NixOS
Sources: [/nix/store/rhg90jpryc286xn9xjy6qjiaap6pjgdc-source/nixos/modules/virtualisation/podman/network-socket-ghostunnel.nix /nix/store/rhg90jpryc286xn9xjy6qjiaap6pjgdc-source/nixos/modules/virtualisation/podman/network-socket.nix]
Option: 1
Name: virtualisation.podman.networkSocket.enable
Type: boolean
Default: false
Example:
From: NixOS
Sources: [/nix/store/rhg90jpryc286xn9xjy6qjiaap6pjgdc-source/nixos/modules/virtualisation/podman/network-socket.nix]
Option: 2
Name: virtualisation.podman.enable
Type: boolean
Default: false
Example:
From: NixOS
Sources: [/nix/store/rhg90jpryc286xn9xjy6qjiaap6pjgdc-source/nixos/modules/virtualisation/podman/default.nix]
# ...
With FZF
You can integrate this tool with FZF as well, like so:
optinix get --no-tui | grep "^Option [0-9]" | cut -d' ' -f3 | fzf --preview="optinix get --no-tui '{}'"
Update
To get the latest options you can run the following command, to update your local database.
optinix update
Supported Sources
- NixOS
- Home Manager
- Darwin
Features to implement
- Add more sources (like manix has)
- Maybe nixvim even
- Get it working in Docker
Inspired By
- Manix: https://github.com/nix-community/manix
- When I started this project back last year, this project was not working but has since been fixed and had new features added

