feat(docs): add cheatsheet
This commit is contained in:
parent
68811a73d1
commit
7d68b078c7
3 changed files with 19 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
This flake uses the [files flake-parts module](https://flake.parts/options/files.html) to generate documentation.
|
This flake uses the [files flake-parts module](https://flake.parts/options/files.html) to generate documentation.
|
||||||
The list of generated files are:
|
The list of generated files are:
|
||||||
|
- [docs/cheatsheet.md](docs/cheatsheet.md)
|
||||||
- [README.md](README.md)
|
- [README.md](README.md)
|
||||||
The option `text.<name> supports either a string or a submodule with attributes order and parts. The parts attribute can either be a string, which will get concatenated in the order laid out in `text.<name>.order`, or can itself have the attributes order and parts, in which case it will be evaluated recursively.
|
The option `text.<name> supports either a string or a submodule with attributes order and parts. The parts attribute can either be a string, which will get concatenated in the order laid out in `text.<name>.order`, or can itself have the attributes order and parts, in which case it will be evaluated recursively.
|
1
docs/cheatsheet.md
Normal file
1
docs/cheatsheet.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
`__curPos.file` will give the full evaluated path of the nix file it is called in. See [this issue](https://github.com/NixOS/nix/issues/5897#issuecomment-1012165198) for more information.
|
17
modules/docs/cheatsheet.nix
Normal file
17
modules/docs/cheatsheet.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ lib, config, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) concatStringsSep singleton;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
text.cheatsheet = concatStringsSep "\n" [
|
||||||
|
"`__curPos.file` will give the full evaluated path of the nix file it is called in. See [this issue](https://github.com/NixOS/nix/issues/5897#issuecomment-1012165198) for more information."
|
||||||
|
];
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
files.files = singleton {
|
||||||
|
path_ = "docs/cheatsheet.md";
|
||||||
|
drv = pkgs.writeText "cheatsheet.md" config.text.cheatsheet;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue