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