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"
},
"locked": {
"narHash": "sha256-LvO5VwFNFzb2xbmgw+fWhkrRY1KMlp5vxqQU/BqS0H8=",
"narHash": "sha256-7Y6SqdLWr/g8tqNjqakRbS0KVIA/yzRm3D/RnoTAuzE=",
"path": "./lib",
"type": "path"
},

View file

@ -54,13 +54,9 @@
}
);
jobs = import ./jobs { inherit nixpkgs; lib = nixpkgs.lib // lib; };
in
{
inherit jobs;
lib = utils.lib // {
inherit (lib)
mkFlake;
@ -81,6 +77,14 @@
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