Add flake app and Documentation (#364)

* Add flake app

* Document adding and testing own flakes
This commit is contained in:
Yannik Sander 2021-11-23 13:58:38 +01:00 committed by GitHub
parent e2216a6cd6
commit a28c473b57
Failed to generate hash of commit
2 changed files with 23 additions and 1 deletions

View file

@ -58,3 +58,15 @@ application.
- GitHub Action can also be triggered via Pull Request, which if Pull Request - GitHub Action can also be triggered via Pull Request, which if Pull Request
was created from a non-forked repo's branch, will provide a preview url in a was created from a non-forked repo's branch, will provide a preview url in a
comment. comment.
## Adding flakes
To add your own flakes to the search index edit [./flakes/manual.toml](./flakes/manual.toml).
Possible types are `github`, `gitlab`, and `git` (which is the fallback for any kind of git repository but requires to set a revision key manually as of now).
To test whether your flake is compatible with nix flake-info you can try running `flake-info` against it
```
$ nix run github:nixos/nixos-search#apps.flake-info -- flake <your flake handle>
```

View file

@ -28,10 +28,20 @@
inputsFrom = builtins.attrValues (packages system); inputsFrom = builtins.attrValues (packages system);
NIXPKGS_PANDOC_FILTERS_PATH = "${nixpkgs + "/doc/build-aux/pandoc-filters"}"; NIXPKGS_PANDOC_FILTERS_PATH = "${nixpkgs + "/doc/build-aux/pandoc-filters"}";
}; };
apps = system:
{
flake-info = {
type = "app";
program = "${(packages system).flake_info}/bin/flake-info";
};
};
in in
{ {
defaultPackage = forAllSystems (mkPackage ./.); defaultPackage = forAllSystems (mkPackage ./.);
packages = forAllSystems packages; packages = forAllSystems packages;
devShell = forAllSystems devShell; devShell = forAllSystems devShell;
apps = forAllSystems apps;
defaultApp = forAllSystems (system: (apps system).flake-info);
}; };
} }