{"id":24864758,"url":"https://github.com/3timeslazy/nix-search-tv","last_synced_at":"2026-02-05T23:03:30.876Z","repository":{"id":274890870,"uuid":"924026355","full_name":"3timeslazy/nix-search-tv","owner":"3timeslazy","description":"Fuzzy search for Nix packages.","archived":false,"fork":false,"pushed_at":"2025-09-10T23:44:00.000Z","size":10833,"stargazers_count":115,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T03:02:39.630Z","etag":null,"topics":["cli","fzf","nix","nixos","search","television"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3timeslazy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-29T09:30:56.000Z","updated_at":"2025-09-10T10:47:26.000Z","dependencies_parsed_at":"2025-02-19T01:23:05.547Z","dependency_job_id":"bdafdaae-89d3-4862-9fa2-17cec54bf2f9","html_url":"https://github.com/3timeslazy/nix-search-tv","commit_stats":null,"previous_names":["3timeslazy/nix-search-tv"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/3timeslazy/nix-search-tv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3timeslazy%2Fnix-search-tv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3timeslazy%2Fnix-search-tv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3timeslazy%2Fnix-search-tv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3timeslazy%2Fnix-search-tv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3timeslazy","download_url":"https://codeload.github.com/3timeslazy/nix-search-tv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3timeslazy%2Fnix-search-tv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29137754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T23:02:30.544Z","status":"ssl_error","status_checked_at":"2026-02-05T23:02:24.945Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","fzf","nix","nixos","search","television"],"created_at":"2025-01-31T23:55:35.245Z","updated_at":"2026-02-05T23:03:30.867Z","avatar_url":"https://github.com/3timeslazy.png","language":"Go","funding_links":[],"categories":["nix","Go","Discovery","Resources"],"sub_categories":["Discovery"],"readme":"# nix-search-tv\n\nFuzzy search for NixOS packages.\n\n---\n\n[![asciicast](https://asciinema.org/a/afNYMXrhoEwwh3wzOK7FbsFtW.svg)](https://asciinema.org/a/afNYMXrhoEwwh3wzOK7FbsFtW)\n\n\u003cdiv\u003e\n    \u003ca href=\"https://codeberg.org/3timeslazy/nix-search-tv\"\u003e\n        \u003cimg alt=\"Get it on Codeberg\" src=\"https://img.shields.io/badge/Codeberg-2184D0?style=for-the-badge\u0026logo=Codeberg\u0026logoColor=white\" height=\"60\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/3timeslazy/nix-search-tv\"\u003e\n        \u003cimg alt=\"Get it on GitHub\" src=\"https://img.shields.io/badge/GitHub-100000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" height=\"60\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## Installation\n\n### Nix Package\n\n```nix\nenvironment.systemPackages = [ nix-search-tv ]\n```\n\n### Flake\n\nThere are many ways how one can install a package from a flake, below is one:\n\n```nix\n{\n  inputs = {\n    nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";\n    nix-search-tv.url = \"github:3timeslazy/nix-search-tv\";\n  };\n\n  outputs = {\n    nixpkgs,\n    nix-search-tv,\n    ...\n  }: {\n    nixosConfigurations.system = nixpkgs.lib.nixosSystem {\n      modules = [\n        {\n          environment.systemPackages = [\n            nix-search-tv.packages.x86_64-linux.default\n          ];\n        }\n      ];\n    };\n  };\n}\n```\n\n## Usage\n\n`nix-search-tv` does not do the search by itself, but rather integrates\nwith other general purpose fuzzy finders, such as [television](https://github.com/alexpasmantier/television) and [fzf](https://github.com/junegunn/fzf)\n\n### Television\n\nAdd `nix.toml` file to your television cables directory with the content below:\n\n```toml\n[metadata]\nname = \"nix\"\nrequirements = [\"nix-search-tv\"]\n\n[source]\ncommand = \"nix-search-tv print\"\n\n[preview]\ncommand = \"nix-search-tv preview {}\"\n```\n\nor use the Home Manager option:\n\n```nix\nprograms.nix-search-tv.enableTelevisionIntegration = true;\n```\n\n### fzf\n\nThe most straightforward integration might look like:\n\n```sh\nalias ns=\"nix-search-tv print | fzf --preview 'nix-search-tv preview {}' --scheme history\"\n```\n\n\u003e [!NOTE]\n\u003e No matter how you use nix-search-tv with fzf, it's better to add `--scheme history`. That way, the options will be sorted, which makes the search experience better\n\nMore advanced integration might be found here in [nixpkgs.sh](./nixpkgs.sh). It is the same search but with the following shortcuts:\n\n- Search only Nixpkgs or Home Manager\n- Open package code declaration or homepage\n- Search GitHub for snippets with the selected package/option\n- And more\n\nYou can install it like:\n\n```sh\nlet\n  ns = pkgs.writeShellScriptBin \"ns\" (builtins.readFile ./path/to/nixpkgs.sh);\nin {\n  environment.systemPackages = [ ns ]\n}\n```\n\n## Configuration\n\nBy default, the configuration file is looked at `$XDG_CONFIG_HOME/nix-search-tv/config.json`\n\n```jsonc\n{\n  // What indexes to search by default\n  //\n  // default:\n  //   linux: [nixpkgs, \"home-manager\", \"nur\", \"nixos\"]\n  //   darwin: [nixpkgs, \"home-manager\", \"nur\", \"darwin\"]\n  \"indexes\": [\"nixpkgs\", \"home-manager\", \"nur\"],\n\n  // How often to look for updates and run\n  // indexer again\n  //\n  // default: 1 week (168h)\n  \"update_interval\": \"3h2m1s\",\n\n  // Where to store the index files\n  //\n  // default: $XDG_CACHE_HOME/nix-search-tv\n  \"cache_dir\": \"path/to/cache/dir\",\n\n  // Whether to show the banner when waiting for\n  // the indexing\n  //\n  // default: true\n  \"enable_waiting_message\": true,\n\n  // More about experimental below\n  \"experimental\": {\n    \"render_docs_indexes\": {\n      \"plasma\": \"https://nix-community.github.io/plasma-manager/options.xhtml\",\n    },\n    \"options_file\": {\n      \"agenix\": \"\u003cpath to options.json\u003e\",\n    },\n  },\n}\n```\n\n## Searchable package registries\n\n### Builtin\n\n- [Nixpkgs](https://search.nixos.org/packages?channel=unstable)\n- [Home Manager](https://github.com/nix-community/home-manager)\n- [NixOS](https://search.nixos.org/options)\n- [Darwin](https://github.com/LnL7/nix-darwin)\n- [NUR](https://github.com/nix-community/NUR)\n\n### Custom\n\n#### Parse HTML\n\n`nix-search-tv` can parse a documentation HTML page and extract options from it. How to tell if a page can be parsed? To understand that, check the links in the example below and if the documentation page looks exactly like one of them, it probably can be parsed.\n\n```jsonc\n{\n  \"render_docs_indexes\": {\n    // https://github.com/nix-community/plasma-manager\n    \"plasma\": \"https://nix-community.github.io/plasma-manager/options.xhtml\",\n  },\n}\n```\n\n#### Parse options.json file\n\nThe point of this setting is to generate the options file at nix build time and point `nix-search-tv` to them. Internally, the tool compares previous and the new path and only re-indexes it if the path has changes.\n\n```jsonc\n{\n  \"options_file\": {\n    // https://github.com/ryantm/agenix\n    \"agenix\": \"\u003cpath to built options.json\u003e\",\n\n    // https://jovian-experiments.github.io/Jovian-NixOS/index.html\n    \"jovian\": \"\u003cpath to built options.json\u003e\",\n  },\n}\n```\n\nHere's one way to generate the options.json files for `agenix` and `nixvim` using [unf](https://git.atagen.co/atagen/unf) and home-manager:\n\n```nix\n# flake.nix\n{\n  inputs = {\n    nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";\n    home-manager.url = \"github:nix-community/home-manager\";\n\n    agenix.url = \"github:ryantm/agenix\";\n    nixvim.url = \"github:nix-community/nixvim\";\n\n    unf = {\n      url = \"git+https://git.atagen.co/atagen/unf\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n  };\n\n  outputs = {\n    nixpkgs,\n    home-manager,\n    ...\n  } @ inputs : let\n    # It's not required to use `unf`, but even though\n    # it brings some dependencies, I use it because its easy.\n    mkOpts = system: module:\n      inputs.unf.lib.json {\n        inherit self;\n        pkgs = nixpkgs.legacyPackages.${system};\n\n        # not all modules can be evaluated easily. If your module\n        # does not evaluate, try checking this NüschtOS file:\n        #   https://github.com/NuschtOS/search.nuschtos.de/blob/main/flake.nix\n        modules = [module];\n      };\n  in {\n    nixosConfigurations.hostname = nixpkgs.lib.nixosSystem rec {\n      system = \"x86_64-linux\";\n      modules = [\n        home-manager.nixosModules.home-manager\n        {\n          # extraSpecialArgs is used here to pass the options files\n          # that depend on the flake inputs to home-manager modules,\n          # where configuration files are usually defined.\n          home-manager.extraSpecialArgs = {\n            inherit inputs;\n\n            agenixOptions = mkOpts system inputs.agenix.nixosModules.default;\n\n            # nixvim provides an options.json file already\n            nixvimOptions = inputs.nixvim.packages.${system}.options-json + /share/doc/nixos/options.json\n          };\n        }\n      ];\n    };\n  };\n}\n\n# home.nix\n{\n  pkgs,\n  lib,\n  ...\n} @ args : {\n  xdg.configFile.\"nix-search-tv/config.json\".text = builtins.toJSON {\n    experimental = {\n      options_file = {\n        agenix = \"${args.agenixOptions}\";\n        nixvim = \"${args.nixvimOptions}\";\n      };\n    };\n  };\n\n  # or, with home-manager\n  programs.nix-search-tv = {\n    enable = true;\n    settings = {\n      experimental.options_file = {\n        agenix = \"${args.agenixOptions}\";\n        nixvim = \"${args.nixvimOptions}\";\n      };\n    };\n  };\n}\n```\n\n## Credits\n\nThis project was inspired and wouldn't exist without work done by [nix-search](https://github.com/diamondburned/nix-search) contributors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3timeslazy%2Fnix-search-tv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3timeslazy%2Fnix-search-tv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3timeslazy%2Fnix-search-tv/lists"}