fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . manual ; 8 9docs = import ../docs { 10inherit pkgs lib ; 11inherit ( config . home . version ) release isReleaseBranch ; 12}; 13 14in { 15options = { 16manual . html . enable = mkOption { 17type = types . bool ; 18default = false ; 19description = '' 20Whether to install the HTML manual. This also installs the 21{command}`home-manager-help` tool, which opens a local 22copy of the Home Manager manual in the system web browser. 23'' ; 24}; 25 26manual . manpages . enable = mkOption { 27type = types . bool ; 28default = true ; 29example = false ; 30description = '' 31Whether to install the configuration manual page. The manual can 32be reached by {command}`man home-configuration.nix`. 33 34When looking at the manual page pretend that all references to 35NixOS stuff are actually references to Home Manager stuff. 36Thanks! 37'' ; 38}; 39 40manual . json . enable = mkOption { 41type = types . bool ; 42default = false ; 43example = true ; 44description = '' 45Whether to install a JSON formatted list of all Home Manager 46options. This can be located at 47{file}`<profile directory>/share/doc/home-manager/options.json`, 48and may be used for navigating definitions, auto-completing, 49and other miscellaneous tasks. 50'' ; 51}; 52}; 53 54config = { 55home . packages = mkMerge [ 56( mkIf cfg . html . enable [ docs . manual . html docs . manual . htmlOpenTool ]) 57( mkIf cfg . manpages . enable [ docs . manPages ]) 58( mkIf cfg . json . enable [ docs . options . json ]) 59]; 60 61# Whether a dependency on nmd should be introduced. 62home . extraBuilderCommands = 63mkIf ( cfg . html . enable || cfg . manpages . enable || cfg . json . enable ) '' 64mkdir $out/lib 65ln -s ${ docs . nmdSrc } $out/lib/nmd 66'' ; 67}; 68 69}