{"id":14517179,"url":"https://github.com/NuschtOS/search","last_synced_at":"2025-08-31T20:32:21.051Z","repository":{"id":245744390,"uuid":"819110227","full_name":"NuschtOS/search","owner":"NuschtOS","description":"Simple and fast static-page NixOS option search","archived":false,"fork":false,"pushed_at":"2024-10-23T22:30:35.000Z","size":441,"stargazers_count":15,"open_issues_count":11,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-24T08:08:00.978Z","etag":null,"topics":["nix","nixos"],"latest_commit_sha":null,"homepage":"https://search.nüschtos.de","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NuschtOS.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-23T20:04:47.000Z","updated_at":"2024-10-23T22:30:38.000Z","dependencies_parsed_at":"2024-06-26T22:52:20.833Z","dependency_job_id":"04fb9a28-bb18-4b63-8fae-f9926a31a966","html_url":"https://github.com/NuschtOS/search","commit_stats":null,"previous_names":["nuschtos/search"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NuschtOS%2Fsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NuschtOS%2Fsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NuschtOS%2Fsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NuschtOS%2Fsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NuschtOS","download_url":"https://codeload.github.com/NuschtOS/search/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231627390,"owners_count":18402604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["nix","nixos"],"created_at":"2024-09-04T03:01:02.222Z","updated_at":"2025-08-31T20:32:21.032Z","avatar_url":"https://github.com/NuschtOS.png","language":"TypeScript","funding_links":[],"categories":["Discovery","Resources"],"sub_categories":["Discovery"],"readme":"# NüschtOS Search\n\nSimple and fast static-page NixOS option search\n\n## Deployments\n\n- General collection of community projects \u003chttps://search.nüschtos.de\u003e\n- All flakes used at C3D2 \u003chttps://search.nixos.c3d2.de\u003e\n- NixVim \u003chttps://nix-community.github.io/nixvim/search\u003e\n- Nixidy \u003chttps://arnarg.github.io/nixidy/options/search\u003e\n\n## Usage\n\nThere are two functions exposeed to build the directory containing the static search:\n\n| Name | Description | Available Options |\n|---|---|---|\n| `mkMultiSearch` | to build a search with multiple scopes (modules). | `baseHref`, `title` and `scopes` |\n| `mkSearch` | is a thin wrapper around `mkMultiSearch` to only use one scope (module). | `modules`, `optionsJSON`, `optionsPrefix`, `urlPrefix`, `baseHref` and `title` |\n\n### Explanation of options\n\n| Name | Description |\n|---|---|\n| `baseHref` | The directory to where the search is going to be deployed relative to the domain. Defaults to `/`. |\n| `title` | The title on the top left. Defaults to `NüschtOS Search`. |\n| `modules` | A list of NixOS modules as an attrset or file similar to the `nixosSystem` function. Exclusive with `optionsJSON`. |\n| `optionsJSON` | Path to a pre-generated `options.json` file. Exclusive with `modules`. |\n| `optionsPrefix` | A static prefix to append to all options. An extra `dot` is always appended. Defaults to being empty. |\n| `overrideEvalModulesArgs` | Allows overriding the arguments given to `lib.evalModules`. It can be used to eg. set the class of the module evaluation. |\n| `specialArgs` | works exactly like `specialArgs` in the module system. It allows adding extra arguments like `modulesPath`, `pkgs` or other variables. |\n| `urlPrefix` | The prefix which is prepended to the declaration link. This is usually a link to a git. |\n| `scopes` | is a list of attributes which each takes `name`, `modules`, `optionsJSON`, `optionsPrefix` or `urlPrefix` option. |\n\n### Examples\n\n```nix\nmkMultiSearch {\n  baseHref = \"/search/\";\n  title = \"Custom Search\";\n  scopes = [ {\n    name = \"NixOS Modules\";\n    modules = [ self.inputs.nixos-modules.nixosModule ];\n    urlPrefix = \"https://github.com/NuschtOS/nixos-modules/blob/main/\";\n  } {\n    name = \"Example Module\";\n    optionsJSON = ./path/to/options.json;\n    optionsPrefix = \"programs.example\";\n    urlPrefix = \"https://git.example.com/blob/main/\";\n    specialArgs = {\n      custom = \"foo\";\n    };\n    overrideEvalModulesArgs = {\n      class = \"nixos\";\n    };\n  } ];\n};\n```\n\n```nix\nmkSearch {\n  modules = [ self.inputs.nixos-modules.nixosModule ];\n  urlPrefix = \"https://github.com/NuschtOS/nixos-modules/blob/main/\";\n}\n```\n\n```nix\nmkSearch {\n  optionsJSON = ./path/to/options.json;\n  optionsPrefix = \"programs.example\";\n  urlPrefix = \"https://git.example.com/blob/main/\";\n}\n```\n\n```nix\nmkSearch {\n  optionsJSON = ./path/to/options.json;\n  urlPrefix = \"https://git.example.com/blob/main/\";\n  baseHref = \"/search/\";\n  title = \"Custom Search\";\n}\n```\n\n- Static page with GitHub Actions and Cloudflare/GitHub Pages \u003cbr/\u003e\n  \u003chttps://github.com/NuschtOS/search.nuschtos.de/blob/main/.github/workflows/gh-pages.yaml\u003e \u003cbr/\u003e\n  \u003chttps://github.com/NuschtOS/search.nuschtos.de/blob/main/flake.nix\u003e\n\n- Deployed with NixOS \u003cbr/\u003e\n  \u003chttps://gitea.c3d2.de/c3d2/nix-config/src/branch/master/hosts/nixos-misc/default.nix#L50-L148\u003e\n\n## Motivation\n\nWe wanted something similar to https://search.nixos.org to easily search through all the flakes options across many projects we accumulated in projects\nbut without the need to deploy an Elasticsearch. Ideally it should be just a static site with json blob that can be deployed on GitHub pages.\n\n## FAQ\n\n### Missing declaration\n\nThis is most often caused by using nix' `import` keyword to load a module in the flake instead of referencing it via the path type.\nThis causes the module system to no longer be aware of the origin of the module and the missing declaration.\n\n- If no arguments are being hand over, this can be easily fixed by removing the `import` keyword. (e.g. [change in sops-nix](https://github.com/Mic92/sops-nix/pull/645))\n- If arguments are being hand over, the module needs to be slightly refactored.\n- It is often the easiest to move everything depending on the arguments into the `flake.nix` and loading the module via the module systems `imports` variable. (e.g. [change in ifstate.nix](https://codeberg.org/m4rc3l/ifstate.nix/pulls/9))\n\n### default/example is a string/has extra surrounding quotes\n\nThis is caused by a missing `lib.literalExpression` in default/example. Please open a pull request against the source of that option to fix this.\n\n### Eval Errors\n\nSometimes default values are computed. As the required input data is typically not available, `defaultText` should be used. (e.g. [change in nixos-hardware](https://github.com/NixOS/nixos-hardware/pull/1343))\n\n## Debugging `options.json`\n\nGenerating a `options.json` in a `nix repl` can be done with the following snippet:\n\n```nix\n:b (pkgs.nixosOptionsDoc { inherit ((lib.evalModules { modules = [ { config._module.check = false; } outputs.nixosModules.default ]; })) options; warningsAreErrors = false; }).optionsJSON\n```\n\nIt is assumed that the flake was loaded before with `:lf` and the module(s) is/are under `nixosModules.default`. For some flakes this may need to be adapted.\n\n## Contact\n\nFor bugs and issues please open an issue in this repository.\n\nIf you want to chat about things or have ideas, feel free to join the [Matrix chat](https://matrix.to/#/#nuschtos:c3d2.de).\n\n## License\n\nLicensed under MIT license ([LICENSE](LICENSE) or \u003chttp://opensource.org/licenses/MIT\u003e).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNuschtOS%2Fsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNuschtOS%2Fsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNuschtOS%2Fsearch/lists"}