# tagdex
`tagdex` is an mp3 tag indexer utility for fast music filtering.
An index of song metadata is kept in the music directory. It should be updated
every time songs are added, modified, or deleted.
## Usage
`tagdex [--path <path>] index` (re)populates the index. The default directory
is the cwd.
`tagdex [--path <path>] {title|album|artist|genre|year} [--null]` opens a
fzf-like search interface in which indexed songs can be selected by the named
attribute. Multiple values may be selected with the `tab` key. The output is a
list of file names associated with the selected songs, separated by newline
characters without `--null` or by null bytes with `--null`. The default
directory is the cwd.
`tagdex complete {bash|fish|zsh}` generates a shell completion file for the
named shell.
### Integrating with mpv
Bash users can insert this in their bashrc to have `td` execute `tagdex` and
pass its output to `mpv` (with some nice flags to reduce less-than-useful
output).
```bash
td() {
```
## Installation
The program can be built with `cargo build --release` or `nix build`.
### NixOS Module
The NixOS module provides the following options:
| `tagdex.enable` | Adds tagdex to PATH. |
| `tagdex.wrapper.enable` | Enables a version of the wrapper function above. |
| `tagdex.wrapper.directory` | Sets the default directory used in the wrapper function. |
If you don't want it in your path, you can reference it as `${pkgs.tagdex}`
without enabling it.
To use the module:
```nix
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
# 1. Add tagdex as a flake input.
tagdex = {
inputs.nixpkgs.follows = "nixpkgs";
url = "git+https://git.lwad.xyz/lwad/tagdex.git";
};
};
outputs = { nixpkgs, ... }@inputs: {
nixosConfigurations.yourHostname = nixpkgs.lib.nixosSystem {
# 2. Add the module from the input to your modules list.
modules = [
inputs.tagdex.nixosModules.default
];
};
};
}
```
[A full reference of module use.](https://git.lwad.xyz/lwad/nixos.git)