This repository has no description
1.3 kB
41 lines
1let
2 pkgs = import <nixpkgs> {};
3
4 mkNixosManual = let
5 inherit pkgs;
6 inherit (pkgs) lib;
7 # Reduces the attrs from a package set so broken packages evaluate (I think?)
8 scrubDerivations = namePrefix: pkgSet: lib.mapAttrs
9 (name: value:
10 let wholeName = "${namePrefix}.${name}"; in
11 if lib.isAttrs value then
12 scrubDerivations wholeName value
13 // (lib.optionalAttrs (lib.isDerivation value) { outPath = "\${${wholeName}}"; })
14 else value
15 )
16 pkgSet;
17 # An evluation of the specified system version with only the modules and no config
18 scrubbedEval = lib.evalModules {
19 modules = [
20 {
21 #imports = [ ./default.nix ];
22 }
23 ] ++ (import (pkgs.path + /nixos/modules/module-list.nix));
24 # Forward the filtered package set and the modules path
25 specialArgs = {
26 pkgs = scrubDerivations "pkgs" pkgs;
27 modulesPath = pkgs.path + /nixos/modules;
28 };
29 };
30 in (import (pkgs.path + /nixos/doc/manual)) rec {
31 # From parent scope
32 inherit (scrubbedEval) config;
33 # From let
34 inherit pkgs;
35 version = scrubbedEval.config.system.nixos.release;
36 revision = "release-${version}";
37
38 extraSources = [ ../. ];
39 options = scrubbedEval.options;
40 };
41in mkNixosManual