move docs
This commit is contained in:
parent
78eda8579b
commit
01135c8d14
@ -152,5 +152,5 @@ in case you need manual control, an ides shell provides commands:
|
||||
- `restart`: do both of the above in succession
|
||||
|
||||
### documentation
|
||||
see [module docs](docs.md)
|
||||
see [module docs](docs/docs.md)
|
||||
|
||||
|
34
docs.nix
34
docs.nix
@ -1,34 +0,0 @@
|
||||
with import <nixpkgs> {};
|
||||
_: let
|
||||
eval = lib.evalModules {
|
||||
specialArgs = {inherit pkgs;};
|
||||
modules = [./ides.nix ./modules];
|
||||
};
|
||||
optionsDoc = nixosOptionsDoc {
|
||||
inherit (eval) options;
|
||||
|
||||
transformOptions = opt:
|
||||
opt
|
||||
// {
|
||||
# Clean up declaration sites to not refer to the NixOS source tree.
|
||||
declarations = let
|
||||
devDir = toString /home/bolt/code/ides;
|
||||
inherit (lib) hasPrefix removePrefix;
|
||||
in
|
||||
map
|
||||
(decl:
|
||||
if hasPrefix (toString devDir) (toString decl)
|
||||
then let
|
||||
subpath = removePrefix "/" (removePrefix (toString devDir) (toString decl));
|
||||
in {
|
||||
url = "https://git.atagen.co/atagen/ides/${subpath}";
|
||||
name = subpath;
|
||||
}
|
||||
else decl)
|
||||
opt.declarations;
|
||||
};
|
||||
};
|
||||
in
|
||||
runCommand "docs.md" {} ''
|
||||
cat ${optionsDoc.optionsCommonMark} > $out
|
||||
''
|
42
docs/docs.nix
Normal file
42
docs/docs.nix
Normal file
@ -0,0 +1,42 @@
|
||||
with import <nixpkgs> { };
|
||||
{ ... }:
|
||||
let
|
||||
eval = lib.evalModules {
|
||||
specialArgs = { inherit pkgs; };
|
||||
modules = [
|
||||
../ides.nix
|
||||
../modules
|
||||
];
|
||||
};
|
||||
optionsDoc = nixosOptionsDoc {
|
||||
inherit (eval) options;
|
||||
|
||||
transformOptions =
|
||||
opt:
|
||||
opt
|
||||
// {
|
||||
# Clean up declaration sites to not refer to the NixOS source tree.
|
||||
declarations =
|
||||
let
|
||||
devDir = toString /home/bolt/code/ides;
|
||||
inherit (lib) hasPrefix removePrefix;
|
||||
in
|
||||
map (
|
||||
decl:
|
||||
if hasPrefix (toString devDir) (toString decl) then
|
||||
let
|
||||
subpath = removePrefix "/" (removePrefix (toString devDir) (toString decl));
|
||||
in
|
||||
{
|
||||
url = "https://git.atagen.co/atagen/ides/${subpath}";
|
||||
name = subpath;
|
||||
}
|
||||
else
|
||||
decl
|
||||
) opt.declarations;
|
||||
};
|
||||
};
|
||||
in
|
||||
runCommand "docs.md" { } ''
|
||||
cat ${optionsDoc.optionsCommonMark} > $out
|
||||
''
|
2
docs/gendocs.sh
Executable file
2
docs/gendocs.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
cp $(nix-build docs.nix --no-out-link) docs.md
|
Loading…
Reference in New Issue
Block a user