Merge pull request #262 from Pacman99/simplify-mkflakedoc

move mkFlakeDoc to packages output also drop jobs
This commit is contained in:
Pacman99 2021-04-24 13:10:33 -07:00 committed by GitHub
commit e6f548e723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 45 deletions

View File

@ -81,7 +81,7 @@
"utils": "utils_2" "utils": "utils_2"
}, },
"locked": { "locked": {
"narHash": "sha256-LvO5VwFNFzb2xbmgw+fWhkrRY1KMlp5vxqQU/BqS0H8=", "narHash": "sha256-7Y6SqdLWr/g8tqNjqakRbS0KVIA/yzRm3D/RnoTAuzE=",
"path": "./lib", "path": "./lib",
"type": "path" "type": "path"
}, },

View File

@ -54,13 +54,9 @@
} }
); );
jobs = import ./jobs { inherit nixpkgs; lib = nixpkgs.lib // lib; };
in in
{ {
inherit jobs;
lib = utils.lib // { lib = utils.lib // {
inherit (lib) inherit (lib)
mkFlake; mkFlake;
@ -81,6 +77,14 @@
lib = nixpkgs.lib // lib; lib = nixpkgs.lib // lib;
}; };
}; };
packages = {
mkFlakeDoc = pkgs.writeText "mkFlakeOptions.md"
(
pkgs.nixosOptionsDoc {
inherit (lib.mkFlake.evalArgs { nixos = "nixos"; args = { }; }) options;
}
).optionsMDDoc;
};
} }
); );

View File

@ -1,7 +0,0 @@
{ nixpkgs, lib, system ? "x86_64-linux" }:
let
pkgs = import nixpkgs { inherit system; overlays = [ ]; config = { }; };
in
{
mkFlakeDoc = import ./mkFlakeDoc.nix { inherit pkgs lib; };
}

View File

@ -1,33 +0,0 @@
{ pkgs, lib, ... }:
let
singleDoc = name: value: ''
## ${name}
${value.description}
${lib.optionalString (value ? type) ''
*_Type_*:
${value.type}
''}
${lib.optionalString (value ? default) ''
*_Default_*
```
${builtins.toJSON value.default}
```
''}
${lib.optionalString (value ? example) ''
*_Example_*
```
${value.example}
```
''}
'';
options = (
lib.mkFlake.evalArgs { nixos = "nixos"; args = { }; }
).options;
processedOptions = (pkgs.nixosOptionsDoc { inherit options; }).optionsNix;
fullDoc = lib.concatStringsSep "" (lib.mapAttrsToList singleDoc processedOptions);
in
pkgs.writeText "devosOptions.md" fullDoc